Skip to content

Commit

Permalink
chore: fix lint issue in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra authored and moshloop committed Sep 20, 2024
1 parent f068ef1 commit 6715f67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/config_type_summary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package tests
import (
"context"
"encoding/json"
"time"

"github.com/flanksource/duty/job"
"github.com/flanksource/duty/models"
Expand Down Expand Up @@ -119,7 +118,8 @@ var _ = ginkgo.Describe("Check config_class_summary view", ginkgo.Ordered, func(
DefaultContext.DB().Create(&item)
}

job.RefreshConfigItemAnalysisChangeCount30d(DefaultContext)
err := job.RefreshConfigItemAnalysisChangeCount30d(DefaultContext)
Expect(err).To(BeNil())

summary30D, err := query.ConfigSummary(DefaultContext, query.ConfigSummaryRequest{
GroupBy: []string{"type"},
Expand Down Expand Up @@ -159,10 +159,10 @@ var _ = ginkgo.Describe("Check config_class_summary view", ginkgo.Ordered, func(
DefaultContext.DB().Model(&models.ConfigChange{}).Where("id = ?", change0.ID).UpdateColumn("created_at", gorm.Expr("NOW() - '15 days'::interval"))

analysis0 := gen.Generated.Analysis[0]
analysis0.LastObserved.Add(-15 * 24 * time.Hour)
DefaultContext.DB().Model(&models.ConfigAnalysis{}).Where("id = ?", analysis0.ID).UpdateColumn("last_observed", gorm.Expr("NOW() - '15 days'::interval"))

job.RefreshConfigItemAnalysisChangeCount7d(DefaultContext)
err = job.RefreshConfigItemAnalysisChangeCount7d(DefaultContext)
Expect(err).To(BeNil())
summary7D, err := query.ConfigSummary(DefaultContext, query.ConfigSummaryRequest{
GroupBy: []string{"type"},
Changes: query.ConfigSummaryRequestChanges{Since: "7d"},
Expand Down

0 comments on commit 6715f67

Please sign in to comment.