mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-25 18:31:13 +00:00
improve(ci): warm import-heavy Vitest graphs (#110557)
* perf(ci): broaden Vitest transform cache seed * fix(ci): declare cache slot clone helper
This commit is contained in:
committed by
GitHub
parent
608bb3b8ab
commit
2ba272bda6
@@ -14,6 +14,7 @@ import path from "node:path";
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import {
|
||||
buildChildEnv,
|
||||
clonePersistentCacheSlots,
|
||||
pruneFsModuleCache,
|
||||
resolveShardChildCommand,
|
||||
resolveShardPlans,
|
||||
@@ -218,6 +219,24 @@ describe("scripts/ci-run-node-test-shard.mjs", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("clones a restored persistent seed into every concurrent cache slot", () => {
|
||||
const persistentRoot = makeScratchDir();
|
||||
const seed = path.join(persistentRoot, "vitest-cache-0");
|
||||
mkdirSync(seed, { recursive: true });
|
||||
writeFileSync(path.join(seed, "transform"), "cached", "utf8");
|
||||
const staleSlot = path.join(persistentRoot, "vitest-cache-1");
|
||||
mkdirSync(staleSlot, { recursive: true });
|
||||
writeFileSync(path.join(staleSlot, "stale"), "old", "utf8");
|
||||
|
||||
expect(clonePersistentCacheSlots(persistentRoot, 3)).toBe(2);
|
||||
for (const cacheSlot of [1, 2]) {
|
||||
expect(
|
||||
readFileSync(path.join(persistentRoot, `vitest-cache-${cacheSlot}`, "transform"), "utf8"),
|
||||
).toBe("cached");
|
||||
}
|
||||
expect(existsSync(path.join(staleSlot, "stale"))).toBe(false);
|
||||
});
|
||||
|
||||
it("prunes oldest transform entries while preserving Vitest metadata", () => {
|
||||
const persistentRoot = makeScratchDir();
|
||||
const slot = path.join(persistentRoot, "vitest-cache-0");
|
||||
|
||||
@@ -2527,6 +2527,9 @@ describe("ci workflow guards", () => {
|
||||
expect(checkoutStep.with).toBeUndefined();
|
||||
expect(warmerSource).toContain('cron: "17 8 * * *"');
|
||||
expect(warmerSource).toContain('candidate.shardName.startsWith("core-unit-fast")');
|
||||
expect(warmerSource).toContain('"agentic-agents-embedded"');
|
||||
expect(warmerSource).toContain('"agentic-gateway-methods"');
|
||||
expect(warmerSource).toContain('"auto-reply-reply-commands-3"');
|
||||
expect(warmerSetup.with).toMatchObject({
|
||||
"node-compile-cache-scope": "test",
|
||||
"save-actions-cache": "true",
|
||||
|
||||
Reference in New Issue
Block a user