mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-26 10:13:27 +08:00
test: align CLI launcher fixtures and CI selection
Reuse the shared launcher command boundary from main, include CLI invocation changes in build and launcher selection, and drain the update fixture before its independent Doctor capture.
This commit is contained in:
1 parent
8645c9d3e0
commit
4aa64f9ddc
6 files changed
+10
-2
No files matched your search
@@ -225,7 +225,7 @@ const BOUNDARY_NODE_TEST_CONFIG = "test/vitest/vitest.boundary.config.ts";
|
||||
// Built-artifact test inputs below also require this lane even though they do
|
||||
// not change the bytes under test.
|
||||
const BUILD_INPUT_RE =
|
||||
/^(?:src|extensions|packages)\/|^(?:openclaw\.mjs|package\.json|pnpm-lock\.yaml|pnpm-workspace\.yaml)$|^tsconfig[^/]*\.json$|^tsdown(?:\.[^/]+)?\.config\.ts$|^scripts\/(?:build-[^/]+|runtime-postbuild\.mts|tsdown-build\.mts|write-(?:plugin-sdk|unified)-entry-dts\.ts)$|^scripts\/lib\/(?:copy-assets\.ts|plugin-sdk-entries\.mts|(?:build-artifact-cache|compiler-input-snapshot|declaration-stage|tsdown-[^/]+)\.mts)$/u;
|
||||
/^(?:src|extensions|packages)\/|^(?:openclaw\.mjs|cli-invocation\.mjs|package\.json|pnpm-lock\.yaml|pnpm-workspace\.yaml)$|^tsconfig[^/]*\.json$|^tsdown(?:\.[^/]+)?\.config\.ts$|^scripts\/(?:build-[^/]+|runtime-postbuild\.mts|tsdown-build\.mts|write-(?:plugin-sdk|unified)-entry-dts\.ts)$|^scripts\/lib\/(?:copy-assets\.ts|plugin-sdk-entries\.mts|(?:build-artifact-cache|compiler-input-snapshot|declaration-stage|tsdown-[^/]+)\.mts)$/u;
|
||||
const BUILT_ARTIFACT_TEST_INPUTS = new Set([
|
||||
"extensions/browser/chrome-extension/relay-key.test-support.ts",
|
||||
"extensions/browser/src/browser/extension-install.native-host.e2e.test.ts",
|
||||
|
||||
@@ -37,6 +37,7 @@ export function resolveCiCheckFamilyScope(changedPaths: readonly string[]): CiCh
|
||||
const bunLauncher = changedPaths.some(
|
||||
(file) =>
|
||||
file === "openclaw.mjs" ||
|
||||
file === "cli-invocation.mjs" ||
|
||||
file === "test/openclaw-launcher.e2e.test.ts" ||
|
||||
/^src\/plugins\/plugin-module-generation(?:\.|-)/u.test(file) ||
|
||||
file.startsWith("src/infra/sqlite-existing-database."),
|
||||
|
||||
@@ -867,6 +867,8 @@ it("Doctor sees an already-current update's completed history after original-sta
|
||||
expect.objectContaining({ step: "original-state-capture", status: "completed" }),
|
||||
]),
|
||||
});
|
||||
// Drain the fixture's writers so the independent Doctor capture has a quiescent source.
|
||||
await closeOpenClawStateDatabaseAsync();
|
||||
const readHistory = vi.spyOn(history, "listUpdateRunsAsync");
|
||||
vi.spyOn(packageRoot, "resolveOpenClawPackageRoot").mockResolvedValue(fixture.root);
|
||||
// Keep Doctor admission, original capture, config preflight, and history real;
|
||||
|
||||
@@ -24,7 +24,7 @@ beforeAll(async () => {
|
||||
target: "node24",
|
||||
plugins: [createLauncherCommandBoundaryPlugin()],
|
||||
banner: {
|
||||
js: 'import { createRequire as fixtureCreateRequire } from "node:module"; const require = fixtureCreateRequire(import.meta.url);',
|
||||
js: 'import { createRequire } from "node:module"; const require = createRequire(import.meta.url);',
|
||||
},
|
||||
write: false,
|
||||
});
|
||||
|
||||
@@ -98,6 +98,7 @@ describe("CI changed Node test plan", () => {
|
||||
// change dist bytes; repo scripts, workflows, and qa scenarios cannot.
|
||||
expect(hasBuildArtifactAffectingChange(["scripts/build-all.mts"])).toBe(true);
|
||||
for (const changedPath of [
|
||||
"cli-invocation.mjs",
|
||||
"tsdown.config.ts",
|
||||
"tsdown.ai.config.ts",
|
||||
"scripts/tsdown-build.mts",
|
||||
|
||||
@@ -127,6 +127,10 @@ const cases: ScopeCase[] = [
|
||||
expected: { madgeImportCycles: true, kyselyGuardrails: false },
|
||||
},
|
||||
{ paths: ["test/openclaw-launcher.e2e.test.ts"], expected: { fastTasks: ["bun-launcher"] } },
|
||||
{
|
||||
paths: ["cli-invocation.mjs"],
|
||||
expected: { fastTasks: expect.arrayContaining(["bun-launcher"]) },
|
||||
},
|
||||
{
|
||||
paths: ["src/infra/sqlite-existing-database.ts"],
|
||||
expected: { fastTasks: ["bun-launcher"] },
|
||||
|
||||
Reference in new issue
Block a user