Skip to content

Commit

Permalink
Fix coverage reporting's path overlapping issue (#1091)
Browse files Browse the repository at this point in the history
* Fix codecov's coverage paths

1. disable default path fixes
2. use custom configs in spec_helper to generate reports with expected
   paths

* Fix sentry-rails' coverage requiring order
  • Loading branch information
st0012 committed Nov 5, 2020
1 parent 3e6fb5b commit c8ec6ee
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
2 changes: 2 additions & 0 deletions codecov.yml
@@ -0,0 +1,2 @@
codecov:
disable_default_path_fixes: true
16 changes: 12 additions & 4 deletions sentry-rails/spec/spec_helper.rb
@@ -1,17 +1,25 @@
require "bundler/setup"
require "pry"
require "support/test_rails_app/app"
require "rspec/rails"

require "sentry"

require 'simplecov'
SimpleCov.start

SimpleCov.start do
project_name "sentry-rails"
root File.join(__FILE__, "../../../")
coverage_dir File.join(__FILE__, "../../coverage")
end

if ENV["CI"]
require 'codecov'
SimpleCov.formatter = SimpleCov::Formatter::Codecov
end

require "sentry/rails"
# this already requires the sdk
require "support/test_rails_app/app"
# need to be required after rails is loaded from the above
require "rspec/rails"

DUMMY_DSN = 'http://12345:67890@sentry.localdomain/sentry/42'

Expand Down
9 changes: 8 additions & 1 deletion sentry-ruby/spec/spec_helper.rb
@@ -1,7 +1,14 @@
require "bundler/setup"
require "pry"
require 'simplecov'
SimpleCov.start

SimpleCov.start do
project_name "sentry-ruby"
root File.join(__FILE__, "../../../")
coverage_dir File.join(__FILE__, "../../coverage")
end

binding.pry

if ENV["CI"]
require 'codecov'
Expand Down
7 changes: 6 additions & 1 deletion sentry-sidekiq/spec/spec_helper.rb
Expand Up @@ -6,7 +6,12 @@
# require "support/test_sidekiq_app/app"

require 'simplecov'
SimpleCov.start

SimpleCov.start do
project_name "sentry-sidekiq"
root File.join(__FILE__, "../../../")
coverage_dir File.join(__FILE__, "../../coverage")
end

if ENV["CI"]
require 'codecov'
Expand Down

0 comments on commit c8ec6ee

Please sign in to comment.