Coverage Report Standard

Before submitting a topic, please confirm the following

I have searched for similar issues before creating this topic.
I have verified that my repository is using the Codecov GitHub app, if using GitHub
I have validated my codecov.yaml configuration file.
I have filled out the below sections to the best of my ability.

Description

I would like to generate a type coverage report for my codes.
eg. typescript coverage
I am currently using a package typescript-coverage-report to generate the coverage report.
It works well but its generated report doesn’t seems to fulfil the codecov coverage report standard and percentage are not shown on the apps.

My questions:

  1. What is the code coverage report standard that codecov is using?
  • I would just like a simple ‘x%’ to be displayed on the github bot + fail the checks if it is less than certain percentages

@kcsam can you provide the command with how you are producing coverage? Are you producing a json file? I see in that package this line which leads me to believe there is a format produced here.

Is this on a public repo? Either way, could you provide a commit SHA?

1 Like

I use the command typescript-coverage-report to create the report.
Yes, I am producing a json file and upload it to codecov.

Unfortunately, this is not on a public repo, so I could not provide you the commit SHA.

Sample json respones:

{
 "fileCounts": {},
  "anys": [
    {
      "file": "coverage/lcov-report/sorter.js",
      "line": 173,
      "character": 16,
      "text": "el",
      "kind": 1
    }
],
  "percentage": 90.0813953488372,
  "total": 8600,
  "covered": 7747,
  "uncovered": 853
}%

We would also like to have sorbet coverage tested as well but codecov also cannot derive the coverage from the json file.

{"timestamp":1674847763,"version_static":"0.5.10607","version_runtime":"0.5.10607","duration":1494772,"commit_sha":"d8e6bae2","commit_timestamp":1674847575,"files":434,"rbi_files":286,"modules":1922,"classes":14487,"singleton_classes":9093,"methods_without_sig":52179,"methods_with_sig":6340,"calls_untyped":388,"calls_typed":2120,"sigils":{"false":93,"true":263,"strict":76,"strong":2},"methods_with_sig_excluding_rbis":236,"methods_without_sig_excluding_rbis":405,"sigils_excluding_rbis":{"false":82,"true":1,"strict":65}}%

Does the json above fulfill the code coverage report that codecov requires?
If not, what is the format that I need to follow?

Thanks @tom

@kcsam got it, it doesn’t look like this follows one of our formats. To be honest, cobertura is the one that I encounter the most as a standard, I would recommend that one.