Skip to content

Commit

Permalink
RHINENG-2284: remove obsoleted PRUNE_UPDATES_LATEST_ONLY flag
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMraka committed Nov 27, 2023
1 parent 59cf47d commit bfd14a5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
2 changes: 0 additions & 2 deletions evaluator/evaluate.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ var (
enableStaleSysEval bool
enableLazyPackageSave bool
enableBaselineEval bool
prunePackageLatestOnly bool
enablePackageCache bool
preloadPackageCache bool
packageCacheSize int
Expand Down Expand Up @@ -78,7 +77,6 @@ func configure() {
enableStaleSysEval = utils.GetBoolEnvOrDefault("ENABLE_STALE_SYSTEM_EVALUATION", true)
enableLazyPackageSave = utils.GetBoolEnvOrDefault("ENABLE_LAZY_PACKAGE_SAVE", true)
enableBaselineEval = utils.GetBoolEnvOrDefault("ENABLE_BASELINE_EVAL", true)
prunePackageLatestOnly = utils.GetBoolEnvOrDefault("PRUNE_UPDATES_LATEST_ONLY", false)
enableBypass = utils.GetBoolEnvOrDefault("ENABLE_BYPASS", false)
useTraceLevel := strings.ToLower(utils.Getenv("LOG_LEVEL", "INFO")) == "trace"
vmaasClient = &api.Client{
Expand Down
15 changes: 0 additions & 15 deletions evaluator/evaluate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,28 +136,13 @@ func TestEvaluateYum(t *testing.T) {
}

func TestEvaluatePruneUpdates(t *testing.T) {
assert.NoError(t, os.Setenv("PRUNE_UPDATES_LATEST_ONLY", "true"))
defer os.Setenv("PRUNE_UPDATES_LATEST_ONLY", "false")

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 TestEvaluateDontPruneUpdates(t *testing.T) {
assert.NoError(t, os.Setenv("PRUNE_UPDATES_LATEST_ONLY", "false"))
TestEvaluate(t)
count := database.CheckSystemUpdatesCount(t, rhAccountID, systemID)
oneGreater := false
for _, c := range count {
oneGreater = oneGreater || (c > 1)
}
assert.True(t, oneGreater,
"At least one package should have multiple updates (OR we have package pruning enabled)")
}

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

0 comments on commit bfd14a5

Please sign in to comment.