Hi,
SonarQube does not show the unit test results as seen from the attached screenshots:
The logs have also been attached:
[file removed by moderator]
Following are the versions of the relevant tools:
SonarQube Version 6.7.5 (build 38563)
SonarQube Scanner 2.8
SonarGo 1.1.0.1612
Please let me know if there is any further information I can provide.
saberduck
(Tibor Blenessy)
May 24, 2019, 3:55pm
2
Hello,
looking at the logs I am not able to determine what could be the issue. Would it be possible to create small project which reproduces the problem? It’s probably related to the directory structure of the project and the heuristics we are trying to find test files corresponding to the packages.
Can you verify that the file containing this test
20:57:31.719 WARN: Failed to find test file for package egbitbucket.dtvops.net/dvr/schedule-updates and test TestDiffSchedules
is visible in SonarQube?
Hi Tibor,
The provided screenshot contains the project that reproduces the problem.
Can you let me know where I can find the warning message in SonarQube?
Thanks,
Edwin
saberduck
(Tibor Blenessy)
June 3, 2019, 7:11am
4
sorry, I will not be able to help you just with screenshot. Can you create small project demonstrating the same issue?
Do you use Go modules ?
tsemark
(tsemark)
April 21, 2020, 5:39am
5
Im still experiencing this problem. i did provide both test execution report and test coverage report but still have no unit test count showing.
i use the sonar test project: https://github.com/SonarSource/sonarcloud_example_go-sqscanner-travis
and replace those parameters on sonar-project.properties and ran - go test -json > report.json
and - go test -coverprofile=coverage.out
and use scanner to point on my local sonarqube server. Note: i exclude the Go Meta Linter report
am i missing something please help thanks
Quentin
(Quentin Jaquier)
April 28, 2020, 1:17pm
6
Hello, and welcome to the community!
SCM: github.com
CI: travis
Scanner: travis addon sonar scanner
Language: go 1.13.x
sonar-project.properties
sonar.projectKey=my-project-key
sonar.projectName=my-project-name
sonar.exclusions=**/*_test.go,**/*_generated*.go,**/*_generated/**,**/vendor/**
sonar.test.inclusions=**/*_test.go
sonar.test.exclusions=**/*_generated*.go,**/*_generated/**,**/vendor/**
sonar.go.tests.reportPaths=report.json
sonar.go.coverage.reportPaths=coverage.out
Snippet from .travis.yml
- stage: sonar
…
In this post, you will find plenty of information, with examples of configurations that worked for others, I think it might be helpful to you!