I’m looking for an help that I’m unable to get the code coverage % in Sonar Cloud for Go Test Files(main_test.go) using the below Bitbucket pipeline script.
Script to Run Go Test
cd src/workspace
go build -v -o workspace
go test -v -short -coverprofile workspace_coverage.out ./…
When i cross check with bitbucket pipeline artifact for sonar scanner it throws an warning message as below.
19:17:34.236 DEBUG: Resolving file workspace/main.go using relative path
19:17:34.237 WARN: File ‘workspace/main.go’ is not included in the project, ignoring coverage
I know it’s an old topic, but I was wondering if you managed to solve your problem? If yes, it would be great if you could share with us what was the problem.
If not, I invite you to have a look at this example of how someone configured his project.
And eventually at this related post:
Hope it will lead you in your researches.
If you are still stuck, feel free to come back to us with updated information.