Skip to content

Commit 8ae9977

Browse files
committed
fix(test): make import timing scripts Windows-safe
1 parent 8209426 commit 8ae9977

4 files changed

Lines changed: 13 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Docs: https://docs.openclaw.ai
1111
- Scripts: use `git grep` to prefilter tracked conflict-marker scans so changed checks avoid reading every repository file on clean runs.
1212
- Installer: install Node.js through `apk` on Alpine Linux instead of falling through to the NodeSource package-manager path.
1313
- Installer: detect musl Linux shells such as Alpine as Linux instead of rejecting them before npm install.
14+
- Tests: run Vitest import timing entrypoints through a Node wrapper so native Windows package scripts can collect import diagnostics.
1415
- Control UI: split large build-time runtime dependencies into stable chunks so Linux/Docker install and package builds stay below the app chunk warning threshold.
1516
- Tests: run `test:max` and `test:changed:max` through a Node wrapper so high-worker Vitest entrypoints work on native Windows.
1617
- Tests: retry transient loopback HTTP resets in the kitchen-sink RPC walk so native Windows readiness probes do not fail after the gateway is already ready.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,8 +1739,8 @@
17391739
"test:perf:groups": "node scripts/test-group-report.mjs",
17401740
"test:perf:groups:compare": "node scripts/test-group-report.mjs --compare",
17411741
"test:perf:hotspots": "node scripts/test-hotspots.mjs",
1742-
"test:perf:imports": "OPENCLAW_VITEST_IMPORT_DURATIONS=1 OPENCLAW_VITEST_PRINT_IMPORT_BREAKDOWN=1 node scripts/test-projects.mjs",
1743-
"test:perf:imports:changed": "OPENCLAW_VITEST_IMPORT_DURATIONS=1 OPENCLAW_VITEST_PRINT_IMPORT_BREAKDOWN=1 node scripts/test-projects.mjs --changed origin/main",
1742+
"test:perf:imports": "node scripts/test-projects-imports.mjs",
1743+
"test:perf:imports:changed": "node scripts/test-projects-imports.mjs --changed origin/main",
17441744
"test:perf:profile:main": "node scripts/run-vitest-profile.mjs main",
17451745
"test:perf:profile:runner": "node scripts/run-vitest-profile.mjs runner",
17461746
"test:plugins:gateway-gauntlet": "node scripts/check-plugin-gateway-gauntlet.mjs",

scripts/test-projects-imports.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
process.env.OPENCLAW_VITEST_IMPORT_DURATIONS = "1";
2+
process.env.OPENCLAW_VITEST_PRINT_IMPORT_BREAKDOWN = "1";
3+
4+
await import("./test-projects.mjs");

src/infra/vitest-config.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,12 @@ describe("test scripts", () => {
234234
expect(pkg.scripts?.["test:changed:max"]).toBe(
235235
"node scripts/test-projects-max.mjs --changed origin/main",
236236
);
237+
expect(pkg.scripts?.["test:perf:imports"]).toBe(
238+
"node scripts/test-projects-imports.mjs",
239+
);
240+
expect(pkg.scripts?.["test:perf:imports:changed"]).toBe(
241+
"node scripts/test-projects-imports.mjs --changed origin/main",
242+
);
237243
expect(pkg.scripts?.["test:fast"]).toBe(
238244
"node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts",
239245
);

0 commit comments

Comments
 (0)