feat: 完整游戏运维功能
This commit is contained in:
@@ -78,6 +78,7 @@ func TestRunJobChannelAPIWorkflow(t *testing.T) {
|
||||
SessionToken: hello.SessionToken,
|
||||
JobID: claim.Job.JobID,
|
||||
LeaseToken: claim.Job.LeaseToken,
|
||||
Attempt: claim.Job.Attempt,
|
||||
})
|
||||
assertStatus(t, pollRecorder, http.StatusOK)
|
||||
poll := decodeBody[dto.RunJobCancelPollResponse](t, pollRecorder)
|
||||
@@ -104,11 +105,11 @@ func TestRunJobChannelAPIWorkflow(t *testing.T) {
|
||||
reconcileRecorder := performJSON(t, router, http.MethodPost, "/api/v1/run/jobs/reconcile", dto.RunJobReconcileRequest{
|
||||
RunEndpointID: "run-local",
|
||||
SessionToken: hello.SessionToken,
|
||||
ActiveJobIDs: []string{"local-only"},
|
||||
ActiveJobs: []dto.RunJobReconcileEntry{{JobID: "local-only", LeaseToken: "local-lease", Attempt: 1}},
|
||||
})
|
||||
assertStatus(t, reconcileRecorder, http.StatusOK)
|
||||
reconcile := decodeBody[dto.RunJobReconcileResponse](t, reconcileRecorder)
|
||||
if len(reconcile.ActiveJobs) != 0 || len(reconcile.UnknownJobIDs) != 1 || reconcile.UnknownJobIDs[0] != "local-only" {
|
||||
if len(reconcile.ConfirmedJobs) != 0 || len(reconcile.DiscardJobIDs) != 1 || reconcile.DiscardJobIDs[0] != "local-only" {
|
||||
t.Fatalf("expected no active platform jobs and one unknown local job, got %+v", reconcile)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user