Skip to content

chore(ci): keep the per-test times and skip reasons of CI - #5006

Merged
dan-petty merged 2 commits into
mainfrom
chore/4673-ci-test-reports
Nov 12, 2026
Merged

dan-petty merged 2 commits into
mainfrom
chore/4673-ci-test-reports

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Each test shard of CI now keeps the time of each test and gives the reason of each skip. Before, a shard printed only its 10 slowest tests and wrote no JUnit XML report, so each CI saving outside those rows was an estimate. The split by measured time (#4250) needs these times.

Closes #4673

Change: openspec/changes/archive/2026-11-12-4673-keep-the-per-test-times-and/

Each test shard of CI now writes a JUnit XML report with the time of each
of its tests (.data/junit.xml) and gives the reason of each skip in its
log (-rfEs). The shard job uploads the report in its coverage artifact,
so the split by measured time (#4250) can read the times of a run.

The -r option of pytest replaces its default fE, so the row asks again
for the failed and error tests. An unsharded run writes no report.
@dan-petty dan-petty added type/chore Type chore: maintenance, such as a dependency update scope/ci GitHub Actions workflows, pre-commit hooks, CI gates, and runners labels Nov 12, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Fail-to-pass (uv run devops ci fail-to-pass --base origin/main, base 87ae9ee):

failed on base: tests.commands.test_ci_shard::test_a_shard_reports_each_test_id_and_the_reason_of_each_skip_and_failure (AssertionError: the shard row writes no JUnit XML report)
failed on base: tests.commands.test_ci_shard::test_each_shard_job_uploads_the_report_of_its_row_with_its_coverage_data (AssertionError: assert ['.data/.coverage'] == ['.data/.coverage', None])
2 failed on base (2 failed and 16 passed in tests/commands/test_ci_shard.py; 0 errored).

Both new tests pass on the head.

Local checks (scoped, as for a delivery agent):

  • uv run devops ci --check --only format,lint,typecheck,actionlint,zizmor,docs,openspec,constructs,swallowed-failures,test-tree,git: every row passes except git. That row fails on the unchanged origin/main too, because the local environment does not have the review extra (lizard), and the recorded transcripts expect lizard output. CI syncs --all-extras. Filed as fix(ci): the local git row fails without the review extra #4997.
  • uv run devops ci test src/devops_cli/commands/ci.py tests/invariants/test_workflow_contracts.py tests/commands/test_ci_shard.py: 782 passed.

@dan-petty

Copy link
Copy Markdown
Owner Author

Before and after (Actions API, job Tests & Coverage (shard <n> of 4))

Before: 10 main push runs (2026-11-12, 05:50Z to 07:56Z) After: PR run 43191263934
Shard jobs per run 4 4
Mean shard job time 240.6 s (range 123 s to 327 s, 40 jobs) 225.0 s (203 s to 267 s)
Mean Tests & Coverage Quality Gate step 205.7 s 193.0 s
Mean upload step 1.52 s 1.00 s
Artifact size, shards 1 / 2 / 3 / 4 2,334,642 / 2,249,250 / 2,176,567 / 2,292,341 B 2,420,029 / 2,366,212 / 2,315,517 / 2,390,386 B

The report adds about 85 KB to 139 KB to each compressed artifact. The change in time is inside the spread of the main runs, so it has no cost that this sample can measure.

Acceptance on the PR run

  • Each shard log has generated xml file: /home/runner/work/devops-cli/devops-cli/.data/junit.xml and With the provided path, there will be 2 files uploaded.
  • Each shard log gives a reason for each skip. The 10 skips of the run (2 + 6 + 1 + 1, the count that chore(ci): keep the per-test times and skip reasons of CI #4673 names) each have a line such as SKIPPED [1] tests/commands/test_devcontainer.py:2341: zsh is not installed and SKIPPED [3] tests/roadmap/stage/test_roadmap_stage_plan.py:1841: openspec is not installed.
  • The test counts of the shards are 5,476, 5,849, 6,231 and 5,919 passed. pytest writes each collected test to the report. The test test_a_shard_reports_each_test_id_and_the_reason_of_each_skip_and_failure proves this with the options of the shard row.
  • I could not open the zip to count the test cases: devops gh api writes the binary response as text and breaks it (filed as fix(gh): devops gh api breaks a binary response #5015).

Owner steps: none. The change sets no repository setting and no required check name.

@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 09:54
@dan-petty
dan-petty merged commit c347138 into main Nov 12, 2026
24 checks passed
@dan-petty
dan-petty deleted the chore/4673-ci-test-reports branch November 12, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/ci GitHub Actions workflows, pre-commit hooks, CI gates, and runners type/chore Type chore: maintenance, such as a dependency update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(ci): keep the per-test times and skip reasons of CI

1 participant