Go coverage reporting as 0% from CircleCI build in SonarCloud

I’m using CircleCI with a public GitHub project.

The CircleCI config is here: https://github.com/ironarachne/world/blob/master/.circleci/config.yml
And the Sonar config is here: https://github.com/ironarachne/world/blob/master/sonar-project.properties

It has never displayed test results in the SonarCloud GUI; coverage is listed as 0%.

What’s wrong with my config?

Hello @BenOvermyer, welcome to the community forum!

I can see the following log line in your CircleCI build

ERROR: Coverage report can't be loaded, report file not found, ignoring this file cov.out.

In your CircleCI config.yml you set the coverage report to be c.out

go test -short -coverprofile c.out ./...

while in your sonar-project.properties you reference cov.out.
Changing that should fix your issue.


1 Like

Thanks, Tom! I can’t believe it was something that simple.