Skip to content

fix(ci): count a changed test that errors on base as proof - #6379

Merged
dan-petty merged 8 commits into
mainfrom
fix/6372-count-errored-changed-tests
Nov 19, 2026
Merged

dan-petty merged 8 commits into
mainfrom
fix/6372-count-errored-changed-tests

Conversation

@dan-petty

@dan-petty dan-petty commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

devops ci fail-to-pass counted only a changed test that fails in the call phase on base. A test that imports the code that a fix adds errors on base at collection or setup, so 22 of 38 failed Fail-to-Pass runs failed for this reason only. The replay puts the tests of the head on the base tree, so only src/ differs; SWE-bench counts fail or error as FAIL_TO_PASS too.

Now a changed test that errors on base at collection or setup proves the fix. An error at teardown comes after the call phase ran, so it does not. A collection error names the whole file, which counts as changed when its syntax tree differs from the merge base or the file is new (#3124). An error of an unchanged test refuses the replay as its failure does. A replay that could not run, the host path guard and the gate path do not change. The report names the changed tests that prove the fix. Related: #5585.

Closes #6372

Change: openspec/changes/archive/2026-11-19-6372-count-errored-changed-tests/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/ci GitHub Actions workflows, pre-commit hooks, CI gates, and runners labels Nov 19, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test record

Head: c83dfd4

  • Test first (commit 8856b57 before the fix): uv run devops ci test tests/ci/test_fail_to_pass.py gave 15 failed, 66 passed. The new tests failed for the expected causes: exit 1 for a changed file that fails to collect on base, the old "fails in the call phase" messages and the old dry-run conditions. tests/ci/test_changed_tests.py did not collect: ImportError: cannot import name 'is_file_changed'.
  • After the fix and the rebase onto origin/main: uv run devops ci test tests/ci/test_fail_to_pass.py tests/ci/test_changed_tests.py tests/commands/test_ci_shard.py tests/ci/test_ci_durations.py gave 133 passed.
  • uv run mypy src/devops_cli/ci/fail_to_pass.py src/devops_cli/ci/changed_tests.py src/devops_cli/lang/en/messages.py: no issues in 3 source files.
  • uv run devops ci --check --only lint,format,docs,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures: all rows pass.

Fail-to-pass

uv run devops ci fail-to-pass --base origin/main on the final code (before the archive commit and the rebase; the rebase changed no line of this change) exited 0. The replay is itself an example of the new rule: tests/ci/test_changed_tests.py imports is_file_changed, which the base does not have, so real pytest reported its collection error as classname="", name="tests.ci.test_changed_tests", and the check counts it as proof.

  errored on base: tests.ci.test_changed_tests (collection failure)
17 failed on base (17 failed and 64 passed in tests/ci/test_changed_tests.py, tests/ci/test_fail_to_pass.py; 1 errored).
These changed tests fail or error on base and prove the fix: tests.ci.test_changed_tests, tests.ci.test_fail_to_pass::test_fail_to_pass_dry_run_of_a_head_lists_the_fallback_diff, tests.ci.test_fail_to_pass::test_a_file_that_gains_only_a_comment_and_fails_to_collect_on_base_refuses_the_replay, tests.ci.test_fail_to_pass::test_fail_to_pass_dry_run_lists_the_replay_and_starts_nothing[True], tests.ci.test_fail_to_pass::test_fail_to_pass_runs_the_processes_of_its_plan[gate-check], tests.ci.test_fail_to_pass::test_a_test_that_the_fix_leaves_alone_and_that_fails_on_base_refuses_the_replay, tests.ci.test_fail_to_pass::test_a_replay_that_collects_and_runs_reports_its_outcomes[failing], tests.ci.test_fail_to_pass::test_a_replay_that_collects_and_runs_reports_its_outcomes[passing], tests.ci.test_fail_to_pass::test_a_replay_that_collects_no_tests_is_an_empty_replay, tests.ci.test_fail_to_pass::test_a_replay_whose_only_changed_test_file_fails_to_collect_on_base_exits_0, tests.ci.test_fail_to_pass::test_a_replay_that_collects_and_runs_reports_its_outcomes[collection-error], tests.ci.test_fail_to_pass::test_a_changed_test_file_that_fails_to_collect_on_base_proves_the_fix, tests.ci.test_fail_to_pass::test_a_repair_alone_does_not_satisfy_the_replay, tests.ci.test_fail_to_pass::test_fail_to_pass_runs_the_processes_of_its_plan[test-file], tests.ci.test_fail_to_pass::test_an_unchanged_test_that_errors_on_base_refuses_the_replay, tests.ci.test_fail_to_pass::test_fail_to_pass_dry_run_lists_the_replay_and_starts_nothing[False], tests.ci.test_fail_to_pass::test_fail_to_pass_dry_run_lists_the_head_replay, tests.ci.test_fail_to_pass::test_a_changed_test_that_errors_on_setup_proves_the_fix.

No live step is necessary. .github/workflows/fail-to-pass.yml does not change: it runs the command, and the command holds the rule.

@dan-petty
dan-petty force-pushed the fix/6372-count-errored-changed-tests branch from c83dfd4 to 793ea02 Compare November 19, 2026 07:00
@dan-petty

Copy link
Copy Markdown
Owner Author

Test record (after review)

Head: 793ea02

The review found that a changed test whose call phase passes on base and whose fixture errors at teardown proved the fix. That is correct: pytest 9.2.0 writes failed on teardown with ... as an <error> of the testcase, and the parser read it as errored. The fix: TestCaseOutcome.proves_fix takes an error only when its JUnit message starts with pytest's collection failure or failed on setup with (CONST_FAIL_TO_PASS_PROOF_ERROR_MESSAGES). An error of an unchanged test at any phase still refuses the replay.

  • Test first (commit 2bacaeb before the fix): uv run devops ci test tests/ci/test_fail_to_pass.py -k errors_on_teardown gave 1 failed: assert (True, 'These...:test_fixed.') == (False, 'A fi...:test_kept).').
  • Probe with real pytest 9.2.0 JUnit output and the fixed code: teardown error proves_fix=False, report not satisfied; setup error and collection error proves_fix=True, report satisfied.
  • uv run devops ci test tests/ci/test_fail_to_pass.py tests/ci/test_changed_tests.py tests/commands/test_ci_shard.py tests/ci/test_ci_durations.py tests/lang/test_language_catalogs.py: 142 passed.
  • uv run mypy src/devops_cli/ci/fail_to_pass.py src/devops_cli/ci/changed_tests.py src/devops_cli/config/constants.py src/devops_cli/lang/en/messages.py: no issues in 4 source files.
  • uv run devops ci --check --only lint,format,docs,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures: all rows pass.
  • The rebase onto origin/main changed no file of this change.

Fail-to-pass

uv run devops ci fail-to-pass --base origin/main on the final code, before the archive commit, exited 0. The proof line is long, so the block shows its start.

  errored on base: tests.ci.test_changed_tests (collection failure)
18 failed on base (18 failed and 64 passed in tests/ci/test_changed_tests.py, tests/ci/test_fail_to_pass.py; 1 errored).
These changed tests fail or error on base and prove the fix: tests.ci.test_changed_tests, tests.ci.test_fail_to_pass::test_a_file_that_gains_only_a_comment_and_fails_to_collect_on_base_refuses_the_replay, tests.ci.test_fail_to_pass::test_a_replay_that_collects_and_runs_reports_its_outcomes[passing], tests.ci.test_fail_to_pass::test_a_repair_alone_does_not_satisfy_the_replay, tests.ci.test_fail_to_ ...

No live step is necessary. .github/workflows/fail-to-pass.yml does not change.

@dan-petty
dan-petty marked this pull request as ready for review November 19, 2026 11:17
@dan-petty
dan-petty merged commit 6881b4c into main Nov 19, 2026
34 checks passed
@dan-petty
dan-petty deleted the fix/6372-count-errored-changed-tests branch November 19, 2026 11:17
dan-petty-release Bot added a commit that referenced this pull request Nov 19, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.179.5](v0.179.4...v0.179.5)
(2026-11-19)


