-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
SimpleCov.add_group 'contrib', '/lib/ddtrace/contrib' | ||
SimpleCov.add_group 'transport', '/lib/ddtrace/transport' | ||
SimpleCov.add_group 'spec', '/spec/' | ||
|
||
SimpleCov.coverage_dir ENV.fetch('COVERAGE_DIR', 'coverage') | ||
|
||
# Each test run requires its own unique command_name. | ||
# When running `rake spec:test_name`, the test process doesn't have access to the | ||
# rake task process, so we have come up with unique values ourselves. | ||
# | ||
# The current approach is to combine the ruby engine (ruby-2.7,jruby-9.2), | ||
# program name (rspec/test), command line arguments (--pattern spec/**/*_spec.rb), | ||
# and the loaded gemset. | ||
# | ||
# This should allow us to distinguish between runs with the same tests, but different gemsets: | ||
# * appraisal rails5-mysql2 rake spec:rails | ||
# * appraisal rails5-postgres rake spec:rails | ||
# | ||
# Subsequent runs of the same exact test suite should have the same command_name. | ||
command_line_arguments = ARGV.join(' ') | ||
gemset_hash = Digest::MD5.hexdigest Gem.loaded_specs.values.map { |x| "#{x.name}#{x.version}" }.sort.join | ||
ruby_engine = if defined?(RUBY_ENGINE_VERSION) | ||
"#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION}" | ||
else | ||
"#{RUBY_ENGINE}-#{RUBY_VERSION}" # For Ruby < 2.3 | ||
end | ||
SimpleCov.command_name "#{ruby_engine}:#{gemset_hash}:#{$PROGRAM_NAME} #{command_line_arguments}" | ||
|
||
# A very large number to disable result merging timeout | ||
SimpleCov.merge_timeout 2 ** 31 | ||
|
||
# DEV If we choose to enforce a hard minimum. | ||
# SimpleCov.minimum_coverage 95 | ||
|
||
# DEV If we choose to enforce a maximum coverage drop. | ||
# DEV We have to figure out where to store previous coverage data | ||
# DEV in order to perform this comparison | ||
# SimpleCov.maximum_coverage_drop 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters