-
Notifications
You must be signed in to change notification settings - Fork 25
/
Rakefile
49 lines (40 loc) · 1.21 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2016
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'json'
Rake::TestTask.new(:test) do |t|
t.verbose = false
t.warning = false
t.ruby_opts = ["--parser=parse.y"] if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('3.3')
t.libs << "test"
t.libs << "lib"
if ENV['APPRAISAL_INITIALIZED']
appraised_group = File.basename(ENV['BUNDLE_GEMFILE']).split(/_[0-9]+\./).first
suite_files = Dir['test/{instrumentation,frameworks}/*_test.rb']
t.test_files = suite_files.select { |f| File.basename(f).start_with?(appraised_group) }
else
t.test_files = Dir[
'test/*_test.rb',
'test/{agent,tracing,backend,snapshot}/*_test.rb'
]
end
end
namespace :coverage do
task :merge_reports do
require 'simplecov'
require 'simplecov_json_formatter'
SimpleCov.start do
enable_coverage :branch
SimpleCov.collate Dir["partial_coverage_results/.resultset-*.json"] do
formatter SimpleCov::Formatter::MultiFormatter.new(
[
SimpleCov::Formatter::SimpleFormatter,
SimpleCov::Formatter::JSONFormatter
]
)
end
end
end
end
task :default => :test