Move test-report.json and coverage.out to out dir

pull/11092/head
Anders F Björklund 2021-04-14 08:19:02 +02:00
parent 9c0917d983
commit f3c34f9f1f
3 changed files with 7 additions and 8 deletions

2
.gitignore vendored
View File

@ -21,9 +21,7 @@ _cgo_gotypes.go
_cgo_export.*
_testmain.go
test-report.json
coverage.out
coverage.html
*.exe

View File

@ -367,12 +367,13 @@ gotest: $(SOURCE_GENERATED) ## Trigger minikube test
$(if $(quiet),@echo " TEST $@")
$(Q)go test -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS)" $(MINIKUBE_TEST_FILES)
test-report.json: $(SOURCE_FILES) $(GOTEST_FILES)
out/test-report.json: $(SOURCE_FILES) $(GOTEST_FILES)
$(if $(quiet),@echo " TEST $@")
$(Q)go test -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS)" -json $(MINIKUBE_TEST_FILES) -coverprofile=coverage.out > test-report.json
$(Q)go test -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS)" $(MINIKUBE_TEST_FILES) \
-json -coverprofile=out/coverage.out > out/test-report.json
coverage.out: test-report.json
coverage.html: coverage.out
out/coverage.out: out/test-report.json
coverage.html: out/coverage.out
$(if $(quiet),@echo " COVER $@")
$(Q)go tool cover -html=$< -o $@

View File

@ -7,5 +7,5 @@ sonar.exclusions=**/*_test.go,pkg/minikube/assets/assets.go,pkg/minikube/transla
sonar.tests=cmd,pkg
sonar.test.inclusions=**/*_test.go
sonar.go.tests.reportPaths=test-report.json
sonar.go.coverage.reportPaths=coverage.out
sonar.go.tests.reportPaths=out/test-report.json
sonar.go.coverage.reportPaths=out/coverage.out