Skip to content

Re-tune .test_durations from CI, and add a script that downloads it - #844

Open
perlinm wants to merge 2 commits into
mainfrom
ci/retune-test-durations
Open

perlinm wants to merge 2 commits into
mainfrom
ci/retune-test-durations

Conversation

@perlinm

@perlinm perlinm commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

CI balances the per-module coverage check's shards by the per-test-file durations in .test_durations. These were measured before the coverage check began running qLDPC's compiled functions as plain Python (#839), so the shards have become uneven. The "Store test durations" workflow (#843) measures them on a CI runner, but downloading its artifact needs a GitHub token. So every re-tune would mean working out the download again by hand.

Changes

  • .test_durations is replaced by the file from a run of the "Store test durations" workflow on main.
  • checks/_fetch_test_durations.py downloads that file from the latest successful run on main and writes it into the checkout that the script runs from. It reports any test file that the new file lacks, and any name in it that is not a test file. It uses GITHUB_TOKEN or GH_TOKEN if set, or else the credential that git has stored for github.com. It sends the token only to GitHub's API, not to the storage host that the download redirects to.
  • The contributing guide's CI paragraph and the workflow's header point to the script.

Testing

The script wrote a file identical to the committed one, and found every test file in it. The run that measured the durations skipped only one test, so no file's duration is understated by skipped tests.

perlinm and others added 2 commits November 12, 2026 10:07
The durations come from the "Store test durations" workflow, run on main, and balance the coverage
shards now that the coverage check runs qLDPC's compiled functions as plain Python.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…st durations" run

It writes the file into the checkout that it runs from, and reports test files that the new file
lacks or names that are not test files.  It uses GITHUB_TOKEN or GH_TOKEN, or else git's stored
credential for github.com, and sends the token only to GitHub's API.  The contributing guide and
the workflow point to it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@perlinm perlinm changed the title Re-tune .test_durations from a CI run of the whole coverage check Re-tune .test_durations from CI, and add a script that downloads it Nov 12, 2026
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