TESTS: require the documented Money toggle success status #891

Open
opened 2026-10-02 17:34:58 +00:00 by kayg · 1 comment
Owner

Evidence

Commit a6fd7f7040972d476575c06a4c363e21070bb42d changed the fixture check in tests/adversarial/xuser_matrix.py:811-814 from status != 200 to status not in (200, 204). This accepts both statuses.

The current contract lists 204, 401, 403 and 404 for PUT /api/v1/plugins/{id}/me (contracts/openapi.json:12115-12174). The Rust handler declares 204 and returns StatusCode::NO_CONTENT (crates/calternal-server/src/main.rs:620-655). There is no documented success response of 200.

Rule

The test rule for issue #865 says not to weaken an existing expectation unless the issue changes the behavior. If an old expectation is wrong, keep it and report the mismatch for owner review.

Expected behaviour

Make the fixture's accepted status agree with the decided API contract. Do not silently accept an undocumented 200. If the API should return 200, update that behavior and its contract through an explicit issue decision.

Test idea

Keep the real Money enablement setup in the cross-User fixture. Assert the exact documented success status and show a clear failure for an unexpected 200. Check the two fixture Users still have Money enabled before the ownership probes.

## Evidence Commit `a6fd7f7040972d476575c06a4c363e21070bb42d` changed the fixture check in `tests/adversarial/xuser_matrix.py:811-814` from `status != 200` to `status not in (200, 204)`. This accepts both statuses. The current contract lists 204, 401, 403 and 404 for `PUT /api/v1/plugins/{id}/me` (`contracts/openapi.json:12115-12174`). The Rust handler declares 204 and returns `StatusCode::NO_CONTENT` (`crates/calternal-server/src/main.rs:620-655`). There is no documented success response of 200. ## Rule The test rule for issue #865 says not to weaken an existing expectation unless the issue changes the behavior. If an old expectation is wrong, keep it and report the mismatch for owner review. ## Expected behaviour Make the fixture's accepted status agree with the decided API contract. Do not silently accept an undocumented 200. If the API should return 200, update that behavior and its contract through an explicit issue decision. ## Test idea Keep the real Money enablement setup in the cross-User fixture. Assert the exact documented success status and show a clear failure for an unexpected 200. Check the two fixture Users still have Money enabled before the ownership probes.
Author
Owner

Implemented in 0a2a79f79: the Money fixture now requires HTTP 204, matching contracts/openapi.json and the handler's StatusCode::NO_CONTENT. The assertion no longer accepts an undocumented 200. The adversarial runner was not run because the shared host load was high; its merge-round command is in the #865 report.

Implemented in `0a2a79f79`: the Money fixture now requires HTTP 204, matching `contracts/openapi.json` and the handler's `StatusCode::NO_CONTENT`. The assertion no longer accepts an undocumented 200. The adversarial runner was not run because the shared host load was high; its merge-round command is in the #865 report.
Sign in to join this conversation.
No labels
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
kayg/calternal#891
No description provided.