Skip to content

Commit 0794be4

Browse files
authored
Add branch test coverage report (#1343)
1 parent 62a019f commit 0794be4

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.simplecov

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Enable branch coverage reporting.
2+
# SimpleCov only supports branch coverage in
3+
# Ruby >= 2.5.
4+
SimpleCov.enable_coverage :branch if RUBY_VERSION >= '2.5.0'
5+
6+
# Categorize SimpleCov report, for easier reading
17
SimpleCov.add_group 'contrib', '/lib/ddtrace/contrib'
28
SimpleCov.add_group 'transport', '/lib/ddtrace/transport'
39
SimpleCov.add_group 'spec', '/spec/'

Gemfile

+10-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,16 @@ gem 'rspec-collection_matchers', '~> 1.1'
3232
gem 'rspec_junit_formatter', '>= 0.4.1'
3333
gem 'rspec_n', '~> 1.3' if RUBY_VERSION >= '2.3.0'
3434
gem 'ruby-prof', '~> 1.4' if RUBY_PLATFORM != 'java' && RUBY_VERSION >= '2.4.0'
35-
gem 'simplecov', '~> 0.17'
35+
if RUBY_VERSION >= '2.5.0'
36+
# Merging branch coverage results does not work for old, unsupported rubies.
37+
# We have a fix up for review, https://github.com/simplecov-ruby/simplecov/pull/972,
38+
# but given it only affects unsupported version of Ruby, it might not get merged.
39+
gem 'simplecov', git: 'https://github.com/DataDog/simplecov', ref: '3bb6b7ee58bf4b1954ca205f50dd44d6f41c57db'
40+
else
41+
# Compatible with older rubies. This version still produces compatible output
42+
# with a newer version when the reports are merged.
43+
gem 'simplecov', '~> 0.17'
44+
end
3645
gem 'warning', '~> 1' if RUBY_VERSION >= '2.5.0'
3746
gem 'webmock', '>= 3.10.0'
3847
gem 'webrick', '>= 1.7.0' if RUBY_VERSION >= '3.0.0' # No longer bundled by default since Ruby 3.0

0 commit comments

Comments
 (0)