From 867470fd680f62375b6972909a323fb1adb3f074 Mon Sep 17 00:00:00 2001 From: ryan-crabbe-berri Date: Thu, 14 May 2026 10:10:38 -0700 Subject: [PATCH] ci(mutmut): enable mutate_only_covered_lines to fit in CI budget (#27910) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mutation-test workflow timed out at the 350-minute job cap when running whole-folder mutation against litellm/proxy/management_endpoints/ (~30 files, ~1.5 MB of source). Every mutant was running the full test suite, and mutants were generated for lines no test covers — which would survive regardless, just wasting compute. mutmut 3.x's mutate_only_covered_lines setting runs the suite once up front to compute coverage, then skips mutating uncovered lines. This cuts the mutant count dramatically and is the right semantic for the score (no test → no kill possible → uncountable). Per-mutant test filtering by function name is already automatic in mutmut 3.x; no external coverage step is needed. --- pyproject.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 3e131ff698..48effe0fa2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -290,6 +290,12 @@ tests_dir = [ also_copy = [ "litellm/", ] +# Run the test suite once before mutation to gather line coverage, then skip +# mutating lines no test exercises. Those mutants would survive regardless +# (no test hits the line to kill them), so generating them wastes hours of CI. +# The score now reads as "mutation score over covered code" — pair with a +# line-coverage number when reporting. +mutate_only_covered_lines = true # Disable rerun/parallel plugins for mutation runs: # - pytest-retry triggers an `INTERNALERROR: no option named 'filtered_exceptions'` # when invoked via mutmut's in-process `pytest.main()` call.