Phase 2a fix: CI test failures blocking deploy #25
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#25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Lineage
plan-2026-03-08-tryout-prep→ Phase 2 → Phase 2a → CI fixRepo
forgejo_admin/basketball-apiUser Story
As the team deploying for March 13 tryouts,
I need CI to pass on main so the image builds and we can deploy to prod,
So that branding, tokens, email-first gate, AND coach invite endpoint are all live.
Context
PR #24 (coach invite endpoint) merged to main but pipeline #28 fails at the test step.
build-and-pushis skipped, so no image exists for the latest main. Three invite-coach tests fail against real Postgres in CI. The dev agent couldn't run tests locally (no Postgres) so these slipped through.Currently deployed image is
b0fc60f(PR #17). PR #22 image exists (1dbfb8f, pipeline #26 succeeded) and is being deployed now. But we need the full main (including PR #24) to pass CI.67 tests pass. 3 fail. All 3 are in the invite-coach test class.
File Targets
Files to modify:
tests/test_admin.py— fix 3 failing tests inTestInviteCoachHappyPathandTestInviteCoachAuthsrc/basketball_api/routes/admin.py— may need error handling fix if the 500s come from the endpoint, not the testFiles NOT to touch:
Acceptance Criteria
TestInviteCoachHappyPath::test_creates_coach_and_returns_invitepasses — fix timezone-aware vs naive datetime comparisonTestInviteCoachAuth::test_returns_403_for_non_adminreturns 403 not 500 — fix auth dependency error handlingTestInviteCoachAuth::test_returns_401_without_tokenreturns 401 not 500 — same root cause as abovepytest tests/ -v)ruff format .andruff check .cleanTest Expectations
pytest tests/ -v— all 70 tests passpytest tests/test_admin.py -v— all 9 tests passpytest tests/ -vConstraints
require_role("admin")dependency raises an unhandled exception when no user/wrong role is provided without the mock override. Check how generate-tokens tests handle auth (they pass) vs invite-coach tests (they fail). The pattern should be identical.generate_invite_expiry()returnsdatetime.now(timezone.utc)(tz-aware). The test probably compares todatetime.utcnow()(naive). Fix the test to use tz-aware comparison.Checklist
Related
project-westside-basketball