solidus icon indicating copy to clipboard operation
solidus copied to clipboard

Add coverage report badge using Codecov

Open rubenochiavone opened this issue 5 years ago • 4 comments

Description

Add code coverage report to whole project (not only for each sub-project) and code coverage badge to README.md.

Question

  • Code coverage badge relies on https://codecov.io/. Is using https://codecov.io/ OK for solidus? If so, it would be great if someone could provide a CODECOV_TOKEN to be added in this PR.

Fixes #3048

Checklist:

rubenochiavone avatar Mar 09 '19 11:03 rubenochiavone

@rubenochiavone I've set up a CODECOV_TOKEN env variable in CircleCI that should be visible in all builds but hidden publicly. Let me know if that works

kennyadsl avatar Mar 11 '19 14:03 kennyadsl

Hi there :wave:

It's been a while since I last worked on this PR, but I think it is OK for being reviewed now.

Things worth commenting on:

  • Merged coverage results both locally and on CI
  • Added COVERAGE_DIR environment variable. This variable refers to the directory that will accumulate coverage results between each sub-project test execution and then be used to calculate complete coverage result
  • Set 1 hour timeout to calculate merged coverage locally, see https://github.com/solidusio/solidus/pull/3136/files#diff-0c169400cff5f1673e3dffe059269a26c18ca969c470b93ff9b94587b1b56562R9 and https://www.rubydoc.info/gems/simplecov/SimpleCov%2FConfiguration:merge_timeout. This fixed value could lead to not accurate coverage results if the call COVERAGE=true bin/build takes more than 1 hour. This cannot be tuned right now, but could be done using an environment variable. Any thoughts on that?

Current coverage report: codecov

On #3048 I mentioned that would be interesting to have a report once a PR is created. So to check that I created a test PR to assess coverage validation during PRs and it is working on my fork: https://github.com/rubenochiavone/solidus/pull/1. Installing codecov app on the project already does it - https://docs.codecov.io/docs/team-bot.

Sorry for accidentally creating PR #3848 :grimacing:

rubenochiavone avatar Nov 23 '20 01:11 rubenochiavone

Hey @rubenochiavone, thanks for resuming this work! Do you need anything from me to be changed in the CI (like adding secrets or stuff like that)?

kennyadsl avatar Jul 05 '21 08:07 kennyadsl

Hi @kennyadsl, the token you configured was enough. Check out the coverage report here: https://codecov.io/github/rubenochiavone/solidus/commit/b342cd9123a4d831087f034de0d66acc1f805156. I think that this PR is ready for review. Please let me know if this PR needs more work.

rubenochiavone avatar Jul 06 '21 02:07 rubenochiavone

Hey @rubenochiavone, I'm sorry it's been a while since we last moved it forward. Would you like to rebase it?

waiting-for-dev avatar Aug 25 '22 08:08 waiting-for-dev

Sure. :smiley:

rubenochiavone avatar Aug 31 '22 10:08 rubenochiavone

Hey @waiting-for-dev, besides the rebase, I had to rework the CI script to upload coverage data to codecov.io due to the deprecation of the codecov gem - see https://github.com/codecov/codecov-ruby#readme. The new codecov script also required a different coverage data format, thus I had to change it while generating results in CI.

Current coverage: codecov

Please let me know what you think about it.

rubenochiavone avatar Sep 03 '22 19:09 rubenochiavone

Hey @rubenochiavone, thanks for your continuous work on it 🙌 It looks like there're still some conflicts to resolve.

waiting-for-dev avatar Sep 08 '22 10:09 waiting-for-dev