mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-15 04:46:03 +00:00
* test: fix changed-run routing, dedupe gateway package lanes, repair force-rerun triggers - route extensions/active-memory changed runs to their dedicated lane; add a generic guard that every catch-all-excluded extension root resolves to a dedicated config so future split lanes cannot silently skip changed tests - exclude packages/gateway-client and packages/gateway-protocol from the unit lane; explicit targets now route to the gateway-client lane (was double-run) - generate forceRerunTriggers from the test/vitest directory and resolve all entries absolute: Vitest matches triggers against absolute changed-file paths, so the old hand-maintained relative list never matched at all - replace deprecated envFile:false with envDir:false (Vitest 4.1.9 warning) - give scripts/test-live.mjs stall detection teeth: kill the process group and exit non-zero when OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS elapses quietly - consolidate the live-docker shell target list into changed-lanes.mjs so the lane regex and check targets cannot drift; cover subagent-announce edits - delete orphans: vitest.extension-clickclack.config.ts, vitest.full-core-unit.config.ts, scripts/test-docker-all.sh, scripts/test-live-acp-spawn-defaults-docker.sh Closes #104231 * test: keep envDir literal so sharedVitestConfig satisfies Vite UserConfig Vite 8 types envDir as string | false; the bare object literal widened false to boolean and broke check:test-types at the defineConfig call sites.
44 lines
2.6 KiB
TypeScript
44 lines
2.6 KiB
TypeScript
// Vitest unit path tests validate unit test include and exclude paths.
|
|
import { bundledPluginFile } from "openclaw/plugin-sdk/test-fixtures";
|
|
import { describe, expect, it } from "vitest";
|
|
import { isUnitConfigTestFile } from "./vitest/vitest.unit-paths.mjs";
|
|
|
|
describe("isUnitConfigTestFile", () => {
|
|
it("accepts unit-config package tests", () => {
|
|
expect(isUnitConfigTestFile("packages/plugin-package-contract/src/index.test.ts")).toBe(true);
|
|
});
|
|
|
|
it("rejects files excluded from the unit config", () => {
|
|
expect(isUnitConfigTestFile("packages/gateway-client/src/index.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("packages/gateway-protocol/src/index.test.ts")).toBe(false);
|
|
expect(
|
|
isUnitConfigTestFile(
|
|
bundledPluginFile("imessage", "src/monitor.shutdown.unhandled-rejection.test.ts"),
|
|
),
|
|
).toBe(false);
|
|
expect(isUnitConfigTestFile("src/infra/matrix-plugin-helper.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("src/infra/boundary-path.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("src/infra/git-root.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("src/infra/home-dir.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("src/infra/openclaw-exec-env.test.ts")).toBe(false);
|
|
expect(
|
|
isUnitConfigTestFile(bundledPluginFile("matrix", "src/migration-snapshot.test.ts")),
|
|
).toBe(false);
|
|
expect(isUnitConfigTestFile("src/infra/openclaw-root.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("src/infra/package-json.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("src/infra/path-env.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("src/plugin-sdk/facade-runtime.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("src/plugins/loader.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("src/infra/stable-node-path.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("test/format-error.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("test/extension-test-boundary.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("src/agents/embedded-agent-runner.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("src/commands/onboard.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("ui/src/ui/views/channels.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("ui/src/ui/views/chat.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("ui/src/ui/views/other.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("src/infra/git-commit.live.test.ts")).toBe(false);
|
|
expect(isUnitConfigTestFile("src/infra/git-commit.e2e.test.ts")).toBe(false);
|
|
});
|
|
});
|