[EPAC-1880]: Backfill unittest tests for backend/cpp-oas-statistics#451
Merged
riddim-developer-bot[bot] merged 1 commit intoMay 14, 2026
Conversation
Add test_cpp_oas_statistics.py with the four required named test cases: - test_parses_happy_path_fixture: loads CSV fixtures, asserts golden snapshot - test_handles_missing_required_field: absent Retirement column → ValueError - test_handles_malformed_upstream: empty bytes → ValueError, pipeline finished not logged - test_emits_required_log_events: patches stderr, verifies pipeline started/finished events Commits fixtures/cpp_fixture.csv and fixtures/oas_fixture.csv (Ontario + Alberta, 2022–2024) so tests run without network access, and fixtures/expected_output.json as the golden snapshot. Also creates .github/workflows/backend-python.yml (did not exist) covering all 10 Python pipelines via a matrix job — cpp-oas-statistics included with no skip guard since tests now exist. All 7 tests pass: python3 -m unittest discover -v in 0.004s.
|
Symphony expected a reviewer-bot review for the current autonomous PR head within the configured SLA window, but none was found.
|
There was a problem hiding this comment.
ReviewAutonomousPR
- Verdict:
approve - Reviewer boundary:
review_only - Acceptance criteria coverage: covered=6, missing=0, unclear=1
Summary
Reviewed against the provided diff and acceptance criteria; no blocking correctness issues identified in this review-only pass.
Actionable findings
- None.
Acceptance criteria coverage
- covered —
test_parses_happy_path_fixtureexists and asserts fixture-driven payload equals committed golden output.- Implemented in
test_cpp_oas_statistics.py; compares againstfixtures/expected_output.json(excluding generated timestamp). - Actionability:
none - Evidence: backend/cpp-oas-statistics/test_cpp_oas_statistics.py, backend/cpp-oas-statistics/fixtures/expected_output.json
- Implemented in
- covered —
test_handles_missing_required_fieldasserts a clear non-KeyErrorfailure on required-field omission.- Added
bad_cppinline fixture and assertsValueErrorfrombuild_payload. - Actionability:
none - Evidence: backend/cpp-oas-statistics/test_cpp_oas_statistics.py
- Added
- covered —
test_handles_malformed_upstreamasserts parse failure and thatpipeline finishedis not logged.- Patches
fetch_csvto empty payload and verifiesmainraises and log output lackspipeline finished. - Actionability:
none - Evidence: backend/cpp-oas-statistics/test_cpp_oas_statistics.py
- Patches
- covered —
test_emits_required_log_eventsvalidates JSON stderr events includepipeline startedandpipeline finished.- Captures
sys.stderr, patchesfetch_csv, runsmain(["--output", ...]), and parses each log line as JSON with required event/fields. - Actionability:
none - Evidence: backend/cpp-oas-statistics/test_cpp_oas_statistics.py
- Captures
- covered — At least one fixture file committed under
backend/cpp-oas-statistics/fixtures/so tests run offline.- Added
cpp_fixture.csv,oas_fixture.csv, and golden snapshot under fixtures directory. - Actionability:
none - Evidence: backend/cpp-oas-statistics/fixtures/cpp_fixture.csv, backend/cpp-oas-statistics/fixtures/oas_fixture.csv
- Added
- covered —
backend-python.ymlremoves thecpp-oas-statisticsskip guard and includes it in the matrix job.- New workflow matrix lists
cpp-oas-statisticsdirectly without conditional skip logic. - Actionability:
none - Evidence: .github/workflows/backend-python.yml
- New workflow matrix lists
- unclear — A regression in assertions should fail the
cpp-oas-statisticsmatrix job.- This is an end-to-end CI behavior that should be validated in the parent workflow/run, but is not directly asserted in the added unit tests.
- Actionability:
follow_up - Suggested follow-up: Add/confirm a CI-level regression mutation test scenario or comment in PR that parent workflow behavior was observed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
backend/cpp-oas-statistics/cpp_oas_statistics.pywas the only Python ingest pipeline without a unittest suite. This PR closes that gap so CI can gate CPP/OAS parser regressions the same way it gates every other pipeline.What changed
backend/cpp-oas-statistics/test_cpp_oas_statistics.py— four required named test cases:test_parses_happy_path_fixture,test_handles_missing_required_field,test_handles_malformed_upstream,test_emits_required_log_events.backend/cpp-oas-statistics/fixtures/cpp_fixture.csvandoas_fixture.csv— minimal fixtures (Ontario + Alberta, 2022–2024) so tests run without network access.backend/cpp-oas-statistics/fixtures/expected_output.json— golden snapshot (13 provinces, national totals CPP=1,530,000 OAS=1,330,000)..github/workflows/backend-python.yml— new workflow (did not previously exist); matrix over 10 Python pipelines; cpp-oas-statistics included without skip guard.Trade-offs not taken
Test plan
Verification evidence
actionlint passed on
backend-python.yml(pre-commit hook). Skipped: iOS build — no Swift sources changed.Resolves EPAC-1880
Reviewer-Boundary: review-only