Repository navigation
Mutmut killing - #2402
Mutmut killing#2402
Conversation
27704a5 to
1acc641
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Layout-dependent assertions fail on headless macOS because the fixture suppresses geometry updates, and the rendering tests are omitted from mutation-test selection.
5 open issues
What changed in this PR
This PR strengthens ArduPilot Methodic Configurator’s regression tests to catch surviving Mutmut mutations, alongside a small telemetry adjustment and acceptance-test setup changes.
Changes:
- Expand boundary, error-handling, state-reset, and GUI assertions across models, plugins, and log analysis.
- Capture the previous radio baseline before counter-reset handling.
- Prepare exact-release metadata caches before offline template-import acceptance tests.
| File | Description |
|---|---|
tests/unit_data_model_vehicle_components_json_schema.py |
Verify schema logging and optional-field state. |
tests/unit_data_model_vehicle_components_import.py |
Expand import fallback, precedence, and diagnostic checks. |
tests/unit_data_model_vehicle_components_display.py |
Check nested schema paths and optional guidance. |
tests/unit_data_model_vehicle_components_base.py |
Assert initial model state and schema. |
tests/test_frontend_tkinter_parameter_editor_table.py |
Check add-parameter dialog controls and guidance. |
tests/test_frontend_tkinter_mavlink_inspector.py |
Assert window layout, table configuration, and tooltips. |
tests/test_frontend_tkinter_log_analysis_rendering.py |
Add focused report-rendering tests. |
tests/test_frontend_tkinter_file_browser.py |
Expand widget and download-preflight assertions. |
tests/test_esc_telemetry.py |
Check mask defaults, offsets, and connection clearing. |
tests/test_data_model_vehicle_components_validation.py |
Expand validation and firmware-choice coverage. |
tests/test_data_model_vehicle_components_templates.py |
Verify schema-directed conversions and diagnostics. |
tests/test_data_model_vehicle_components_import.py |
Strengthen component and battery import assertions. |
tests/test_data_model_vehicle_components_display.py |
Verify visibility, descriptions, and translation handling. |
tests/test_data_model_vehicle_components_base.py |
Cover initialization, casting, and persistence behavior. |
tests/test_data_model_transfer_progress.py |
Add negative-counter coverage. |
tests/test_data_model_parameter_upgrade.py |
Check unmapped stream-rate results. |
tests/test_data_model_par_dict.py |
Expand encoding, parsing, formatting, and error checks. |
tests/test_data_model_mavlink_inspector.py |
Assert initial sorting state. |
tests/test_data_model_firmware_upload.py |
Verify exact transition-error messages. |
tests/test_data_model_file_upload.py |
Assert upload-state cleanup. |
tests/test_data_model_fc_diagnostics.py |
Cover device boundaries and status-text source isolation. |
tests/test_data_model_configuration_step.py |
Check rename feedback and transient-state handling. |
tests/test_data_model_ardupilot_parameter.py |
Expand validation and manual-override coverage. |
tests/test_backend_data_telemetry.py |
Add rate, reset, and baseline assertions. |
tests/plugins/unit_data_model_compass_calibration.py |
Verify active compass IDs are deduplicated. |
tests/plugins/unit_data_model_battery_monitor.py |
Check monitoring-stop state and logging. |
tests/plugins/test_gnss.py |
Cover missing target-system fallback. |
tests/plugins/test_data_model_servo_out.py |
Expand assignment and future-step fallback checks. |
tests/plugins/test_data_model_rc_receiver.py |
Assert receiver initialization and clearing behavior. |
tests/plugins/test_data_model_motor_test.py |
Expand settings, layout, diagnostics, and connection checks. |
tests/plugins/test_data_model_esc_rpm_scale.py |
Verify product normalization and script encoding. |
tests/plugins/test_data_model_ahrs_orientation.py |
Cover orientation boundaries and degenerate inputs. |
tests/plugins/test_data_model_accelerometer_calibration.py |
Assert IMU stream-state resets. |
tests/log_analysis/test_data_model_log_availability_check.py |
Expand performance-monitor summary and health checks. |
tests/log_analysis/test_data_model_imu_analysis.py |
Cover calibration recommendations and temperature boundaries. |
tests/log_analysis/test_data_model_gnss_analysis.py |
Verify status coverage, ordering, and guidance. |
tests/acceptance_template_import_from_params.py |
Prepare and validate exact-release metadata caches. |
ardupilot_methodic_configurator/data_model_data_telemetry.py |
Move radio-baseline capture before reset handling. |
Review effort: Balanced
| expected_geometry = inspector.calculate_scaled_geometry(750, 650).split("+", maxsplit=1)[0] | ||
| assert inspector.root.geometry().split("+", maxsplit=1)[0] == expected_geometry | ||
| assert inspector._state == TelemetryState() | ||
| assert inspector._closed is False | ||
| assert inspector._hovered_cell is None | ||
| assert inspector._timer_id is None | ||
| assert inspector._minimum_section_height == round(60 * inspector.dpi_scaling_factor) | ||
| assert inspector.root.protocol("WM_DELETE_WINDOW") | ||
| assert inspector.root.bind("<Destroy>") | ||
| assert inspector.status.cget("text") == _("No current MAVLink messages. Check the telemetry connection.") | ||
| assert int(inspector.status.cget("wraplength")) == max(1, inspector.main_frame.winfo_width() - 16) | ||
| assert int(inspector.status.cget("width")) == 1 | ||
| assert inspector.status.master is inspector.main_frame | ||
| assert inspector.status.pack_info()["fill"] == "x" | ||
| assert int(inspector.status.pack_info()["padx"]) == 8 | ||
| assert int(inspector.status.pack_info()["pady"]) == 8 | ||
| assert inspector.connection_note.cget("text") == _( | ||
| "A USB connection measures USB traffic, not the telemetry radio link. " | ||
| "Connect through the telemetry link you want to test." | ||
| ) | ||
| assert int(inspector.connection_note.cget("wraplength")) == max(1, inspector.main_frame.winfo_width() - 16) |
| class TestFocusedReportRendering: | ||
| """Check user visible report header, legend, and subsystem details.""" |
| """Given a negative prior counter, clamp the next snapshot to zero bytes.""" | ||
| batch = TransferBatchAccounting.from_sizes([100]) | ||
| file = batch.start_file(100) | ||
| file.transferred = -1 | ||
|
|
||
| assert file.update(-2, 100) == TransferProgress(0, 100) |
| def test_missing_bdshot_mask_uses_a_zero_default(link: SimpleNamespace, monkeypatch: pytest.MonkeyPatch) -> None: | ||
| """Treat an absent output mask as disabled while preserving the explicit zero fallback.""" | ||
|
|
||
| class TrackingParameters(dict[str, float]): | ||
| """Record the fallback passed for a missing flight-controller parameter.""" | ||
|
|
||
| mask_default: object = None | ||
|
|
||
| def tracking_get(parameters: TrackingParameters, key: object, default: object = None) -> object: | ||
| if key == "SERVO_BLH_BDMASK": | ||
| parameters.mask_default = default | ||
| return dict.get(parameters, key, default) | ||
|
|
||
| monkeypatch.setattr(TrackingParameters, "get", tracking_get) | ||
|
|
||
| parameters = TrackingParameters({"ESC_TLM_MAV_OFS": 0.0}) | ||
| link.controller.fc_parameters = parameters | ||
| model = EscTelemetryDataModel(link.controller) | ||
|
|
||
| assert model._configured_bdshot_output(0) is False | ||
| assert parameters.mask_default == 0 |
| def test_bdshot_mask_rejects_an_offset_past_the_output_range(link: SimpleNamespace) -> None: | ||
| """Reject even a matching mask bit when the MAVLink offset is out of range.""" | ||
| link.controller.fc_parameters = {"SERVO_BLH_BDMASK": float(1 << 31), "ESC_TLM_MAV_OFS": 32.0} | ||
| model = EscTelemetryDataModel(link.controller) | ||
|
|
||
| assert model._configured_bdshot_output(-1) is False |
Previous review (2026-11-19)Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting. Reviewed at head Two new or changed MAVLink inspector tests fail on both macOS CI legs, and a few mutation-test additions conflict with CONTRIBUTING.md. Blocking
Should fix
Minor (2)
|
7075138 to
62f5b5b
Compare
Coverage Report for CI Build 44969576713Coverage increased (+0.1%) to 96.186%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions7 previously-covered lines in 1 file lost coverage.
Coverage Stats💛 - Coveralls |
☂️ Code Coverage
Overall Coverage
New FilesNo new covered files... Modified FilesNo covered modified files...
|
Previous review (2026-11-20)Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting. Reviewed at head No blocking issues remain at 62f5b5b; two small test-hygiene points are left. Should fix
Minor (1)
|
Test Results 5 files ± 0 5 suites ±0 57m 59s ⏱️ - 1m 20s For more details on these failures, see this check. Results for commit ddbb345. ± Comparison against base commit 4393038. This pull request removes 39 and adds 250 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
62f5b5b to
ebc64bf
Compare
Previous review (2026-11-20)Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting. Reviewed at head No blocking issues at ebc64bf; two small test-hygiene points remain. Should fix
Minor (1)
Not fully reviewed: the Ubuntu and Windows pytest, pylint, ruff, Docker and pyright 3.15.2 CI legs were still queued at ebc64bf; native GUI rendering, live metadata/SITL and a full mutmut run were not exercised. |
Previous review (2026-11-20)Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting. Reviewed at head One low-severity test-hygiene point remains at f0d0271, and nothing blocks. Should fix
Minor (1)
Not fully reviewed: the Ubuntu and macos-26 pytest, pylint, ruff, pyright, Docker, build_windows and REUSE CI legs were still queued at f0d0271. Native GUI rendering, live metadata/SITL and a full mutmut run were not exercised. |
f0d0271 to
2e3367b
Compare
Previous review (2026-11-20)Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting. Reviewed at head Three low-severity test-hygiene points, missed in earlier rounds, remain at 2e3367b (an amend of f0d0271). Nothing blocks. Should fix
Minor (1)
Not fully reviewed: 24 of 26 CI checks were still queued at 2e3367b. Native GUI rendering on Windows and macOS, live metadata downloads and SITL, and a full mutmut run were not exercised. |
2e3367b to
4dfafb4
Compare
Previous review (2026-11-21)Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting. Reviewed at head Three more low-severity test-hygiene points, present since the first reviewed head and missed in earlier rounds, remain at 4dfafb4 (an amend of 2e3367b). Nothing blocks. Should fix
Not fully reviewed: 24 of 26 CI checks were still queued at 4dfafb4. Native GUI rendering on Windows and macOS, live metadata downloads and SITL, and a full mutmut run were not exercised. |
4dfafb4 to
0a339f2
Compare
Previous review (2026-11-21)Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting. Reviewed at head Two low-severity test-hygiene points remain at 0a339f2 (an amend of 4dfafb4). Nothing blocks, and CI is green apart from macOS pytest failures that match the merge-base exactly. Should fix
Not fully reviewed: native GUI rendering on Windows and macOS, live metadata downloads, SITL and a full mutmut run were not exercised. |
0a339f2 to
0ddffc9
Compare
Previous review (2026-11-22)Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting. Reviewed at head Three low-severity test-hygiene points remain at 0ddffc9 (an amend of 0a339f2). Nothing blocks, and CI fails only on macOS legs that match the merge-base apart from one runner timeout. Should fix
Minor (1)
Not fully reviewed: native GUI rendering on Windows and macOS, live metadata downloads, SITL and a full mutmut run were not exercised. |
0ddffc9 to
ddbb345
Compare
Previous review (2026-11-22)Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting. Reviewed at head One low-severity test-hygiene point remains at ddbb345, a squashed rebase of 0ddffc9 onto the new master. Nothing blocks, and CI at this head has not run yet. Should fix
Not fully reviewed: CI at ddbb345 (all checks still queued), native GUI rendering on Windows and macOS, live metadata downloads, SITL and a full mutmut run were not exercised. |
Add focused coverage for component imports, telemetry, log analysis and user workflows, with related maintenance and test fixture updates. Signed-off-by: Dr.-Ing. Amilcar do Carmo Lucas <amilcar.lucas@iav.de>
ddbb345 to
83fd63a
Compare
|
Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting. Reviewed at head No open findings remain at 83fd63a, an amend of ddbb345 whose only change deletes one test. Not fully reviewed: CI at 83fd63a (all checks still queued), native GUI rendering on Windows and macOS, live metadata downloads, SITL and a full mutmut run were not exercised. |



Description
Mutmut killing of mutation survivors.
Checklist
git commit --signoff)Testing
Describe how you tested these changes: