Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change unittest-report generation from xml to json #195

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

notmyown
Copy link
Contributor

Use json as output format for "go test -json ..."

The result file needs to be referenced in dependent projects as:

sonar.go.tests.reportPaths=target/unit-tests/report.json

@notmyown notmyown added the enhancement New feature or request label Sep 23, 2024
@notmyown notmyown self-assigned this Sep 23, 2024
@notmyown notmyown linked an issue Sep 23, 2024 that may be closed by this pull request
cat ${COVERAGE_REPORT}.tmp | tail +2 >> ${COVERAGE_REPORT} ; \
rm -f ${COVERAGE_REPORT}.tmp ; \
cat $(UNIT_TEST_LOG).tmp >> $(UNIT_TEST_LOG) ; \
rm -f $(UNIT_TEST_LOG).tmp ; \
done
@cat $(UNIT_TEST_LOG) | $(GO_JUNIT_REPORT) > $@
@cat $(UNIT_TEST_LOG) >> $@
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened to the GO_JUNIT_REPORT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've readded the go-junit-report part. To get the json output correct into the tool, i've had to upgrade the go-junit-report to 2.1.0 because the json parameter was added with v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XML-Unittest-reports for Go-Apps not suitable for SonarQube
2 participants