Skip to content

feat: Balance acceptance CI shards using recorded test timings#6878

Draft
danskmt wants to merge 1 commit into
mainfrom
feat/CLI-1482-balance-acceptance-test-shards
Draft

feat: Balance acceptance CI shards using recorded test timings#6878
danskmt wants to merge 1 commit into
mainfrom
feat/CLI-1482-balance-acceptance-test-shards

Conversation

@danskmt
Copy link
Copy Markdown
Contributor

@danskmt danskmt commented Jun 3, 2026

Pull Request Submission Checklist

  • Follows CONTRIBUTING guidelines
  • Commit messages are release-note ready, emphasizing what was changed, not how.
  • Includes detailed description of changes
  • Contains risk assessment (Low | Medium | High)
  • Highlights breaking API changes (if applicable)
  • Links to automated tests covering new functionality
  • Includes manual testing instructions (if necessary)
  • Updates relevant GitBook documentation (PR link: ___)
  • Includes product update to be announced in the next stable release notes

What does this PR do?

Replaces Jest’s default count/alphabetical --shard split with a timing-aware sequencer so parallel acceptance jobs finish closer together. Adds test-timings.json (per-file weights from CI) and wires it via --testSequencer on test:acceptance. Enables jest-junit addFileAttribute for future timing refreshes.

Where should the reviewer start?

  • test/jest/timingSequencer.js — LPT bin-packing in shard()
  • test/jest/test-timings.json — recorded acceptance runtimes (ms)
  • package.jsontest:acceptance sequencer flag and addFileAttribute

How should this be manually tested?

  1. Run npx jest --testPathPattern timingSequencer.spec.ts if the unit test is included in a follow-up.
  2. Trigger Windows acceptance CI (8 shards) and compare parallel run wall times vs main (expect smaller spread between fastest/slowest shard).

What's the product update that needs to be communicated to CLI users?

None. CI-only change; no CLI behavior change for end users.

Risk assessment (Low | Medium | High)?

Low

Any background context you want to provide?

Jest’s built-in sharding splits by file count, so one shard can pick up slow specs (e.g. snyk-code user journey ~7 min) while others finish much earlier. The custom sequencer assigns each file to the lightest shard by estimated runtime.

What are the relevant tickets?

CLI-1482

Screenshots (if appropriate)

N/A

@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented Jun 3, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@danskmt danskmt force-pushed the feat/CLI-1482-balance-acceptance-test-shards branch 4 times, most recently from a046794 to c4622de Compare June 4, 2026 12:03
@danskmt danskmt force-pushed the feat/CLI-1482-balance-acceptance-test-shards branch from c4622de to 9ee7c61 Compare June 4, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant