Importing SimpleCov resultset JSON will not be supported from simplecov 18.0. Consider using the JSON formatter, available from SimpleCov 20.0

Here is my gemfile

source "https://rubygems.org"

gem "rspec"

gem 'simplecov', '~> 0.21.2'

gem 'simplecov-json', '~> 0.2'

gemspec

if ENV["JEKYLL_VERSION"]

  gem "jekyll", "~> #{ENV["JEKYLL_VERSION"]}"

end

And here is my single test file

require 'simplecov'

require "simplecov_json_formatter"

SimpleCov.formatter = SimpleCov::Formatter::JSONFormatter

SimpleCov.start

require "string_calculator"

describe StringCalculator do

    describe ".add" do

      context "given an empty string" do

        it "returns zero" do

          expect(StringCalculator.add("")).to eq(0)

        end

      end

    end

  end

I am using json-formatter still on passing .resultset.json i am getting the error saying not a vaild format.

Cannot read coverage report file, expecting standard SimpleCov JSON formatter output: './jekyll-plugins-docs/coverage/.resultset.json

What I am doing wrong here?
Thank you

Hey there.

It would be helpful you could provide the version of SonarQube you’re using, as well as a copy of the .resultset.json file being produced that isn’t able to be read.

version 9.x
Below is the .resultset.json file

{

  "RSpec": {

    "coverage": {

      "C:/Users/t_rishankv/Desktop/docs-jekyll-test/docs-jekyll-plugins/jekyll-plugins-docs/lib/string_calculator.rb": {

        "lines": [

          1,

          null,

          1,

          1,

          null,

          null

        ]

      }

    },

    "timestamp": 1649248235

  }

}