Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use latest simplecov for better coverage results #6230

Closed
mrcasals opened this issue Jun 22, 2020 · 2 comments · Fixed by #6240
Closed

Use latest simplecov for better coverage results #6230

mrcasals opened this issue Jun 22, 2020 · 2 comments · Fixed by #6240

Comments

@mrcasals
Copy link
Contributor

What

When developing #5934, we found a problem: when running tests for the decidim-proposals engine, where we know code from decidim-core is executed, the code in decidim-core was not considered as covered. This reduced the % of covered code in the results. This was reported in simplecov-ruby/simplecov#885.

The Simplecov maintainers have worked on this issue and have released a PR that should fix the problem: simplecov-ruby/simplecov#894. We should try this in our repo and see if it actually fixed it.

Steps to reproduce

  1. Use simplecov from master branch
  2. bundle install
  3. bin/rake test_app
  4. CI=1 SIMPLECOV=true bin/rspec ./decidim-proposals/spec/system/proposals_spec.rb:50
  5. Check the coverage/coverage.xml file. With the fix, this file should include files outside decidim-proposals
@andreslucena
Copy link
Member

We should try this in our repo and see if it actually fixed it.

I've tried it, it looks like it works well! 🥳

 $ wc -l coverage/coverage.xml.master coverage/coverage.xml.0.18.5 
  19329 coverage/coverage.xml.master
   3039 coverage/coverage.xml.0.18.5
  22368 total

Steps:

bundle install
bin/rake test_app
CI=1 SIMPLECOV=true bin/rspec ./decidim-proposals/spec/system/proposals_spec.rb:50
mv coverage/coverage.xml coverage/coverage.xml.0.18.5
echo 'gem "simplecov", github: "colszowka/simplecov", branch: "master", group: :test' >> Gemfile 
bundle install
CI=1 SIMPLECOV=true bin/rspec ./decidim-proposals/spec/system/proposals_spec.rb:50
mv coverage/coverage.xml coverage/coverage.xml.master

@mrcasals
Copy link
Contributor Author

mrcasals commented Jun 26, 2020

@andreslucena can you send a PR with this? 😄 I think modifying just the Gemfile would be enough 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants