Ruby - Test coverage is populated but unit test count is blank

Environment:

  • SonarQube 9.2.4
  • Bitbucket Image for scanning: sonarsource/sonarqube-scan:1.0.0

What are you trying to achieve?

  • Get the unit test count populated in SonarQube

What have you tried so far to achieve this?
I have a ruby project where the tests are located in

  • spec/**

In my sonar-project.properties file I have the following (somewhat redacted)

sonar.projectKey=my-api
sonar.organization=my-org
sonar.sources=app,config,db,lib
sonar.tests=spec
sonar.test.inclusions=spec/**/*_spec.rb
sonar.exclusions=**node_modules/**,**/build_files/**,**/spec/**,**/vendor/**
sonar.ruby.coverage.reportPaths=coverage/coverage.json

With this, my test coverage populates as expected
image

But, as you can see the unit tests count is blank. I have read through this support forum and tried every permutation of config I could find, but I am at a loss and any help would be appreciated.

Hey there.

Getting the count of unit tests requires importing test execution details. Today, there’s no report format supported for Ruby (although you can always convert a report to Generic Test Data if you want to put in the work to build a converter).

1 Like

Thank you Colin! Is there a list of supported languages/test execution results?