diff --git a/.gitignore b/.gitignore index d69ae7ccffb9..e090af9badfc 100644 --- a/.gitignore +++ b/.gitignore @@ -22,9 +22,6 @@ _cgo_export.* _testmain.go -test-report.html -coverage.html - *.exe *.test *.prof diff --git a/Makefile b/Makefile index eec975a84147..e35fa29c41eb 100644 --- a/Makefile +++ b/Makefile @@ -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 $@ diff --git a/sonar-project.properties b/sonar-project.properties index d3722bf2ea96..f1ed8c338e40 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -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