### Bug Fixes

* **ai:** bound the number of prewarm model label values
([#6391](#6391))
([e3fa4f1](e3fa4f1))
* **ci:** count a changed test that errors on base as proof
([#6379](#6379))
([6881b4c](6881b4c))
* **deps:** update Helm release argo-cd to v10.18.2
([#6398](#6398))
([2604ace](2604ace))
* **infra:** Fix the offline separator of a comma limit
([#6387](#6387))
([98493e4](98493e4))
* **roadmap:** Name the cause of a stopped verification run
([#6333](#6333))
([bbf308d](bbf308d))
* **roadmap:** Stage a long plan body and a null optional text
([#6351](#6351))
([053aabc](053aabc))
* **telemetry:** Keep the age metrics' reads across pods
([#6326](#6326))
([ad0ee60](ad0ee60))


### Code Refactoring

* **ai:** rank the benchmark with numpy and pytrec-eval
([#6388](#6388))
([051217e](051217e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
dan-petty added a commit that referenced this pull request Nov 25, 2026
Finish the fail-to-pass error rule left open by #6379 (#6400).

- Update `CONTRIBUTING.md` ("Fail-to-Pass Evidence") so the documented
repair rule matches the fail-or-error code and covers file-level
collection errors whose head cases all pass.
- Update `_repaired_and_refused` in `src/devops_cli/ci/fail_to_pass.py`
to accept a file-level collection error on the plain merge base as
repaired when the head report holds at least one case for that module
and every head case passes, while still refusing missing or non-passing
head cases.
- Add `TestCaseOutcome.error_phase` and a `@pytest.mark.live("python")`
real-pytest test in `tests/ci/test_fail_to_pass.py` verifying
collection, setup, and teardown phase parsing directly against pytest's
JUnit output.

Closes #6400
Change:
`openspec/changes/archive/2026-11-25-6400-fail-to-pass-error-rule/`
dan-petty-release Bot added a commit that referenced this pull request Nov 25, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.219.0](v0.218.3...v0.219.0)
(2026-11-25)


### Features

* **cli:** add devops store commands
([#7143](#7143))
([468215c](468215c)),
closes [#4761](#4761)
* **k8s:** cap Valkey maxmemory at three quarters of limit
([#7161](#7161))
([450feb8](450feb8))
* **k8s:** generate service catalog from rendered Applications
([#7185](#7185))
([fcaf8d9](fcaf8d9)),
closes [#5535](#5535)
* **k8s:** record live devops ConfigMap changes
([#7179](#7179))
([050f73e](050f73e))
* **roadmap:** add readiness report to project review
([#7147](#7147))
([f146226](f146226))
* **roadmap:** give each stage Job its own metric instance id
([#6364](#6364))
([#7167](#7167))
([d921852](d921852))
* **roadmap:** scope App token permissions by job phase
([#7171](#7171))
([d431076](d431076))
* **roadmap:** stage prepare snapshots GitHub reads
([#7142](#7142))
([e2a0de3](e2a0de3))
* **terraform:** guard tf/github stacks against agent writes
([#7172](#7172))
([f21fcee](f21fcee))


### Bug Fixes

* **ai:** capture served deployment model on gateway calls
([#6002](#6002))
([#7169](#7169))
([9b73aa1](9b73aa1))
* **ai:** halve batch only on input, timeout, or short reply
([#6722](#6722))
([#7152](#7152))
([da59cfc](da59cfc))
* **ai:** replace unserved devops-embedding with qwen3-embedding
([#7170](#7170))
([766f19b](766f19b))
* **ci:** finish the fail-to-pass error rule of
[#6379](#6379)
([#6400](#6400))
([#7180](#7180))
([357f60d](357f60d))
* **deps:** update golangci-lint flags and config to v2
([#7176](#7176))
([c681e72](c681e72)),
closes [#5072](#5072)
* **devcontainer:** remove unused init options
([#7153](#7153))
([369d878](369d878))
* **k8s:** report the workloads that no Argo CD Application manages
([#7186](#7186))
([2aba8fb](2aba8fb))
* **pr:** read head branch labels.yml when --repo is set
([#7134](#7134))
([a89fed8](a89fed8)),
closes [#6469](#6469)
* **review:** use ULID names for review sessions
([#6221](#6221))
([#7188](#7188))
([feddcc2](feddcc2))
* **roadmap:** avoid false rejected verdicts on tools in use
([#6441](#6441))
([#7146](#7146))
([851a87c](851a87c))
* **roadmap:** check failed head backoff before REST check-runs
([#6004](#6004))
([#7155](#7155))
([017ef6d](017ef6d))
* **roadmap:** convert post-merge refine questions to criteria
([#7145](#7145))
([f1125c1](f1125c1))
* **roadmap:** drop stale cycle waits and check proposal
([#7137](#7137))
([6ec0372](6ec0372)),
closes [#6515](#6515)
* **roadmap:** end blocked refine waits on older rules
([#7132](#7132))
([9c62b71](9c62b71))
* **roadmap:** exclude trackers from refine inbox waits
([#7135](#7135))
([376513b](376513b))
* **roadmap:** keep stage pending mark on kept orphan branch
([#7175](#7175))
([0b9c698](0b9c698))
* **roadmap:** keep the off-path return in reply_fixable shadow mode
([#7139](#7139))
([2ec4924](2ec4924))
* **roadmap:** log tool, mode, and parts on refine stop
([#5991](#5991))
([#7160](#7160))
([d4a6932](d4a6932))
* **roadmap:** mark a used language's stdlib as in-use
([#6347](#6347))
([#7182](#7182))
([55dba0a](55dba0a))
* **roadmap:** omit repeated text in intake and retitle comments
([#6198](#6198))
([#7158](#7158))
([f2ee61b](f2ee61b))
* **roadmap:** read shared frame replies for covers questions
([#7129](#7129))
([49d4062](49d4062))
* **roadmap:** record read_at on written refine rounds
([#7144](#7144))
([44fb86a](44fb86a)),
closes [#6371](#6371)
* **roadmap:** refine looks again at an edited Ready item
([#6452](#6452))
([#7178](#7178))
([3bb8a48](3bb8a48))
* **roadmap:** refuse unlisted non-namespaced labels in row guard
([#7128](#7128))
([a840fdd](a840fdd))
* **roadmap:** score renamed bot PR by first verdict kind
([#5984](#5984))
([#7162](#7162))
([879e71f](879e71f))
* **roadmap:** show stage eval case outcomes and reasons
([#6324](#6324))
([#7154](#7154))
([00885b6](00885b6))
* **roadmap:** use _read_at for Ready comment re-selection
([#7190](#7190))
([#7192](#7192))
([43d458c](43d458c))
* **tests:** declare lizard in dev group and guard test setup
([#7173](#7173))
([f82acc1](f82acc1)),
closes [#6380](#6380)
* **tests:** freeze wall clock in stage agent snapshot test
([#7181](#7181))
([#7183](#7183))
([06f35ef](06f35ef))


### Performance Improvements

* **k8s:** seed the uv cache of a runner pod from the image
([#7156](#7156))
([ac5d7b0](ac5d7b0)),
closes [#4814](#4814)


### Code Refactoring

* **roadmap:** use spec scope for plan titles and commits
([#7174](#7174))
([a81b050](a81b050))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
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/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ci): count a test that errors on base as fail-to-pass proof

1 participant