Skip to content

Commit

Permalink
fix e2e get logs in relevant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ashnamehrotra committed Jul 26, 2023
1 parent 614c959 commit 05392c3
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 17 deletions.
1 change: 0 additions & 1 deletion test/e2e/tests/collector_disable_scan/eraser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func TestDisableScanner(t *testing.T) {
t.Error("error getting eraser pod logs", err)
}


return ctx
}).
Feature()
Expand Down
1 change: 0 additions & 1 deletion test/e2e/tests/collector_ensure_scan/eraser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ func TestEnsureScannerFunctions(t *testing.T) {
return ctx
}).
Assess("Get logs", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {

if err := util.GetPodLogs(t); err != nil {
t.Error("error getting eraser pod logs", err)
}
Expand Down
4 changes: 0 additions & 4 deletions test/e2e/tests/collector_pipeline/eraser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ func TestCollectScanErasePipeline(t *testing.T) {

return ctx
}).
Assess("Get logs", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {

return ctx
}).
Feature()

util.Testenv.Test(t, collectScanErasePipelineFeat)
Expand Down
7 changes: 7 additions & 0 deletions test/e2e/tests/configmap_update/eraser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ components:

return ctx
}).
Assess("Get logs", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {
if err := util.GetPodLogs(t); err != nil {
t.Error("error getting eraser pod logs", err)
}

return ctx
}).
Feature()

util.Testenv.Test(t, metrics)
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/tests/imagelist_change/eraser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ func TestUpdateImageList(t *testing.T) {
return ctx
}).
Assess("Get logs", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {
if err := util.GetPodLogs(t); err != nil {
t.Error("error getting eraser pod logs", err)
}

return ctx
}).
Expand Down
6 changes: 1 addition & 5 deletions test/e2e/tests/imagelist_include_nodes/eraser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func TestIncludeNodes(t *testing.T) {

// get pod logs before imagejob is deleted
if err := util.GetPodLogs(t); err != nil {
t.Error("error getting collector pod logs", err)
t.Error("error getting eraser pod logs", err)
}

ctxT, cancel := context.WithTimeout(ctx, util.Timeout)
Expand All @@ -144,10 +144,6 @@ func TestIncludeNodes(t *testing.T) {

return ctx
}).
Assess("Get logs", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {

return ctx
}).
Feature()

util.Testenv.Test(t, includeNodesFeat)
Expand Down
4 changes: 0 additions & 4 deletions test/e2e/tests/imagelist_rm_images/eraser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,6 @@ func TestImageListTriggersRemoverImageJob(t *testing.T) {

return ctx
}).
Assess("Get logs", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {

return ctx
}).
Feature()

util.Testenv.Test(t, rmImageFeat)
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/tests/imagelist_skip_nodes/eraser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ func TestSkipNodes(t *testing.T) {
return ctx
}).
Assess("Get logs", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {
if err := util.GetPodLogs(t); err != nil {
t.Error("error getting eraser pod logs", err)
}

return ctx
}).
Expand Down
8 changes: 7 additions & 1 deletion test/e2e/tests/metrics_test_disable_scanner/eraser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func TestMetricsWithScannerDisabled(t *testing.T) {
t.Error("error getting eraser pod logs", err)
}


return ctx
}).
Assess("Check images_removed_run_total metric", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {
Expand Down Expand Up @@ -65,6 +64,13 @@ func TestMetricsWithScannerDisabled(t *testing.T) {

return ctx
}).
Assess("Get logs", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {
if err := util.GetPodLogs(t); err != nil {
t.Error("error getting eraser pod logs", err)
}

return ctx
}).
Feature()

util.Testenv.Test(t, metrics)
Expand Down
7 changes: 7 additions & 0 deletions test/e2e/tests/metrics_test_eraser/eraser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ func TestMetricsEraserOnly(t *testing.T) {

return ctx
}).
Assess("Get logs", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {
if err := util.GetPodLogs(t); err != nil {
t.Error("error getting eraser pod logs", err)
}

return ctx
}).
Feature()

util.Testenv.Test(t, metrics)
Expand Down
8 changes: 7 additions & 1 deletion test/e2e/tests/metrics_test_scanner/eraser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func TestMetricsWithScanner(t *testing.T) {
t.Error("error getting eraser pod logs", err)
}


return ctx
}).
Assess("Check images_removed_run_total metric", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {
Expand Down Expand Up @@ -86,6 +85,13 @@ func TestMetricsWithScanner(t *testing.T) {

return ctx
}).
Assess("Get logs", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {
if err := util.GetPodLogs(t); err != nil {
t.Error("error getting eraser pod logs", err)
}

return ctx
}).
Feature()

util.Testenv.Test(t, metrics)
Expand Down

0 comments on commit 05392c3

Please sign in to comment.