Skip to content

Commit 13190fa

Browse files
authored
ci: sync the dev group in the workflows that run ci_unit.sh (ADR-1122) (#910)
ci_unit.sh ends with the mutation gate and mutmut lives in the dev dependency group; uv-locked-install syncs with --no-default-groups, so memory-exact-review and supersession-delete-parity failed with "Failed to spawn: mutmut" before any mutant ran (#894). A test now requires --group dev in every workflow that runs the unit suite through uv-locked-install.
1 parent d325ebb commit 13190fa

4 files changed

Lines changed: 39 additions & 2 deletions

File tree

‎.github/workflows/memory-exact-review.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
uses: ./.github/actions/uv-locked-install
3232
with:
3333
environment: ${{ github.workspace }}/.venv
34-
set: --extra dev --extra sqlite --extra codebase --extra postgresql --group lint
34+
set: --extra dev --extra sqlite --extra codebase --extra postgresql --group lint --group dev
3535
- name: Check final Python sources
3636
run: |
3737
export PATH="$HOME/.local/bin:$PATH"

‎.github/workflows/supersession-delete-parity.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
uses: ./.github/actions/uv-locked-install
3131
with:
3232
environment: ${{ github.workspace }}/.venv
33-
set: --extra dev --extra sqlite --extra codebase --extra postgresql --group lint
33+
set: --extra dev --extra sqlite --extra codebase --extra postgresql --group lint --group dev
3434
- name: Check the proposed sources and decision mirror
3535
run: |
3636
export PATH="$HOME/.local/bin:$PATH"

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ adheres to [Semantic Versioning](https://semver.org/).
1717

1818
### Changed
1919

20+
- `memory-exact-review` and `supersession-delete-parity` sync the `dev` group, so the
21+
mutation gate their `ci_unit.sh` ends with finds `mutmut` (ADR-1122). Without it the
22+
step failed with "Failed to spawn: mutmut" before any mutant ran (#894).
2023
- mutmut forks each mutant from a fork server (`process_isolation = "forkserver"`,
2124
ADR-1122). Forked from the process that had run the suite, mutants hung in torch on
2225
the Linux runner and timed out: #878 was cancelled at the six-hour job limit.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""Every workflow that runs scripts/ci_unit.sh installs mutmut (ADR-1122).
2+
3+
ci_unit.sh ends with the mutation gate, and mutmut lives in the `dev` dependency
4+
group. `uv-locked-install` syncs with `--no-default-groups`, so a workflow that does
5+
not pass `--group dev` fails with "Failed to spawn: mutmut" before any mutant runs
6+
(#894, supersession-delete-parity).
7+
"""
8+
9+
from __future__ import annotations
10+
11+
import re
12+
from pathlib import Path
13+
14+
WORKFLOWS = Path(__file__).resolve().parents[2] / ".github" / "workflows"
15+
# source: .github/actions/uv-locked-install/action.yml, its `set` input.
16+
SET_LINE = re.compile(r"^\s*set:\s*(.+)$", re.MULTILINE)
17+
18+
19+
def _runs_the_unit_suite(text: str) -> bool:
20+
return "scripts/ci_unit.sh" in text and "uv-locked-install" in text
21+
22+
23+
def test_each_unit_suite_workflow_syncs_the_dev_group():
24+
checked = []
25+
for workflow in sorted(WORKFLOWS.glob("*.yml")):
26+
text = workflow.read_text(encoding="utf-8")
27+
if not _runs_the_unit_suite(text):
28+
continue
29+
sets = SET_LINE.findall(text)
30+
assert sets, f"{workflow.name}: no uv-locked-install `set:` line"
31+
for value in sets:
32+
assert "--group dev" in value.split("#")[0], f"{workflow.name}: {value}"
33+
checked.append(workflow.name)
34+
assert "supersession-delete-parity.yml" in checked

0 commit comments

Comments
 (0)