Repository navigation
Description
Split from #6448.
Problem: A prepared mutants tree with its own .git still has 57 failing tests. Most of them read the Git tracking of the checkout, and the new repository has no commit. The others read src as data, which is the generated code of mutmut. Why deferred: The repository-metadata change in #6448 fixes the guard stop and the missing .git. It does not change the tests that read checkout state or generated source. Those tests need their own fixes or a documented exclusion. Acceptance criteria: A run of the mutation selection in a prepared mutants tree reports no failure from the 57 tests named in #6448. Each test that needs checkout tracking gets a fixture or an exclusion with a reason. Each test that reads src as data gets a stable source path or an exclusion with a reason. The stats run of devops ci mutate reports no failure from these tests.
Proposed design
Problem statement
The prepared mutants tree has its own .git but no commit. Tests that read the checkout's Git tracking fail. Other tests read src as data and see mutmut's generated code. This issue makes the Git-tracking tests use the git_fake seam and a repository fixture with a recorded commit. It excludes the tests that need the checkout's full history or read src as data from the mutation selection with a reason. It proves the selection with a run of devops ci mutate in the prepared tree.
Acceptance criteria
Requirement: Git-tracking fixture
A test that reads Git tracking SHALL install the git_fake fixture and a repository fixture that answers git rev-parse HEAD with a recorded commit, and it MUST start no real git.
Scenario: Test that reads HEAD
- WHEN a test installs
git_fakeand the repository fixture and calls the product'sgit rev-parse HEAD - THEN the product returns the fixture's commit and
GitFakerecords no real git start.
Requirement: Full-history exclusion
A test that needs the checkout's full Git history MUST be excluded from the mutation selection with a comment that names the reason.
Scenario: One-commit prepared tree
- WHEN
uv run devops ci mutate src/devops_cli/ci/mutate.pyruns on a prepared mutants tree whose.githolds one commit - THEN the run reports no failure from
tests/invariants/test_source_tree.py::test_a_moved_roadmap_module_keeps_its_historyand lists the killed, survived, timeout and no-tests counts.
Requirement: Source-data exclusion
A test that reads src as data MUST be excluded from the mutation selection with a comment that names the reason, because the prepared tree holds only mutmut's generated code.
Scenario: Source-data test in the prepared tree
- WHEN
uv run devops ci mutate src/devops_cli/ci/mutate.pyruns on a prepared mutants tree - THEN the run reports no failure from a test that reads
srcas data and lists the killed, survived, timeout and no-tests counts.
Requirement: Prepared-tree stats run
A prepared mutants tree MUST report no failure from the 57 tests that #6448 names.
Scenario: Mutation selection stats run
- WHEN
uv run devops ci mutate src/devops_cli/ci/mutate.pyruns on a prepared mutants tree - THEN the stats run reports zero failures and the counts of killed, survived, timeout and no-tests mutants.
Existing Tool Considered
No alternatives check has run. pytest is the open, maintained test framework that the repository already uses; it covers fixtures and test selection but has no Git repository fixture that starts no real git. The repository already owns the git_fake seam (tests/support/fakes/git.py:121) and a git_repo support fixture (tests/support/roadmap_refine.py:159). The change adds a shared repository fixture with one recorded commit, about 30 lines of test code, and no production code. Written cost: under 1k tokens and under 1 hour to build, keep and fix. The seam, fake and transcripts already exist.
Key questions
- How should a test that reads Git tracking get a repository?: Install the
git_fakefixture and a shared repository fixture that creates.gitand answersgit rev-parse HEADfrom a recorded commit. The fixture starts no real git. A test that needs the checkout's full history is excluded from the mutation selection with a reason. (best practice) [sources: tests/support/fakes/git.py:121, tests/support/roadmap_refine.py:159, src/devops_cli/ci/mutate.py]- Chosen: Fake git seam with a recorded commit. It follows the existing
git_fakeseam and thegit_reposupport fixture, and the fixture and transcripts already exist. - Rejected: Real temporary git repository. A test of
srcstarts no program, and the existing seam already gives the answers. - Rejected: Mock each git command. It couples tests to command strings and bypasses the one process seam.
- Rejected: Exclude every Git-tracking test. It hides tests that the fake and one recorded commit can run.
- Chosen: Fake git seam with a recorded commit. It follows the existing
- How should a test that reads
srcas data resolve the source?: Exclude it from the mutation selection with a reason. The prepared tree'ssrcis mutmut's generated code and holds no unmutated copy. A test that reads a non-Python file undersrcstays in, because mutmut copies that file unchanged. (best practice) [sources: src/devops_cli/ci/mutate.py, tests/support/paths.py:21]- Chosen: Exclusion with a reason in the mutation selection. The tree holds only generated source, and the selection is the mechanism the mutation run reads.
- Rejected: Stable source-root fixture.
REPO_ROOTis the prepared tree root and itssrcis generated; a parent checkout is not guaranteed. - Rejected: Hard-coded
srcpath. It points at generated code. - Rejected: Keep every source-data test and make it pass. A test that asserts the source text cannot pass against mutated text.
- Which exclusion mechanism should the mutants tree use?: The existing
pytest_add_cli_args_test_selectionlist inpyproject.toml, with a comment on each entry that names the reason. Do not add a pytest marker or a second exclusion file: the mutation run passes no marker filter. (best practice) [sources: pyproject.toml:304, src/devops_cli/ci/mutate.py]- Chosen: Existing selection entries with a reason comment. It is the list mutmut reads, and the repository already documents each entry with a comment.
- Rejected: Pytest marker with a reason. The mutation run applies no marker filter, so the marked test still runs.
- Rejected: Custom exclusion file. It adds a second source of truth that drifts.
- Rejected: CI-only ignore list. It hides the reason from the test and the reviewer.
- Which test needs the checkout's full Git history?:
tests/invariants/test_source_tree.py::test_a_moved_roadmap_module_keeps_its_historyfails in a one-commit tree because its guard skips only whengit rev-parse --is-shallow-repositoryfails, and a one-commit repository answersfalse; the followinggit log --followthen asserts more than one commit and fails. The test is excluded from the mutation selection with a reason. [sources: tests/invariants/test_source_tree.py]
Fit
Fits in one pull request.
Suspected block
None.
Activity
devops-cli-service commentedon Nov 19, 2026
The 57 failing tests cause the devops ci mutate stats run to report failures, which is a CI failure.Both address devops ci mutate failures in the mutants tree; #6448 fixes the guard stop and missing .git, this item fixes 57 tests reading checkout state or src as data.[-]fix(ci): make the mutants tree pass tests that read Git tracking or src as data[/-][+]fix(ci): Fix mutants tree tests reading Git tracking or src[/+]devops-cli-service commentedon Nov 19, 2026
The job shortened the title of this item. The summary had 70 characters, and the limit is 60. The type and the scope stay.
fix(ci): make the mutants tree pass tests that read Git tracking or src as datafix(ci): Fix mutants tree tests reading Git tracking or srcdevops-cli-service commentedon Nov 19, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Nov 23, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
devops-cli-service commentedon Nov 23, 2026
Released in v0.203.6: https://github.com/dan-petty/devops-cli/releases/tag/v0.203.6