diff --git a/.travis.yml b/.travis.yml index 748a6aabb..99ce941df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,6 +42,7 @@ env: - KNAPSACK_PRO_CI_NODE_TOTAL=3 - COVERAGE_REPORTS_TOTAL=4 - FOREM_OWNER_SECRET="secret" # test secret so e2e tests can run properly. + - COVERAGE=true before_install: - sudo apt-get update - sudo apt-get -y install gsfonts @@ -57,6 +58,11 @@ install: script: - bundle exec rails db:create db:schema:load webpacker:compile - bin/knapsack_pro_rspec +after_script: + - curl -Os https://uploader.codecov.io/latest/linux/codecov + - chmod +x codecov + - ls -l ./coverage + - ./codecov notifications: slack: if: branch = main diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 4b91145b1..4de29c6a2 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -1,6 +1,13 @@ ENV["RAILS_ENV"] = "test" require "knapsack_pro" +require "simplecov" +require "simplecov_json_formatter" + +SimpleCov.formatter = SimpleCov::Formatter::JSONFormatter KnapsackPro::Adapters::RSpecAdapter.bind +KnapsackPro::Hooks::Queue.before_queue do |_queue_id| + SimpleCov.command_name("rspec_ci_node_#{KnapsackPro::Config::Env.ci_node_index}") +end require "spec_helper" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 044f2dbe6..54cd6934d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,4 @@ require "dotenv/load" -require "simplecov" require "active_support" require "active_support/testing/time_helpers" require "zonebie/rspec"