Skip to content

Commit

Permalink
test: persist canary before running
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Nov 15, 2024
1 parent 94f19fa commit fded439
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ import (

"github.com/flanksource/canary-checker/api/context"
"github.com/flanksource/canary-checker/checks"
"github.com/flanksource/canary-checker/pkg/db"
"github.com/flanksource/duty"
dutyContext "github.com/flanksource/duty/context"
"github.com/google/uuid"
"github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/types"

"github.com/flanksource/canary-checker/cmd"
"github.com/flanksource/canary-checker/pkg"
Expand Down Expand Up @@ -105,6 +108,13 @@ func runFixture(name string) {
}

for _, canary := range canaries {
c, _, err := db.PersistCanary(DefaultContext, canary, uuid.NewString())
if err != nil {
ginkgo.Fail(err.Error())
return
}
canary.SetUID(types.UID(c.ID.String()))

if canary.Namespace == "" {
canary.Namespace = "canaries"
}
Expand Down

0 comments on commit fded439

Please sign in to comment.