test(server): fix and wire up the two unrun Python suites

test_contracts.py required operation ID `recordPlayerConnected`, but
openapi.json names that endpoint `claimPlayerConnection` — the accurate
name, since POST /servers/{id}/connect claims a connection lease and
returns a generation. Align the test on the document and assert the set
difference, so a future mismatch names the missing operation instead of
reporting "False is not true".

test_observability_manifests.py copied only two of the four files the
checker reads, so it died on a missing kustomization.yaml before ever
reaching the mutated namespace. Copy the full fixture, split the
namespace and scrape-path mutations into separate cases so either
defect produces its own diagnostic, and add an unmutated-copy case so a
broken fixture can't make the mutation cases pass vacuously.

Neither suite was invoked by any Make target or workflow, which is why
both could sit red. Add them, plus test_threat_model.py, to
verify_multiplayer_local.sh.
This commit is contained in:
Josh Creek
2026-09-05 10:10:11 +01:00
parent 089c127cc3
commit 2c648514ba
3 changed files with 55 additions and 8 deletions
+8 -3
View File
@@ -23,12 +23,17 @@ class ContractTest(unittest.TestCase):
for operation in path.values()
if isinstance(operation, dict) and "operationId" in operation
}
self.assertTrue({
# These are the operation IDs generated clients bind to, so a rename
# here is a breaking change for every consumer. Assert the difference
# rather than a bare subset check: a plain assertTrue reports only
# "False is not true" and hides which operation went missing.
required = {
"createSteamSession", "getProfile", "createQueueTicket",
"heartbeatQueueTicket", "cancelQueueTicket", "acceptProposal",
"declineProposal", "getAssignment", "registerServer",
"recordPlayerConnected", "submitMatchResult", "getRankedProfile",
} <= operations)
"claimPlayerConnection", "submitMatchResult", "getRankedProfile",
}
self.assertEqual(set(), required - operations)
def test_ranked_profile_contract_is_authoritative_and_optional_season_metadata(self):
schema = self.openapi["components"]["schemas"]["RankedProfile"]