Skip to content

What formatter to use for SimpleCov #5

Description

@sigfrid

Hi there,
Thanks for creating this action.

Is there a specific formatter to use with SimpleCov?

I'm using the SimpleCov::Formatter::JSONFormatter which generates the following file

{
   "timestamp":1612347352,
   "command_name":"RSpec",
   "files":[
      {
         "filename":"/home/runner/work/alpha3/alpha3/app/dummy.rb",
         "covered_percent":71.42857142857143,
         "coverage":{
            "lines":[
               1,
               1,
               1,
               null,
               null,
               1,
               0,
               null,
               null,
               1,
               0,
               null,
               null
            ]
         },
         "covered_strength":0.7142857142857143,
         "covered_lines":5,
         "lines_of_code":7
      }
   ],
   "metrics":{
      "covered_percent":71.42857142857143,
      "covered_strength":0.7142857142857143,
      "covered_lines":5,
      "total_lines":7
   }
}

The file seems to have a different structure from the one expected by the action (https://github.com/devmasx/coverage-check-action/blob/master/lib/coverage_report.rb#L18)
Therefore, when I run it, I get

/action/lib/report_adapter.rb:10:in `conslusion': undefined method `>=' for nil:NilClass (NoMethodError)
	from /action/lib/github_check_run_service.rb:20:in `run'
	from /action/lib/index.rb:29:in `<main>'

Am I missing anything here?

Thanks,

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions