Skip to content

Commit a81481c

Browse files
committed
Makefile,test: Collect kind container and pod logs
Signed-off-by: timflannagan <[email protected]>
1 parent f543a6a commit a81481c

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

Diff for: .github/workflows/e2e-tests.yml

+6
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,9 @@ jobs:
2121
with:
2222
name: e2e-test-output-${{(github.event.pull_request.head.sha||github.sha)}}-${{ github.run_id }}
2323
path: ${{ github.workspace }}/bin/artifacts/*
24+
- name: Archive test artifacts
25+
uses: actions/upload-artifact@v2
26+
if: ${{ always() }}
27+
with:
28+
name: kind-test-artifacts
29+
path: ${{ github.workspace }}/tmp/artifacts/kind/

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ e2e:
136136

137137
# See workflows/e2e-tests.yml See test/e2e/README.md for details.
138138
.PHONY: e2e-local
139-
e2e-local: extra_args=-kind.images=../test/e2e-local.image.tar
139+
e2e-local: extra_args=-kind.images=../test/e2e-local.image.tar kind.artifactsDir=/tmp/artifacts/kind
140140
e2e-local: run=bin/e2e-local.test
141141
e2e-local: bin/e2e-local.test test/e2e-local.image.tar
142142
e2e-local: e2e

Diff for: test/e2e/ctx/provisioner_kind.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build kind
12
// +build kind
23

34
package ctx
@@ -21,7 +22,8 @@ import (
2122
)
2223

2324
var (
24-
images = flag.String("kind.images", "", "comma-separated list of image archives to load on cluster nodes, relative to the test binary or test package path")
25+
images = flag.String("kind.images", "", "comma-separated list of image archives to load on cluster nodes, relative to the test binary or test package path")
26+
artifactsDir = flag.String("kind.artifactsDir", "", "configures where kind pod and container logs are stored")
2527

2628
verbosity int
2729
)
@@ -139,6 +141,11 @@ func Provision(ctx *TestContext) (func(), error) {
139141
var once sync.Once
140142
deprovision := func() {
141143
once.Do(func() {
144+
if *artifactsDir != "" {
145+
ctx.Logf("Collecting logs...")
146+
provider.CollectLogs(name, *artifactsDir)
147+
}
148+
ctx.Logf("Deleting the %s kind cluster...", name)
142149
provider.Delete(name, kubeconfigPath)
143150
})
144151
}

Diff for: test/e2e/gc_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx"
2424
)
2525

26-
var _ = Describe("Garbage collection for dependent resources", func() {
26+
var _ = FDescribe("Garbage collection for dependent resources", func() {
2727
var (
2828
kubeClient operatorclient.ClientInterface
2929
operatorClient versioned.Interface

0 commit comments

Comments
 (0)