test: expand mutmut coverage to all files in src/flameconnect#33
Conversation
|
@copilot Can you investigate and fix the test error in the CI job? |
The CI failure was in The fix in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot mutmut is taking ~35 minutes to run. That seems much slower than other mutation testing systems I've used given the size of this project. Is there anything that can be done to speed things up? |
Applied three optimizations in
These should roughly halve the runtime. If it's still too slow, the next lever would be |
Co-authored-by: deviantintegral <255023+deviantintegral@users.noreply.github.com>
The test patched builtins.__import__ with a blanket ImportError, blocking ALL imports. This broke mutmut's stats phase which needs working imports for coverage tracking. Setting sys.modules["flameconnect.tui"] = None alone is sufficient to trigger ImportError on `from flameconnect.tui import run_tui`. Co-authored-by: deviantintegral <255023+deviantintegral@users.noreply.github.com>
…children 4 - Exclude __init__.py, const.py, exceptions.py via do_not_mutate (re-exports, constants, and trivial class declarations don't benefit from mutation testing) - Add max_stack_depth=8 to limit test-to-mutant call stack tracing depth - Increase --max-children from 2 to 4 (GitHub Actions ubuntu-24.04 has 4 vCPUs) Co-authored-by: deviantintegral <255023+deviantintegral@users.noreply.github.com>
77e5868 to
56138a2
Compare
paths_to_mutateinsetup.cfgonly listed 4 files, silently excludingcli.py,const.py,exceptions.py,models.py, and the entiretui/subdirectory (13 files) from mutation testing.Changes
Expand mutation coverage
Replace the explicit file list with the package directory so mutmut discovers all Python files automatically:
Fix test compatibility with mutmut
Remove the overly-aggressive
builtins.__import__patch fromtest_tui_import_error—sys.modules["flameconnect.tui"] = Nonealone is sufficient to triggerImportError, and the blanket import patch was breaking mutmut's coverage tracking during the stats phase.Speed up mutmut runtime
The expanded coverage increased mutmut runtime to ~35 minutes. Three optimizations were added to reduce this:
--max-children 4(was 2) in CI — GitHub Actions ubuntu-24.04 runners have 4 vCPUsdo_not_mutate— excludes*/__init__.py,const.py, andexceptions.py(re-exports, constants, and trivial class declarations that don't benefit from mutation testing), reducing from 23 to 19 mutated filesmax_stack_depth = 8— limits how deep mutmut traces call stacks when mapping tests to mutants, speeding up the stats/mapping phase💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.