Skip to content

test: cover post-report finalization fallback - #53

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/test-coverage-regression-prevention-2531
Draft

test: cover post-report finalization fallback#53
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/test-coverage-regression-prevention-2531

Conversation

@cursor

@cursor cursor Bot commented May 31, 2026

Copy link
Copy Markdown

Pull Request Template

Summary

Adds a focused runner hardening regression test for the post-report finalization fallback path.

Why

Risky behavior now covered: when the primary campaign report has already been generated successfully, a later finalization failure while summarizing/persisting artifact bundle status must not be reported as a primary report failure. The test verifies the final read model remains partial-but-success-style, keeps report_generation_ok=True, and persists report_status='partial' with the finalization error.

These tests materially reduce regression risk because this branch controls final review truth and process exit semantics for completed measurement runs; a false report failure would mislead operators and could incorrectly block next-step review flows.

Scope

  • Narrow change
  • Broad change

Test files added/updated:

  • test_runner_campaign_outcome_hardening.py

Risk

Test-only change. It exercises runner finalization behavior with existing fixtures and does not change production code.

Validation

  • Dev contract verified (.\.venv\Scripts\python.exe .agent\scripts\helpers\verify_dev_contract.py --quick or CI equivalent)
  • Tests added or updated
  • Existing tests passed
  • Manual validation performed
  • Not validated yet

Commands run:

  • .venv/bin/python -m ruff check test_runner_campaign_outcome_hardening.py
  • QUANTMAP_LAB_ROOT=/tmp/quantmap-test-lab .venv/bin/python -m pytest test_runner_campaign_outcome_hardening.py::test_runner_post_report_finalization_failure_preserves_primary_report_truth -q
  • QUANTMAP_LAB_ROOT=/tmp/quantmap-test-lab .venv/bin/python -m pytest test_runner_campaign_outcome_hardening.py -q

Note: an initial pytest attempt without QUANTMAP_LAB_ROOT failed during import with the repo's expected environment-contract error; reruns with an isolated temp lab root passed.

Agent Surface

  • Instruction files reviewed if behavior/tooling changed
  • Workspace settings changes are intentional and minimal
  • If .agent/scripts/agent_surface_audit.py is present in this branch, agent surface audit passed

Notes

No production behavior changed.

Open in Web View Automation 

Co-authored-by: Joshua L. Davis Sr. <Mad-Labs42@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant