-
Notifications
You must be signed in to change notification settings - Fork 64
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
ci: Fix coverage collection due to SimpleCov load timing #122
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rubocop found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
Codecov Report
@@ Coverage Diff @@
## master #122 +/- ##
===========================================
+ Coverage 66.08% 96.41% +30.32%
===========================================
Files 31 15 -16
Lines 684 418 -266
===========================================
- Hits 452 403 -49
+ Misses 232 15 -217
... and 26 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
$0 = 'rspec' | ||
|
||
# This is necessary for when `--standalone` is being used. | ||
$:.unshift File.expand_path '../bundle', __dir__ |
Check notice
Code scanning / Rubocop
Avoid Perl-style global variables.
|
||
# For the travis build we put the bundle directory up a directory | ||
# so it can be shared among the repos for faster bundle installs. | ||
$:.unshift File.expand_path '../../bundle', __dir__ |
Check notice
Code scanning / Rubocop
Avoid Perl-style global variables.
minimum_coverage(RUBY_PLATFORM == 'java' ? 94 : 97) | ||
end | ||
end | ||
rescue LoadError |
Check warning
Code scanning / Rubocop
Don't suppress exceptions.
old_verbose = $VERBOSE | ||
$VERBOSE = false | ||
|
||
unless ENV['COVERAGE'] && ENV['COVERAGE'].empty? || RUBY_VERSION < '1.9.3' |
Check warning
Code scanning / Rubocop
Checks for expressions containing multiple binary operations with ambiguous precedence.
old_verbose = $VERBOSE | ||
$VERBOSE = false | ||
|
||
unless ENV['COVERAGE'] && ENV['COVERAGE'].empty? || RUBY_VERSION < '1.9.3' |
Check notice
Code scanning / Rubocop
Suggests `ENV.fetch` for the replacement of `ENV[]`.
To collect coverage, it turned out that SimpleCov must be loaded before RSpec.
This PR borrows the workaround in rspec-core: https://github.com/rspec/rspec-core/blob/81589709e88db1ec2537faee3a7f4a43c7d9aac1/script/rspec_with_simplecov