fix: unblock CI — 2 stale test assertions (#500) #501
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/basketball-api!501
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "500-ci-red-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Unblocks CI on main. Two test assertions had drifted from the current code state and were failing on every pipeline (#500, #501, #502, #503, #504 all red).
Closes #500.
Changes
tests/test_first_payment_email.py— subject assertion updated from"Great First Practice"to"Your First Monthly Payment". The subject copy was changed in commit2d75115("feat: add apology opening to first-payment email (#478)"); the test assertion wasn't updated at the time.tests/test_westside_streamlit_ro_role.py— migration filename reference updated from041_add_westside_streamlit_ro_role.pyto044_add_westside_streamlit_ro_role.py. The migration was renumbered to resolve an alembic collision (slot 041 is now041_add_contract_audit_log.py); the test kept the old filename.No code changes. No test widening (assertions still check specific substring / specific file).
Why these exist
Discovered while reviewing PR #499 (monthly-fee Payment Links). Woodpecker pipelines #502 (main push) and #503 (PR #499) both showed the same 2 failures with different "passed" counts, meaning every recent PR has either been merged with red CI or ignored it. Per
feedback_qa_ci_blockers, CI red masks real regressions under "inherited noise." Fixing now so pipeline #499 can be validated against a green main.Test Plan
tests/test_first_payment_email.py::test_send_first_payment_emailpasses locally (was failing on main)tests/test_westside_streamlit_ro_role.py::test_migration_file_existspasses locally (was failing on main)Review Checklist
Related
2d75115— "feat: add apology opening to first-payment email (#478)"041_add_contract_audit_log.pyRelated Notes
feedback_qa_ci_blockers.md— CI red masks real regressions; tests that can't reliably run are blockers, not nits.feedback_enterprise_no_workarounds.md— fix the root cause, don't suppress / skip / widen.PR #501 Review
DOMAIN REVIEW
Stack: Python / pytest. This is a pure test-assertion alignment change — no production code, no migration, no schema, no endpoint, no secrets. Two one-line edits.
Verified both claims against the live tree:
tests/test_first_payment_email.py:101— Production code atsrc/basketball_api/services/email.py:1044emitssubject = f"Your First Monthly Payment | {tenant.name}". The stale"Great First Practice"substring assertion cannot possibly pass. Fix is correct.tests/test_westside_streamlit_ro_role.py:175— Slot 041 is now occupied byalembic/versions/041_add_contract_audit_log.py; the RO role migration lives atalembic/versions/044_add_westside_streamlit_ro_role.py. Fix matches the renumber.Grep of the full repo confirms no other stale references to
"Great First Practice"or041_add_westside_streamlit_ro_roleremain.Assertion quality preserved — each still checks a specific substring / specific filename. No widening to
assert True, no removing the assertion, nopytest.skip. This is exactly the shape of fixfeedback_enterprise_no_workaroundscalls for.BLOCKERS
None.
NITS
test_westside_streamlit_ro_role.py::test_migration_file_existsis a filename-coupling smell — any future alembic renumber collision will break it again. A more durable check would bealembic.script.ScriptDirectorywalking revisions and asserting the RO role revision id exists, independent of filename. Not blocking and out of scope here (file a follow-up if desired); the current fix is the right minimum change to unblock CI.email_type == EmailType.first_paymenton theEmailLogrow (already done below) plus a regex liker"First.*Payment"on the subject if copy continues to churn. Again, out of scope.SOP COMPLIANCE
500-ci-red-fixfollows{issue-number}-{kebab-case-purpose}.env, or credentials committedfeedback_qa_ci_blockers— CI red treated as a blocker, not a nitfeedback_enterprise_no_workarounds— fixes the assertion drift at the root, no skips or wideningOne open checkbox in the PR body is
CI pipeline green (full suite) after this PR merges— that is the post-merge validation gate, not a pre-merge blocker. Reviewer should confirm the pipeline on this branch passes the previously-failing two tests before merge (the stated Review Checklist item).PROCESS OBSERVATIONS
skip_proration/ first-payment. Worth a board sweep after this merges so green CI isn't wasted on stale branches.VERDICT: APPROVED