mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:40:43 +00:00
test: fix full ci suite follow-ups
This commit is contained in:
@@ -69,6 +69,12 @@ import { createUtilsVitestConfig } from "./vitest/vitest.utils.config.ts";
|
||||
import { createWizardVitestConfig } from "./vitest/vitest.wizard.config.ts";
|
||||
|
||||
const EXTENSIONS_CHANNEL_GLOB = ["extensions", "channel", "**"].join("/");
|
||||
const PRIVATE_PLUGIN_SDK_SUBPATHS = [
|
||||
"qa-channel",
|
||||
"qa-channel-protocol",
|
||||
"qa-lab",
|
||||
"qa-runtime",
|
||||
] as const;
|
||||
|
||||
function bundledExcludePatternCouldMatchFile(pattern: string, file: string): boolean {
|
||||
if (pattern === file) {
|
||||
@@ -82,6 +88,28 @@ function bundledExcludePatternCouldMatchFile(pattern: string, file: string): boo
|
||||
}
|
||||
|
||||
describe("resolveVitestIsolation", () => {
|
||||
it("aliases private QA plugin SDK subpaths for source tests only", () => {
|
||||
expect(sharedVitestConfig.resolve.alias).toEqual(
|
||||
expect.arrayContaining(
|
||||
PRIVATE_PLUGIN_SDK_SUBPATHS.map((subpath) =>
|
||||
expect.objectContaining({
|
||||
find: `openclaw/plugin-sdk/${subpath}`,
|
||||
replacement: path.join(process.cwd(), "src", "plugin-sdk", `${subpath}.ts`),
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(sharedVitestConfig.resolve.alias).not.toEqual(
|
||||
expect.arrayContaining(
|
||||
PRIVATE_PLUGIN_SDK_SUBPATHS.map((subpath) =>
|
||||
expect.objectContaining({
|
||||
find: `@openclaw/plugin-sdk/${subpath}`,
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
it("defaults shared scoped configs to the non-isolated runner", () => {
|
||||
expect(resolveVitestIsolation({})).toBe(false);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { pluginSdkSubpaths } from "../../scripts/lib/plugin-sdk-entries.mjs";
|
||||
import privateLocalOnlyPluginSdkSubpaths from "../../scripts/lib/plugin-sdk-private-local-only-subpaths.json" with { type: "json" };
|
||||
import {
|
||||
detectVitestHostInfo as detectVitestHostInfoImpl,
|
||||
isCiLikeEnv,
|
||||
@@ -113,6 +114,9 @@ const workerConfig = resolveSharedVitestWorkerConfig({
|
||||
isWindows,
|
||||
localScheduling,
|
||||
});
|
||||
const sourcePluginSdkSubpaths = [
|
||||
...new Set([...pluginSdkSubpaths, ...privateLocalOnlyPluginSdkSubpaths]),
|
||||
].toSorted((left, right) => left.localeCompare(right));
|
||||
|
||||
if (!isCI && localScheduling.throttledBySystem && shouldPrintVitestThrottle(process.env)) {
|
||||
console.error(
|
||||
@@ -131,7 +135,7 @@ export const sharedVitestConfig = {
|
||||
find: "openclaw/extension-api",
|
||||
replacement: path.join(repoRoot, "src", "extensionAPI.ts"),
|
||||
},
|
||||
...pluginSdkSubpaths.map((subpath) => ({
|
||||
...sourcePluginSdkSubpaths.map((subpath) => ({
|
||||
find: `openclaw/plugin-sdk/${subpath}`,
|
||||
replacement: path.join(repoRoot, "src", "plugin-sdk", `${subpath}.ts`),
|
||||
})),
|
||||
|
||||
Reference in New Issue
Block a user