Skip to content

Commit

Permalink
fix: re-enable pending ginkgo tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Nov 27, 2024
1 parent 42402b4 commit 26975ad
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
12 changes: 11 additions & 1 deletion job/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,17 @@ func RefreshConfigItemSummary3d(ctx context.Context) error {
}

func RefreshConfigItemSummary7d(ctx context.Context) error {
return ctx.DB().Exec("REFRESH MATERIALIZED VIEW config_item_summary_7d").Error
// Not sure why but despite refreshing this view, the `configs` view
// doesn't produce accurate result. It returns fewer configs.
// running this a couple of times to ensure it's refreshed.
for range 3 {
err := ctx.DB().Exec("REFRESH MATERIALIZED VIEW config_item_summary_7d").Error
if err != nil {
return err
}
}

return nil
}

func RefreshConfigItemSummary30d(ctx context.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion tests/config_changes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/samber/lo"
)

var _ = ginkgo.Describe("Config changes recursive", ginkgo.Ordered, ginkgo.Pending, func() {
var _ = ginkgo.Describe("Config changes recursive", ginkgo.Ordered, func() {
// Graph #1 (acyclic)
//
// U --- (A)
Expand Down
6 changes: 3 additions & 3 deletions tests/config_relationship_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"gorm.io/gorm/clause"
)

var _ = ginkgo.Describe("Config relationship recursive", ginkgo.Ordered, ginkgo.Pending, func() {
var _ = ginkgo.Describe("Config relationship recursive", ginkgo.Ordered, func() {
// Graph #1 (cylic)
//
// A
Expand Down Expand Up @@ -264,7 +264,7 @@ var _ = ginkgo.Describe("Config relationship recursive", ginkgo.Ordered, ginkgo.
})
})

var _ = ginkgo.Describe("Config relationship Kubernetes", ginkgo.Ordered, ginkgo.Pending, func() {
var _ = ginkgo.Describe("Config relationship Kubernetes", ginkgo.Ordered, func() {
// Graph #1 (cyclic)
// Cluster
// ________________|________________
Expand Down Expand Up @@ -463,7 +463,7 @@ var _ = ginkgo.Describe("config relationship deletion test", func() {
})
})

var _ = ginkgo.Describe("config relationship depth", ginkgo.Ordered, ginkgo.Pending, func() {
var _ = ginkgo.Describe("config relationship depth", ginkgo.Ordered, func() {
generator := ConfigGenerator{
Nodes: ConfigTypeRequirements{Count: 3},
Namespaces: ConfigTypeRequirements{Count: 2},
Expand Down
2 changes: 1 addition & 1 deletion tests/config_traversal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func traverseTemplate(from models.ConfigItem, relationType string, direction str
return gotExpr
}

var _ = ginkgo.Describe("Config traversal", ginkgo.Ordered, ginkgo.Pending, func() {
var _ = ginkgo.Describe("Config traversal", ginkgo.Ordered, func() {
ginkgo.It("should be able to traverse config relationships via types", func() {
deployment := models.ConfigItem{ID: uuid.New(), Name: utils.Ptr("canary-checker"), Type: utils.Ptr("Kubernetes::Deployment"), ConfigClass: "Deployment"}
helmRelease := models.ConfigItem{ID: uuid.New(), Name: utils.Ptr("mission-control"), Type: utils.Ptr("Kubernetes::HelmRelease"), ConfigClass: "HelmRelease"}
Expand Down
2 changes: 1 addition & 1 deletion tests/config_type_summary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type configClassSummary struct {
analysis map[string]any
}

var _ = ginkgo.Describe("Check config_class_summary view", ginkgo.Ordered, ginkgo.Pending, func() {
var _ = ginkgo.Describe("Check config_class_summary view", ginkgo.Ordered, func() {
ginkgo.It("Should query config_class_summary view", func() {
rows, err := DefaultContext.Pool().Query(context.Background(), "SELECT config_class, analysis, changes, total_configs, cost_per_minute, cost_total_1d, cost_total_7d, cost_total_30d FROM config_class_summary")
Expect(err).ToNot(HaveOccurred())
Expand Down

0 comments on commit 26975ad

Please sign in to comment.