From bb4f16fe685f87a6ba6aea0ab9b6f6814130687e Mon Sep 17 00:00:00 2001 From: Dario Tranchitella Date: Thu, 25 May 2023 10:39:41 +0200 Subject: [PATCH] chore(gh): junit report --- .github/workflows/e2e.yml | 5 +++++ .gitignore | 1 + e2e/suite_test.go | 13 ++++++++----- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 618404641..f01af9ea1 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -55,3 +55,8 @@ jobs: version: 3.3.4 - name: e2e testing run: make e2e/${{ matrix.k8s-version }} + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: success() || failure() + with: + report_paths: 'e2e/junit.xml' diff --git a/.gitignore b/.gitignore index be2d64823..c306923d3 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ bin .DS_Store *.tgz kind.yaml +e2e/junit.xml diff --git a/e2e/suite_test.go b/e2e/suite_test.go index b832327ed..38151a8bc 100644 --- a/e2e/suite_test.go +++ b/e2e/suite_test.go @@ -6,6 +6,8 @@ package e2e import ( + "os" + "path" "testing" . "github.com/onsi/ginkgo" @@ -27,18 +29,19 @@ import ( // http://onsi.github.io/ginkgo/ to learn more about Ginkgo. var ( - cfg *rest.Config - k8sClient client.Client - testEnv *envtest.Environment - tenantRoleBindingNames = []string{"namespace:admin", "namespace-deleter"} + cfg *rest.Config + k8sClient client.Client + testEnv *envtest.Environment ) func TestAPIs(t *testing.T) { + p, _ := os.Getwd() + RegisterFailHandler(Fail) RunSpecsWithDefaultAndCustomReporters(t, "Controller Suite", - []Reporter{&reporters.JUnitReporter{}}) + []Reporter{reporters.NewJUnitReporter(path.Join(p, "junit.xml"))}) } var _ = BeforeSuite(func(done Done) {