Skip to content

Commit 6331b79

Browse files
committed
test: verify balancing guards and document duration evidence
1 parent d2792c2 commit 6331b79

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎.github/CI.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,8 @@ The long-import and lease-expiration checks remain: they prove distinct survival
4343

4444
Local planner validation is `bun run test:scripts scripts/ci-changes.test.ts scripts/ci-gate.test.ts`. It executes real Turbo queries in small Git fixtures; no application build or database is required. Full builds, services, browser suites, and Electron checks run on hosted CI.
4545

46-
The separate `desktop-e2e` workflow retains its desktop-specific path filters. Its macOS shell smoke suite is partitioned by Playwright across three isolated runners; serial test-file groups stay intact. Packaging smoke and the weekly Electron canary remain separate. Each shard uploads its small JSON coverage/timing report.
46+
The separate `desktop-e2e` workflow retains its desktop-specific path filters. Its macOS shell smoke suite runs whole files across three isolated runners, with one worker per runner. `scripts/desktop-e2e.ts` asks Playwright to discover the complete suite, then assigns longer files first to the currently lightest shard using `apps/desktop/e2e-durations.json`. Exact escaped file filters preserve serial fixtures. Unmeasured files receive the median measured weight, deleted files cannot select tests, and invalid or empty selections fail. Normal local runs, packaging smoke and the weekly Electron canary keep their existing commands.
47+
48+
The initial weights are median test durations in seconds from runs [39734295953](https://github.com/simstudioai/sim/actions/runs/39734295953), [39833640524](https://github.com/simstudioai/sim/actions/runs/39833640524), and [39836596108](https://github.com/simstudioai/sim/actions/runs/39836596108). Refresh them from complete `desktop-smoke-reports-*` artifacts when the workload changes: sum `tests[].results[].duration` by `spec.file` in each run, take the median across runs, and divide milliseconds by 1,000. The weights steer scheduling only; Playwright discovery owns coverage. Before adopting new weights, compare repeated paired runs and the complete case/status multiset, including skipped cases and retries.
49+
50+
Each shard uploads its coverage/timing report, the complete discovery report, and its deterministic shard plan. `bun run test:scripts scripts/duration-shards.test.ts` checks partition coverage, unknown files, deterministic ordering, and balancing without launching Electron.

‎scripts/duration-shards.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('duration-balanced file partitions', () => {
1414
})
1515

1616
it('separates long files instead of packing them into the same shard', () => {
17-
const weights = { a: 100, b: 90, c: 80, d: 20, e: 10 }
17+
const weights = { a: 90, b: 20, c: 10, d: 100, e: 80 }
1818
const shards = partitionFiles(Object.keys(weights), weights, 3)
1919
const loads = shards.map((files) =>
2020
files.reduce((sum, file) => sum + weights[file as keyof typeof weights], 0)

0 commit comments

Comments
 (0)