mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-24 11:25:50 -06:00
improve: split hosted Windows CI into three lanes (#123577)
* ci: split Windows tests into three lanes * test: cover three-way Windows CI partition
This commit is contained in:
committed by
GitHub
parent
37c9a30f58
commit
3a49aa1ac6
@@ -26,11 +26,12 @@ function readPackageJson(): RootPackageJson {
|
||||
return JSON.parse(fs.readFileSync("package.json", "utf8")) as RootPackageJson;
|
||||
}
|
||||
|
||||
function readWindowsCiPartScripts(): [string, string] {
|
||||
function readWindowsCiPartScripts(): [string, string, string] {
|
||||
const scripts = readPackageJson().scripts;
|
||||
return [
|
||||
expectDefined(scripts["test:windows:ci:1"], "Windows CI part 1 script"),
|
||||
expectDefined(scripts["test:windows:ci:2"], "Windows CI part 2 script"),
|
||||
expectDefined(scripts["test:windows:ci:3"], "Windows CI part 3 script"),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -203,16 +204,24 @@ describe("package scripts", () => {
|
||||
expect(scripts["android:test"]).toContain(":wear:testDebugUnitTest");
|
||||
});
|
||||
|
||||
it("partitions Windows CI coverage into two disjoint explicit test lists", () => {
|
||||
it("partitions Windows CI coverage into three disjoint explicit test lists", () => {
|
||||
const scripts = readPackageJson().scripts;
|
||||
const partScripts = readWindowsCiPartScripts();
|
||||
const partTargets = partScripts.map(readWindowsCiTargets);
|
||||
const allTargets = partTargets.flat();
|
||||
|
||||
expect(scripts["test:windows:ci"]).toBe("pnpm test:windows:ci:1 && pnpm test:windows:ci:2");
|
||||
expect(partTargets.map((targets) => targets.length)).toEqual([24, 41]);
|
||||
expect(scripts["test:windows:ci"]).toBe(
|
||||
"pnpm test:windows:ci:1 && pnpm test:windows:ci:2 && pnpm test:windows:ci:3",
|
||||
);
|
||||
expect(partTargets.map((targets) => targets.length)).toEqual([19, 15, 31]);
|
||||
expect(new Set(allTargets).size).toBe(65);
|
||||
expect(partTargets[0]?.filter((target) => partTargets[1]?.includes(target))).toEqual([]);
|
||||
for (const [partIndex, targets] of partTargets.entries()) {
|
||||
const laterTargets = new Set(partTargets.slice(partIndex + 1).flat());
|
||||
expect(
|
||||
targets.filter((target) => laterTargets.has(target)),
|
||||
`Windows CI part ${partIndex + 1} overlaps a later part`,
|
||||
).toEqual([]);
|
||||
}
|
||||
});
|
||||
|
||||
it("runs node workspace transfer coverage in Windows CI", () => {
|
||||
|
||||
@@ -2695,7 +2695,7 @@ NODE
|
||||
expect(workflow.jobs["checks-fast-channel-contracts-shard"].strategy["max-parallel"]).toBe(12);
|
||||
expect(workflow.jobs["check-shard"].strategy["max-parallel"]).toBe(12);
|
||||
expect(workflow.jobs["check-additional-shard"].strategy["max-parallel"]).toBe(12);
|
||||
expect(workflow.jobs["checks-windows"].strategy["max-parallel"]).toBe(2);
|
||||
expect(workflow.jobs["checks-windows"].strategy["max-parallel"]).toBe(3);
|
||||
expect(workflow.jobs.android.strategy["max-parallel"]).toBe(2);
|
||||
});
|
||||
|
||||
@@ -2741,6 +2741,7 @@ NODE
|
||||
const expectedHostedWindowsMatrix = [
|
||||
{ check_name: "checks-windows-node-test-1", runtime: "node", task: "test-1" },
|
||||
{ check_name: "checks-windows-node-test-2", runtime: "node", task: "test-2" },
|
||||
{ check_name: "checks-windows-node-test-3", runtime: "node", task: "test-3" },
|
||||
];
|
||||
expect(
|
||||
JSON.parse(expectDefined(github.outputs.checks_windows_matrix, "GitHub Windows matrix"))
|
||||
@@ -2752,6 +2753,7 @@ NODE
|
||||
).toEqual(expectedHostedWindowsMatrix);
|
||||
expect(runStep.run).toContain("test-1)\n pnpm test:windows:ci:1");
|
||||
expect(runStep.run).toContain("test-2)\n pnpm test:windows:ci:2");
|
||||
expect(runStep.run).toContain("test-3)\n pnpm test:windows:ci:3");
|
||||
});
|
||||
|
||||
it("installs the Android SDK platform used by Gradle", () => {
|
||||
|
||||
Reference in New Issue
Block a user