Bug: 9 jersey checkout tests failing on main — opt_out removed but tests not updated #310

Closed
opened 2026-04-03 23:08:47 +00:00 by forgejo_admin · 1 comment

Type

Bug

Lineage

Discovered during validation of API contract fixes (#280-#284, #286). Blocks deployment of 6 merged PRs. Regression from PR #265 (remove opt-out from jersey ordering options).

Repo

forgejo_admin/basketball-api

What Broke

PR #265 removed opt_out as a valid jersey option, but 9 tests across 3 test files still pass "option": "opt_out" in checkout requests. The endpoint now returns 422 (Unprocessable Entity) for this invalid option, causing test failures. All Woodpecker pipelines on main fail at the test step, blocking kustomize tag updates and ArgoCD deployment.

770 tests pass, 9 fail, 23 skipped. The 9 failures are:

FAILED tests/test_checkout.py::TestPlayerIdCheckoutCreateSession::test_explicit_player_id_opts_out_correct_player
FAILED tests/test_checkout.py::TestPlayerIdCheckoutCreateSession::test_omitted_player_id_defaults_to_first
FAILED tests/test_checkout.py::TestPlayerIdCheckoutCreateSession::test_wrong_player_id_returns_403
FAILED tests/test_dual_auth.py::TestJerseyCheckoutDualAuth::test_token_auth_opt_out
FAILED tests/test_dual_auth.py::TestJerseyCheckoutDualAuth::test_jwt_auth_opt_out
FAILED tests/test_dual_auth.py::TestCheckoutCreateSessionDualAuth::test_jwt_auth_opt_out_works
FAILED tests/test_jersey.py::TestPlayerIdJerseyCheckout::test_explicit_player_id_opts_out_correct_player
FAILED tests/test_jersey.py::TestPlayerIdJerseyCheckout::test_omitted_player_id_defaults_to_first
FAILED tests/test_jersey.py::TestPlayerIdJerseyCheckout::test_wrong_player_id_returns_403

Repro Steps

  1. Run pytest tests/ on current main
  2. Observe 9 failures — all assert 422 where 200 or 403 is expected
  3. All failures pass "option": "opt_out" which is no longer a valid jersey option

Expected Behavior

Tests should use valid jersey options (e.g. "reversible" or "standard"). The opt_out tests that test authorization/player_id logic should still test that logic but with a valid option.

Environment

  • Cluster/namespace: Woodpecker CI
  • Service version: main HEAD (all pipelines since PR #265 merge)
  • Related alerts: none — silent deployment blockage

File Targets

Files to modify:

  • tests/test_checkout.py — 3 tests: change "option": "opt_out" to a valid option (e.g. "reversible")
  • tests/test_dual_auth.py — 3 tests: same change
  • tests/test_jersey.py — 3 tests: same change

Files NOT to touch:

  • src/basketball_api/routes/jersey.py — the opt_out removal was intentional
  • src/basketball_api/routes/checkout.py — no changes needed

Acceptance Criteria

  • All 9 previously failing tests pass with valid jersey options
  • Total test suite: 779 passed, 0 failed
  • Woodpecker pipeline on main goes green
  • ArgoCD deploys the new image to basketball-api pod

Test Expectations

  • Run command: pytest tests/test_checkout.py tests/test_dual_auth.py tests/test_jersey.py -v
  • All 9 previously failing tests should pass

Constraints

  • Do NOT re-add opt_out as a valid option — the removal was intentional (PR #265)
  • Only change test data, not test logic — the authorization/player_id assertions are still valid
  • Keep test names as-is (they test opt-out authorization flow, which still exists as a concept)

Checklist

  • PR opened
  • Tests pass (779/779)
  • No unrelated changes
  • project-westside-basketball
  • Regression from: PR #265 (remove opt-out)
  • Blocks: #280, #281, #282, #283, #284, #286 (API contract fixes awaiting deployment)
### Type Bug ### Lineage Discovered during validation of API contract fixes (#280-#284, #286). Blocks deployment of 6 merged PRs. Regression from PR #265 (remove opt-out from jersey ordering options). ### Repo `forgejo_admin/basketball-api` ### What Broke PR #265 removed `opt_out` as a valid jersey option, but 9 tests across 3 test files still pass `"option": "opt_out"` in checkout requests. The endpoint now returns 422 (Unprocessable Entity) for this invalid option, causing test failures. All Woodpecker pipelines on main fail at the test step, blocking kustomize tag updates and ArgoCD deployment. 770 tests pass, 9 fail, 23 skipped. The 9 failures are: ``` FAILED tests/test_checkout.py::TestPlayerIdCheckoutCreateSession::test_explicit_player_id_opts_out_correct_player FAILED tests/test_checkout.py::TestPlayerIdCheckoutCreateSession::test_omitted_player_id_defaults_to_first FAILED tests/test_checkout.py::TestPlayerIdCheckoutCreateSession::test_wrong_player_id_returns_403 FAILED tests/test_dual_auth.py::TestJerseyCheckoutDualAuth::test_token_auth_opt_out FAILED tests/test_dual_auth.py::TestJerseyCheckoutDualAuth::test_jwt_auth_opt_out FAILED tests/test_dual_auth.py::TestCheckoutCreateSessionDualAuth::test_jwt_auth_opt_out_works FAILED tests/test_jersey.py::TestPlayerIdJerseyCheckout::test_explicit_player_id_opts_out_correct_player FAILED tests/test_jersey.py::TestPlayerIdJerseyCheckout::test_omitted_player_id_defaults_to_first FAILED tests/test_jersey.py::TestPlayerIdJerseyCheckout::test_wrong_player_id_returns_403 ``` ### Repro Steps 1. Run `pytest tests/` on current main 2. Observe 9 failures — all assert 422 where 200 or 403 is expected 3. All failures pass `"option": "opt_out"` which is no longer a valid jersey option ### Expected Behavior Tests should use valid jersey options (e.g. `"reversible"` or `"standard"`). The opt_out tests that test authorization/player_id logic should still test that logic but with a valid option. ### Environment - Cluster/namespace: Woodpecker CI - Service version: main HEAD (all pipelines since PR #265 merge) - Related alerts: none — silent deployment blockage ### File Targets Files to modify: - `tests/test_checkout.py` — 3 tests: change `"option": "opt_out"` to a valid option (e.g. `"reversible"`) - `tests/test_dual_auth.py` — 3 tests: same change - `tests/test_jersey.py` — 3 tests: same change Files NOT to touch: - `src/basketball_api/routes/jersey.py` — the opt_out removal was intentional - `src/basketball_api/routes/checkout.py` — no changes needed ### Acceptance Criteria - [ ] All 9 previously failing tests pass with valid jersey options - [ ] Total test suite: 779 passed, 0 failed - [ ] Woodpecker pipeline on main goes green - [ ] ArgoCD deploys the new image to basketball-api pod ### Test Expectations - Run command: `pytest tests/test_checkout.py tests/test_dual_auth.py tests/test_jersey.py -v` - All 9 previously failing tests should pass ### Constraints - Do NOT re-add opt_out as a valid option — the removal was intentional (PR #265) - Only change test data, not test logic — the authorization/player_id assertions are still valid - Keep test names as-is (they test opt-out authorization flow, which still exists as a concept) ### Checklist - [ ] PR opened - [ ] Tests pass (779/779) - [ ] No unrelated changes ### Related - `project-westside-basketball` - Regression from: PR #265 (remove opt-out) - Blocks: #280, #281, #282, #283, #284, #286 (API contract fixes awaiting deployment)
Author
Owner

Scope Review: NEEDS_REFINEMENT

Review note: review-760-2026-04-03

Issue template is well-written with accurate file targets and testable AC, but this ticket is a duplicate of 3 existing board items — one of which (#733) is already in_progress.

Issues found:

  • DUPLICATE: Board items #731, #733 (in_progress), and #754 all track the same 9 test failures. #733 is already being worked.
  • Stale blockage claim: The 6 "blocked" issues (#280-#284, #286) are all closed and their PRs (#287-#292) are merged to origin/main.
  • Story label mismatch: story:WS-S12 (admin user management) doesn't match this bug's domain (jersey checkout tests). Should be story:WS-S11.
  • Missing arch note: No arch-basketball-api note exists in pal-e-docs.

Recommendation: Close this issue as duplicate. Let #733 remain the single tracking item for this fix.

## Scope Review: NEEDS_REFINEMENT Review note: `review-760-2026-04-03` Issue template is well-written with accurate file targets and testable AC, but this ticket is a **duplicate** of 3 existing board items — one of which (#733) is already in_progress. **Issues found:** - **DUPLICATE:** Board items #731, #733 (in_progress), and #754 all track the same 9 test failures. #733 is already being worked. - **Stale blockage claim:** The 6 "blocked" issues (#280-#284, #286) are all closed and their PRs (#287-#292) are merged to origin/main. - **Story label mismatch:** story:WS-S12 (admin user management) doesn't match this bug's domain (jersey checkout tests). Should be story:WS-S11. - **Missing arch note:** No arch-basketball-api note exists in pal-e-docs. **Recommendation:** Close this issue as duplicate. Let #733 remain the single tracking item for this fix.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/basketball-api#310
No description provided.