diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 03d98ef5e8..d131fa148e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,7 @@ jobs: POSTGRES_DB: open_food_network_test POSTGRES_USER: ofn POSTGRES_PASSWORD: f00d + strategy: fail-fast: false matrix: @@ -86,6 +87,15 @@ jobs: git show --no-patch # the commit being tested (which is often a merge due to actions/checkout@v3) bin/rake knapsack_pro:rspec + - name: Save SimpleCov file + uses: actions/upload-artifact@v3 + with: + name: simple-cov-output-files + path: coverage/*.* + retention-days: 7 + if-no-files-found: ignore + + models: runs-on: ubuntu-22.04 services: @@ -484,4 +494,4 @@ jobs: run: bin/rake karma:run - name: Run jest tests - run: yarn jest + run: yarn jest \ No newline at end of file diff --git a/spec/base_spec_helper.rb b/spec/base_spec_helper.rb index f9bfa1e57c..837e69c466 100644 --- a/spec/base_spec_helper.rb +++ b/spec/base_spec_helper.rb @@ -2,9 +2,11 @@ # This file defines configurations that are universal to all spec types (feature, system, etc) +require 'simplecov' # if ENV["COVERAGE"] +SimpleCov.start + ENV["RAILS_ENV"] ||= 'test' -require 'simplecov' if ENV["COVERAGE"] require 'rubygems' require 'pry' unless ENV['CI'] require 'view_component/test_helpers' @@ -27,6 +29,10 @@ end require 'knapsack_pro' KnapsackPro::Adapters::RSpecAdapter.bind +KnapsackPro::Hooks::Queue.before_queue do + SimpleCov.command_name("rspec_ci_node_#{KnapsackPro::Config::Env.ci_node_index}") +end + # Allow connections to selenium whilst raising errors when connecting to external sites require 'webmock/rspec' WebMock.enable!