Integration new (beta) Uploader and SimpleCov (Ruby)

Please search for similar issues before creating a ticket. — Done.
All fields below are required.

Description

Hello.

I see a deprecation warning for Codecov Ruby uploader.

I want to use a new (beta) uploader, but I don’t know how to provide to it results from Ruby SimpleCov.

Commit SHAs

Commits of what?…

Repository

CI/CD or Build URL

Uploader

Described above.

Codecov Output

Without --dir argument (default):

curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${CODECOV_TOKEN}
[2021-10-04T11:15:27.535Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/
  Codecov report uploader 0.1.3
[2021-10-04T11:15:27.541Z] ['info'] => Project root located at: /tmp/cirrus-ci-build
[2021-10-04T11:15:27.542Z] ['info'] ->  Token found by arguments
[2021-10-04T11:15:27.547Z] ['info'] Searching for coverage files...
[2021-10-04T11:15:27.557Z] ['error'] There was an error running the uploader: No coverage files located, please try use `-f`, or change the project root with `-R`

With --dir argument:

curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${CODECOV_TOKEN} --dir=coverage/
[2021-10-04T11:19:56.810Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/
  Codecov report uploader 0.1.3
[2021-10-04T11:19:56.816Z] ['info'] => Project root located at: /tmp/cirrus-ci-build
[2021-10-04T11:19:56.816Z] ['info'] ->  Token found by arguments
[2021-10-04T11:19:56.821Z] ['info'] Searching for coverage files...
[2021-10-04T11:19:56.830Z] ['error'] There was an error running the uploader: No coverage files located, please try use `-f`, or change the project root with `-R`

Expected Results

Please provide what you expect to have happened (e.g. a file that has missing coverage on a particular line).

Actual Results

The output above.

Additional Information

SimpleCov supports different formats as I know, but I don’t know which is expected by a new uploader.

Hi @AlexWayfer, right now it’s the cobertura format. You should be able to make the change like this.

require ‘simplecov-cobertura’
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter

OK, thanks, it works (even without --dir argument).

Although simplecov-cobertura gem seems a bit staled, but it’s our problems.

Anyway, I’d like to see a documentation about it somewhere, at least in codecov-ruby repo (near deprecation warning, like a migration guide).

1 Like

100% @AlexWayfer, I realize how difficult this might be for some users to figure out, I’ll work on that.

I think it is much closer to being difficult for all users to figure out. I literally never would have guessed that I need to add a simplecov-cobertura gem to my project to get code cov reporting working, and I had to visit multiple blogs and github repositories, and search through closed issues for “Ruby” before I finally found this community.

I am still not entirely sure how to integrate with Github Actions.

It’s not difficult: test run with SimpleCov.start (and proper cobertura format) will generate coverage files, then just execute as additional command earlier downloaded ./codecov executable (the new uploader) — it’ll find these coverage files by itself.

Thanks! I got it working! https://github.com/pboling/shiftable/blob/main/.github/workflows/test.yml#L49

1 Like

Nice one. I got only Cirrus CI example and it’s not too demonstrative for GH Actions.