diff options
Diffstat (limited to '_support')
-rw-r--r-- | _support/Makefile.template | 11 | ||||
-rw-r--r-- | _support/makegen.go | 3 |
2 files changed, 10 insertions, 4 deletions
diff --git a/_support/Makefile.template b/_support/Makefile.template index 60f334e0e..7bbf2d4c1 100644 --- a/_support/Makefile.template +++ b/_support/Makefile.template @@ -122,8 +122,8 @@ prepare-tests: {{ .GitlabShellDir }}/config.yml {{ .TestRepo }} {{ .GitTestRepo test: test-go rspec rspec-gitlab-shell .PHONY: test-go -test-go: prepare-tests - @cd {{ .SourceDir }} && go test -tags "$(BUILD_TAGS)" -count=1 {{ join .AllPackages " " }} # count=1 bypasses go 1.10 test caching +test-go: prepare-tests {{ .GoJunitReport }} + @cd {{ .SourceDir }} && go test -v -tags "$(BUILD_TAGS)" -count=1 {{ join .AllPackages " " }} 2>&1 | {{ .GoJunitReport }} > report-${CI_JOB_NAME}.xml .PHONY: test-with-proxies test-with-proxies: prepare-tests @@ -137,8 +137,8 @@ test-with-praefect: build prepare-tests GITALY_TEST_PRAEFECT_BIN={{ .BuildDir }}/bin/praefect go test -tags "$(BUILD_TAGS)" -count=1 {{ join .AllPackages " " }} # count=1 bypasses go 1.10 test caching .PHONY: race-go -race-go: prepare-tests - @cd {{ .SourceDir }} && go test -tags "$(BUILD_TAGS)" -race {{ join .AllPackages " " }} +race-go: prepare-tests {{ .GoJunitReport }} + @cd {{ .SourceDir }} && go test -v -tags "$(BUILD_TAGS)" -race {{ join .AllPackages " " }} 2>&1 | {{ .GoJunitReport }} > report-${CI_JOB_NAME}.xml .PHONY: rspec rspec: assemble-go prepare-tests @@ -178,6 +178,9 @@ check-formatting: {{ .GitalyFmt }} {{ .GoImports }}: {{ .MakegenDep }} go get golang.org/x/tools/cmd/goimports@2538eef75904eff384a2551359968e40c207d9d2 +{{ .GoJunitReport }}: {{ .MakegenDep }} + go get github.com/jstemmer/go-junit-report@984a47ca6b0a7d704c4b589852051b4d7865aa17 + .PHONY: {{ .GitalyFmt }} {{ .GitalyFmt }}: @cd {{ .SourceDir }} && go build -o $@ ./internal/cmd/gitalyfmt diff --git a/_support/makegen.go b/_support/makegen.go index 870184741..d9e975bbe 100644 --- a/_support/makegen.go +++ b/_support/makegen.go @@ -78,6 +78,9 @@ func (gm *gitalyMake) GoLicenses() string { return "bin/go-licenses" } func (gm *gitalyMake) StaticCheck() string { return filepath.Join(gm.BuildDir(), "bin/staticcheck") } func (gm *gitalyMake) ProtoC() string { return filepath.Join(gm.BuildDir(), "protoc/bin/protoc") } func (gm *gitalyMake) ProtoCGenGo() string { return filepath.Join(gm.BuildDir(), "bin/protoc-gen-go") } +func (gm *gitalyMake) GoJunitReport() string { + return filepath.Join(gm.BuildDir(), "bin/go-junit-report") +} func (gm *gitalyMake) ProtoCGenGitaly() string { return filepath.Join(gm.BuildDir(), "bin/protoc-gen-gitaly") } |