diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f172d88..425b15e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -421,7 +421,9 @@ jobs: run: | /usr/bin/time -f 'elapsed_seconds=%e\nmax_rss_kb=%M' \ -o quality-evidence/mutation-time.txt \ - "$QUALITY_ENV/bin/mutmut" run --max-children 4 + "$QUALITY_ENV/bin/python" -c \ + 'import torch, yaml; from mutmut.__main__ import cli; cli()' \ + run --max-children 4 "$QUALITY_ENV/bin/mutmut" results > quality-evidence/mutation-survivors.txt "$QUALITY_ENV/bin/mutmut" export-cicd-stats cp mutants/mutmut-cicd-stats.json quality-evidence/mutation-stats.json diff --git a/pyproject.toml b/pyproject.toml index cb4d057..48cd2ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -127,9 +127,7 @@ pytest_add_cli_args_test_selection = [ "tests/test_coverage_thresholds.py", "tests/test_numerical_contracts.py", ] -# Mutating the complete bounded target set is both stronger and avoids mutmut's -# in-process native-extension unload/reload crash during covered-line discovery. -mutate_only_covered_lines = false +mutate_only_covered_lines = true on_dependency_change = "rerun" [tool.uv] diff --git a/tests/test_quality_policy.py b/tests/test_quality_policy.py index c329325..8826d38 100644 --- a/tests/test_quality_policy.py +++ b/tests/test_quality_policy.py @@ -9,13 +9,15 @@ from pathlib import Path from scripts import check_quality_policy as quality -def test_mutation_campaign_avoids_native_extension_reload_mode(): +def test_mutation_campaign_preloads_native_modules_before_covered_line_discovery(): pyproject = Path("pyproject.toml").read_text() mutmut_config = pyproject.split("[tool.mutmut]", maxsplit=1)[1].split( "\n[", maxsplit=1, )[0] + workflow = Path(".github/workflows/ci.yml").read_text() - assert "mutate_only_covered_lines = false" in mutmut_config + assert "mutate_only_covered_lines = true" in mutmut_config + assert "import torch, yaml; from mutmut.__main__ import cli; cli()" in workflow def _policy():