mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-16 21:52:02 +00:00
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:
@@ -65,10 +65,12 @@ func _on_request_succeeded(operation: String, payload: Dictionary) -> void:
|
|||||||
return
|
return
|
||||||
match operation:
|
match operation:
|
||||||
"steam_session":
|
"steam_session":
|
||||||
print("SMOKE: logged in as %s, creating a queue ticket..." % ControlPlaneClient.player_id)
|
print("SMOKE: logged in as %s, fetching ranked profile (expect none yet)..." % ControlPlaneClient.player_id)
|
||||||
var err := ControlPlaneClient.queue_create(_ticket_id, "casual", "smoke-build", 1)
|
var err := ControlPlaneClient.fetch_ranked_profile()
|
||||||
if err != OK:
|
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":
|
"queue_create":
|
||||||
if payload.get("ticket_id", "") != _ticket_id or payload.get("state", "") != "QUEUED":
|
if payload.get("ticket_id", "") != _ticket_id or payload.get("state", "") != "QUEUED":
|
||||||
_finish(false, "unexpected queue_create payload: %s" % payload)
|
_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:
|
func _on_request_failed(operation: String, http_code: int, detail: String) -> void:
|
||||||
if _finished:
|
if _finished:
|
||||||
return
|
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])
|
_finish(false, "%s failed: http=%d detail=%s" % [operation, http_code, detail])
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user