From 6715f677c041de9c44c1cb67fba7959c15de2cb9 Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Fri, 20 Sep 2024 16:40:58 +0530 Subject: [PATCH] chore: fix lint issue in tests --- tests/config_type_summary_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/config_type_summary_test.go b/tests/config_type_summary_test.go index 858f16dc..7e61bedb 100644 --- a/tests/config_type_summary_test.go +++ b/tests/config_type_summary_test.go @@ -3,7 +3,6 @@ package tests import ( "context" "encoding/json" - "time" "github.com/flanksource/duty/job" "github.com/flanksource/duty/models" @@ -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"}, @@ -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"},