Skip to content

Commit

Permalink
testing: fix TestMigrations
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed Sep 16, 2024
1 parent dc8f9b9 commit 313ae88
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/test/e2e/migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package e2e
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"reflect"
Expand Down Expand Up @@ -138,18 +139,17 @@ func TestMigrations(t *testing.T) {
tt.OK(err)
for _, alert := range ress.Alerts {
// skip if not a migration alert
data, ok := alert.Data["objectIDs"].(map[string]interface{})
_, ok := alert.Data["objects"]
if !ok {
continue
}

// collect all object ids per bucket
for bucket, ids := range data {
if objectIDs, ok := ids.([]interface{}); ok {
for _, id := range objectIDs {
got[bucket] = append(got[bucket], id.(string))
}
}
var objects []api.ObjectMetadata
b, _ := json.Marshal(alert.Data["objects"])
_ = json.Unmarshal(b, &objects)
for _, object := range objects {
got[object.Bucket] = append(got[object.Bucket], object.Key)
}
}
if len(got) != 2 {
Expand Down

0 comments on commit 313ae88

Please sign in to comment.