We are using sonarqube for tracking coverage metrics of ruby projects. We tried to use the latest version of simplecov1.0.0 which was released 2 days ago
Issue Details
Not able to upload the coverage.json to sonarqube
Env details
SonarQube Community Server: 25.12.0.117093
Working SimpleCov version: 0.22.0
Failing SimpleCov version: 1.0.0
Error Details
ERROR Cannot read coverage report file, expecting standard SimpleCov JSON formatter output: 'coverage/coverage.json'
java.lang.ClassCastException:
class java.lang.String cannot be cast to class org.sonarsource.analyzer.commons.internal.json.simple.JSONObject
The same project works correctly when using SimpleCov 0.22.0.
JSON format comparison
After comparing the generated coverage.json files, we noticed several structural changes in the new version.
Is SimpleCov 1.0.0 officially supported by the SonarRuby analyzer included with SonarQube Server 25.12?
Is the new coverage-v1.0 JSON schema expected to be supported?
Are the structural changes (new $schema, meta, total, relative paths, etc.) expected to be compatible with the current analyzer?
If SimpleCov 1.0.0 is not yet supported, is downgrading to SimpleCov 0.22.0 currently the recommended workaround? If no workaround, We would like to know the timeline to fix this issue as its affecting the many ruby projects in our organization.
Hey @sachin_mf, it seems that we don’t support SimpleCov 1.0.0 yet: it introduces breaking changes to the JSON format. As a workaround, you could pin SimpleCov to a pre-1.0.0 version.
It seems like a SimpleCov dev has opened a PR in our sonar-ruby repository fixing exactly this. I’m going to bring our devs’ attention to this, it seems like we should take it into consideration.
A small note: you are running SonarQube Community Build 25.12, which is not the latest version, but it doesn’t seem to me like this is fixed in the latest version anyway. So I won’t recommend a SonarQube update for now.