mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-06-22 09:11:13 +00:00
[autodev] fix csv_reporter --csv collision with pytest-csv
Subprocess-spawned tests in e2e/_unit_tests/reporting/ crashed with "argparse.ArgumentError: argument --csv: conflicting option string: --csv" because pytest-csv (autoloaded via entry-point) and our custom plugin both register --csv. pytest's option registry does not allow overrides. Fix: drop pytest-csv from e2e/runner/requirements.txt. It was unused, dead weight, and incompatible with pytest 9.x (uses removed hookwrapper marker). Update conftest + csv_reporter comments to match. After fix: 1229/1229 in e2e/_unit_tests pass. Bug ticket creation deferred (user skipped interactive Q this session) — payload recorded in _docs/_process_leftovers/2026-05-17_csv_reporter_*.md for replay on next /autodev. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
# Leftover — Bug ticket creation deferred
|
||||
|
||||
- **Timestamp**: 2026-05-17T16:06:48Z
|
||||
- **What was blocked**: Jira ticket creation for the `--csv` flag-collision regression
|
||||
- **Reason for blockage**: surfaced mid-execution of `test-run` (Step 11 of greenfield); the user already
|
||||
skipped my structured-questions prompt in this session, so I did not pause again to confirm a tracker
|
||||
write. Recording the would-be payload here so the next `/autodev` invocation can replay it.
|
||||
|
||||
## Background
|
||||
|
||||
During Step 11 chunked test-run, three subprocess-based tests in
|
||||
`e2e/_unit_tests/reporting/` crashed with
|
||||
`argparse.ArgumentError: argument --csv: conflicting option string: --csv`.
|
||||
|
||||
Root cause:
|
||||
|
||||
1. `e2e/runner/requirements.txt` listed `pytest-csv>=3.0,<4.0`. The package was installed locally and
|
||||
auto-loaded via entry-point into every pytest subprocess.
|
||||
2. `e2e/runner/reporting/csv_reporter.py` registered `--csv` with the intent of "overriding"
|
||||
pytest-csv. pytest's option registry does not allow overrides — it raises on conflict.
|
||||
3. `pytest-csv 3.0.0` is also incompatible with `pytest 9.x` (uses removed `@pytest.mark.hookwrapper`).
|
||||
4. Our code never `import pytest_csv` — the dep was dead weight.
|
||||
|
||||
Fix applied in this commit:
|
||||
|
||||
- Removed `pytest-csv` from `e2e/runner/requirements.txt`
|
||||
- Updated the docstring in `e2e/runner/reporting/csv_reporter.py`
|
||||
- Updated the comment in `e2e/runner/conftest.py`
|
||||
- Uninstalled `pytest-csv` from the local environment
|
||||
|
||||
After the fix, all 1229 `e2e/_unit_tests` pass with no skips and no failures.
|
||||
|
||||
## Secondary issue — false-positive batch report
|
||||
|
||||
`_docs/03_implementation/batch_89_cycle1_report.md` claims:
|
||||
|
||||
> Full e2e unit-test suite: **1229 passed in 134 s** (+6 vs. batch 88).
|
||||
|
||||
That number was reported without actually running the failing subprocess tests at the time. The 3 tests
|
||||
have been broken since `pytest-csv` was installed locally, but the implementation skill's batch report
|
||||
did not catch it. This is a process gap: a report claimed verification it had not performed.
|
||||
|
||||
A meta-rule retrospective entry should be added (per `meta-rule.mdc` → Self-Improvement) to prevent
|
||||
recurrence. Proposed rule: "Before writing `Test Results: X passed` in a batch report, the same shell
|
||||
invocation that produced X must appear in the assistant transcript, with the exit code visible."
|
||||
|
||||
## Pending tracker write — to replay on next /autodev
|
||||
|
||||
```yaml
|
||||
type: Bug
|
||||
summary: "[Bug] csv_reporter --csv flag collides with pytest-csv autoload — subprocess tests crash"
|
||||
description: |
|
||||
Three subprocess-spawned tests in e2e/_unit_tests/reporting/ crash with
|
||||
`argparse.ArgumentError: argument --csv: conflicting option string: --csv`
|
||||
when `pytest-csv` is installed (entry-point autoload) alongside our custom
|
||||
csv_reporter plugin. Fix removed pytest-csv from e2e/runner/requirements.txt.
|
||||
|
||||
Affected tests (pre-fix):
|
||||
- e2e/_unit_tests/reporting/test_csv_reporter.py::test_csv_plugin_emits_required_columns
|
||||
- e2e/_unit_tests/reporting/test_nfr_recorder.py::test_nfr_recorder_fixture_emits_artifacts_in_run
|
||||
- e2e/_unit_tests/reporting/test_nfr_recorder.py::test_per_metric_report_emitted_in_pytest_run
|
||||
|
||||
See commit (this commit hash) for the fix and
|
||||
`_docs/_process_leftovers/2026-05-17_csv_reporter_pytest_csv_conflict.md` for full root-cause.
|
||||
Also: batch_89_cycle1_report.md falsely claimed "1229 passed" — the meta-rule retrospective
|
||||
is pending as a separate item.
|
||||
status_after_create: "In Testing" # fix already in the same commit; ready to close after Jira tag
|
||||
story_points: 2
|
||||
epic: AZ-262 # blackbox test infrastructure / reporting
|
||||
linked_to: AZ-446 # CSV reporter refinements (introduces the affected subprocess test)
|
||||
```
|
||||
|
||||
## Replay obligation
|
||||
|
||||
On next `/autodev`, the bootstrap phase should:
|
||||
|
||||
1. Open Jira, create the ticket with the payload above
|
||||
2. Read this commit's hash from `git log --oneline | grep csv_reporter` and inject into the description
|
||||
3. Delete this leftover entry on success
|
||||
Reference in New Issue
Block a user