Skip to content

Commit

Permalink
fixup! RHINENG-2284: update test to check {system_package,package_sys…
Browse files Browse the repository at this point in the history
…tem}_data tables
  • Loading branch information
MichaelMraka committed Oct 25, 2023
1 parent aca7485 commit 2c5ae61
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
10 changes: 0 additions & 10 deletions base/database/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,6 @@ func CheckAdvisoriesAccountDataNotified(t *testing.T, rhAccountID int, advisoryI
}
}

func CheckSystemUpdatesCount(t *testing.T, accountID int, systemID int64) []int {
var cnt []int
assert.NoError(t, Db.Table("system_package spkg").
Select("json_array_length(spkg.update_data::json) as len").
Where("spkg.update_data is not null").
Where("spkg.system_id = ? AND spkg.rh_account_id = ? ", systemID, accountID).
Pluck("len", &cnt).Error)
return cnt
}

func CreateReportedAdvisories(reportedAdvisories []string, status []int) map[string]int {
reportedAdvisoriesMap := make(map[string]int, len(reportedAdvisories))
for i, adv := range reportedAdvisories {
Expand Down
8 changes: 0 additions & 8 deletions evaluator/evaluate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,6 @@ func TestEvaluateYum(t *testing.T) {
assert.Equal(t, 1, len(mockWriter.Messages))
}

func TestEvaluatePruneUpdates(t *testing.T) {
TestEvaluate(t)
count := database.CheckSystemUpdatesCount(t, rhAccountID, systemID)
for _, c := range count {
assert.LessOrEqual(t, c, 1, "All packages should only have single update stored")
}
}

func TestRun(t *testing.T) {
configure()
var nReaders int32
Expand Down

0 comments on commit 2c5ae61

Please sign in to comment.