Rename test-report.* to out/unittest.*

pull/11157/head
Anders F Björklund 2021-04-20 21:30:32 +02:00
parent 5ca89279e6
commit d53e497e33
3 changed files with 6 additions and 9 deletions

3
.gitignore vendored
View File

@ -22,9 +22,6 @@ _cgo_export.*
_testmain.go
test-report.html
coverage.html
*.exe
*.test
*.prof

View File

@ -368,19 +368,19 @@ gotest: $(SOURCE_GENERATED) ## Trigger minikube test
$(Q)go test -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS)" $(MINIKUBE_TEST_FILES)
# Run the gotest, while recording JSON report and coverage
out/test-report.json: $(SOURCE_FILES) $(GOTEST_FILES)
out/unittest.json: $(SOURCE_FILES) $(GOTEST_FILES)
$(if $(quiet),@echo " TEST $@")
$(Q)go test -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS)" $(MINIKUBE_TEST_FILES) \
-coverprofile=out/coverage.out -json > out/test-report.json
out/coverage.out: out/test-report.json
-coverprofile=out/coverage.out -json > out/unittest.json
out/coverage.out: out/unittest.json
# Generate go test report (from gotest) as a a HTML page
test-report.html: out/test-report.json
out/unittest.html: out/unittest.json
$(if $(quiet),@echo " REPORT $@")
$(Q)go-test-report < $< -o $@
# Generate go coverage report (from gotest) as a HTML page
coverage.html: out/coverage.out
out/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=out/test-report.json
sonar.go.tests.reportPaths=out/unittest.json
sonar.go.coverage.reportPaths=out/coverage.out