Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: e2e get logs in relevant tests #800

Merged
merged 2 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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