test(multiplayer): extend the real integration test to cover ranked profile fetch

Adds fetch_ranked_profile() right after login, asserting the expected
404 for a brand-new identity round-trips correctly through the real
RankedProfileProvider (previous commit) before proceeding to the
existing queue_create -> heartbeat -> cancel sequence. Verified stable
across 3 consecutive full runs.
This commit is contained in:
Josh Creek
2026-09-01 14:20:09 +01:00
parent a1ae36a54c
commit 57fe6f4acc
+14 -3
View File
@@ -65,10 +65,12 @@ func _on_request_succeeded(operation: String, payload: Dictionary) -> void:
return
match operation:
"steam_session":
print("SMOKE: logged in as %s, creating a queue ticket..." % ControlPlaneClient.player_id)
var err := ControlPlaneClient.queue_create(_ticket_id, "casual", "smoke-build", 1)
print("SMOKE: logged in as %s, fetching ranked profile (expect none yet)..." % ControlPlaneClient.player_id)
var err := ControlPlaneClient.fetch_ranked_profile()
if err != OK:
_finish(false, "queue_create() failed to start: %s" % error_string(err))
_finish(false, "fetch_ranked_profile() failed to start: %s" % error_string(err))
"ranked_profile":
_finish(false, "a brand-new testkit identity unexpectedly already has a ranked profile: %s" % payload)
"queue_create":
if payload.get("ticket_id", "") != _ticket_id or payload.get("state", "") != "QUEUED":
_finish(false, "unexpected queue_create payload: %s" % payload)
@@ -123,6 +125,15 @@ func _send_cancel_once_idle() -> void:
func _on_request_failed(operation: String, http_code: int, detail: String) -> void:
if _finished:
return
if operation == "ranked_profile" and http_code == HTTPClient.RESPONSE_NOT_FOUND:
# Expected: a brand-new testkit identity has no ratings row yet, and
# the real store adapter reports that the same way the in-memory
# fallback it replaced always did -- not found, not an error.
print("SMOKE: ranked profile correctly reports not found, creating a queue ticket...")
var err := ControlPlaneClient.queue_create(_ticket_id, "casual", "smoke-build", 1)
if err != OK:
_finish(false, "queue_create() failed to start: %s" % error_string(err))
return
_finish(false, "%s failed: http=%d detail=%s" % [operation, http_code, detail])