mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 21:10:25 +00:00
fix(ci): use process env for provider compat fallback
This commit is contained in:
@@ -60,7 +60,7 @@ export function resolvePluginProviders(params: {
|
||||
? withBundledProviderVitestCompat({
|
||||
config: allowlistCompatConfig,
|
||||
pluginIds: bundledProviderCompatPluginIds,
|
||||
env: params.env,
|
||||
env,
|
||||
})
|
||||
: allowlistCompatConfig;
|
||||
const providerPluginIds = resolveEnabledProviderPluginIds({
|
||||
|
||||
@@ -278,6 +278,38 @@ describe("resolvePluginProviders", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("uses process env for Vitest compat when no explicit env is passed", () => {
|
||||
const previousVitest = process.env.VITEST;
|
||||
process.env.VITEST = "1";
|
||||
try {
|
||||
resolvePluginProviders({
|
||||
bundledProviderVitestCompat: true,
|
||||
onlyPluginIds: ["google"],
|
||||
});
|
||||
|
||||
expectLastLoadPluginsCall({
|
||||
onlyPluginIds: ["google"],
|
||||
});
|
||||
expect(getLastResolvedPluginConfig()).toEqual(
|
||||
expect.objectContaining({
|
||||
plugins: expect.objectContaining({
|
||||
enabled: true,
|
||||
allow: ["google"],
|
||||
entries: {
|
||||
google: { enabled: true },
|
||||
},
|
||||
}),
|
||||
}),
|
||||
);
|
||||
} finally {
|
||||
if (previousVitest === undefined) {
|
||||
delete process.env.VITEST;
|
||||
} else {
|
||||
process.env.VITEST = previousVitest;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
it("does not leak host Vitest env into an explicit non-Vitest env", () => {
|
||||
const previousVitest = process.env.VITEST;
|
||||
process.env.VITEST = "1";
|
||||
|
||||
Reference in New Issue
Block a user