test(ci): align catalog fixtures and async verification
CI / validate (pull_request) Failing after 9m47s

This commit is contained in:
2026-08-15 22:12:58 +02:00
parent b575b5260d
commit 59c9aeb507
3 changed files with 16 additions and 9 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ func TestStageValidZIPAndRejectTraversal(t *testing.T) {
if err != nil {
t.Fatal(err)
}
policy := importexport.Policy{TemplateID: "palworld-official", TemplateVersion: "1.1.0", AcceptedFormats: []string{"zip"}, MaxExpandedBytes: 1 << 20, RequiredPaths: []string{"Level.sav", "Players"}}
policy := importexport.Policy{TemplateID: snapshots[0].Template.ID, TemplateVersion: snapshots[0].Template.Version, AcceptedFormats: []string{"zip"}, MaxExpandedBytes: 1 << 20, RequiredPaths: []string{"Level.sav", "Players"}}
valid := zipBytes(t, map[string]string{"Save/Level.sav": "world", "Save/Players/player.sav": "player"})
result, err := service.Stage(ctx, actor.ID, "zip", bytes.NewReader(valid), policy)
if err != nil {
+9 -5
View File
@@ -249,12 +249,16 @@ func (s *LifecycleService) StartInstall(ctx context.Context, instanceID, operati
_ = progress.SetOperationStep(ctx, operationID, "starting", "success")
_ = progress.SetOperationStep(ctx, operationID, "verification", "running")
}
verified, verifyErr := s.verifyStarted(ctx, instanceID)
if verifyErr != nil {
if progress, ok := s.repository.(ProgressRepository); ok {
_ = progress.SetOperationStep(ctx, operationID, "verification", "failed")
verified := state
if !state.Ready {
var verifyErr error
verified, verifyErr = s.verifyStarted(ctx, instanceID)
if verifyErr != nil {
if progress, ok := s.repository.(ProgressRepository); ok {
_ = progress.SetOperationStep(ctx, operationID, "verification", "failed")
}
return s.fail(ctx, operationID, instanceID, "verification_failed", verifyErr)
}
return s.fail(ctx, operationID, instanceID, "verification_failed", verifyErr)
}
lifecycle, observed = stateToLifecycle(verified)
if progress, ok := s.repository.(ProgressRepository); ok {
+6 -3
View File
@@ -292,7 +292,7 @@ func TestCatalogPreviewAndDraftAPIAuthorization(t *testing.T) {
t.Fatalf("catalog response = %s", catalogResponse.Body.String())
}
payload, _ := json.Marshal(map[string]any{
"template_id": "palworld-official", "template_version": "1.1.0",
"template_id": snapshots[0].Template.ID, "template_version": snapshots[0].Template.Version,
"display_name": "Family Palworld", "slug": "family-palworld",
"host_ports": map[string]int{"game": 8211},
"mount_paths": map[string]string{"saved": "/srv/game-servers/family-palworld/saved"},
@@ -754,7 +754,7 @@ func TestInstanceAuthorizationAndInstallationRequestWorkflow(t *testing.T) {
playerCookie := &http.Cookie{Name: sessionCookie, Value: playerSession.Token}
draftPayload, _ := json.Marshal(map[string]any{
"template_id": "palworld-official", "template_version": "1.1.0",
"template_id": snapshots[0].Template.ID, "template_version": snapshots[0].Template.Version,
"display_name": "Authorization Test", "slug": "authorization-test",
"host_ports": map[string]int{"game": 8211},
"mount_paths": map[string]string{"saved": "/srv/game-servers/authorization-test/saved"},
@@ -793,7 +793,10 @@ func TestInstanceAuthorizationAndInstallationRequestWorkflow(t *testing.T) {
substitution := request(t, handler, http.MethodGet, "/api/v1/instances/not-the-member-instance", []*http.Cookie{playerCookie})
assertStatus(t, substitution, http.StatusForbidden)
requestPayload := []byte(`{"template_id":"palworld-official","template_version":"1.1.0","suggested_name":"Friends","player_estimate":8,"desired_schedule":"evenings","mods_requested":true,"message":"Private group"}`)
requestPayload, err := json.Marshal(map[string]any{"template_id": snapshots[0].Template.ID, "template_version": snapshots[0].Template.Version, "suggested_name": "Friends", "player_estimate": 8, "desired_schedule": "evenings", "mods_requested": true, "message": "Private group"})
if err != nil {
t.Fatal(err)
}
installationRequest := jsonRequest(t, handler, "/api/v1/installation-requests", requestPayload, playerCookie, playerSession.CSRFToken)
assertStatus(t, installationRequest, http.StatusCreated)
var createdRequest struct {