Skip to content

Commit

Permalink
Rename test-report.* to out/unittest.*
Browse files Browse the repository at this point in the history
  • Loading branch information
afbjorklund committed Apr 20, 2021
1 parent 5ca8927 commit d53e497
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ _cgo_export.*

_testmain.go

test-report.html
coverage.html

*.exe
*.test
*.prof
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@

Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d53e497

Please sign in to comment.