Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 1d8fb8d

Browse files
committed
Use correct directory for test reports
Signed-off-by: Christian Simon <[email protected]>
1 parent 5bd762b commit 1d8fb8d

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

Makefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Copyright Jetstack Ltd. See LICENSE for details.
2-
BINDIR ?= $(CURDIR)/bin
3-
HACK_DIR ?= hack
4-
PATH := $(BINDIR):$(PATH)
2+
BINDIR ?= $(CURDIR)/bin
3+
HACK_DIR ?= hack
4+
PATH := $(BINDIR):$(PATH)
5+
ARTIFACTS ?= artifacts
56

67
export GO111MODULE=on
78

@@ -83,12 +84,12 @@ generate: depend ## generates mocks and assets files
8384
go generate $$(go list ./pkg/... ./cmd/...)
8485

8586
test: generate verify ## run all go tests
86-
mkdir -p artifacts
87-
go test -v -bench $$(go list ./pkg/... ./cmd/... | grep -v pkg/e2e) | tee artifacts/go-test.stdout
88-
cat artifacts/go-test.stdout | go run github.com/jstemmer/go-junit-report > artifacts/junit-go-test.xml
87+
mkdir -p $(ARTIFACTS)
88+
go test -v -bench $$(go list ./pkg/... ./cmd/... | grep -v pkg/e2e) | tee $(ARTIFACTS)/go-test.stdout
89+
cat $(ARTIFACTS)/go-test.stdout | go run github.com/jstemmer/go-junit-report > $(ARTIFACTS)/junit-go-test.xml
8990

9091
e2e: ## run end to end tests
91-
mkdir -p artifacts
92+
mkdir -p $(ARTIFACTS)
9293
KUBE_OIDC_PROXY_ROOT_PATH="$$(pwd)" go test -timeout 30m -v --count=1 ./test/e2e/suite/.
9394

9495
build: generate ## build kube-oidc-proxy

test/e2e/suite/suite_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
package suite
33

44
import (
5+
"os"
6+
"path/filepath"
57
"testing"
68
"time"
79

@@ -28,6 +30,14 @@ func init() {
2830
func TestE2E(t *testing.T) {
2931
gomega.RegisterFailHandler(ginkgo.Fail)
3032

31-
junitReporter := reporters.NewJUnitReporter("../../../artifacts/junit-go-e2e.xml")
33+
junitPath := "../../../artifacts"
34+
if path := os.Getenv("ARTIFACTS"); path != "" {
35+
junitPath = path
36+
}
37+
38+
junitReporter := reporters.NewJUnitReporter(filepath.Join(
39+
junitPath,
40+
"junit-go-e2e.xml",
41+
))
3242
ginkgo.RunSpecsWithDefaultAndCustomReporters(t, "kube-oidc-proxy e2e suite", []ginkgo.Reporter{junitReporter})
3343
}

0 commit comments

Comments
 (0)