SonarCloud Go project

Hey hey.
We use a hosted SonarCloud version - and kind of confusing with the Golang test report implementation.
We followed generating the test results as a JSON and pushing them to the analyser as part of the CI. However, I’m not quite getting the use of it. I can’t find anywhere in the UI that can be used to see any information about the tests and I’m not even sure what it is supposed to show.

I’m talking about the field:
sonar.go.tests.reportPath=

The documentation is really not offering much in regards to this and looking at the measures section doesn’t seem to include anything about it too.

What is the use of pushing the test report?

Thanks!

Hey there.

When imported correctly, test Execution metrics (the total number of tests, along with the number of passed/failed/skipped tests) appear under the Coverage section of the Measures tab of analyzed branches in your projects (not pull requests).

Here’s an example of a public project on SonarCloud importing test execution results.

In reality – while some users like to import these (and for some languages, the details are automatically populated depending on the integration), the results don’t actually provide much value in SonarCloud outside of tracking the number of unit tests in your project over time. We don’t expect SonarCloud analysis to be run unless all your tests have passed.

Hey @Colin ,
Thanks for the response! It’s actually also what made me wonder - since we don’t really run Sonar analysis before our tests have passed.
Thanks for input! :slight_smile:

If we’re already on it, if I can piggyback this thread @Colin , our git setup is that after merge the branches get deleted. We enabled branch analysis but for some reason the short lived branches after merge don’t get removed from the branch UI. How is this intended to work?

It’s usually best to create a new topic for each question – but I can just point to the documentation on branch lifetimes which clarifies short-lived branches are removed after 30 days of no analysis.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.