mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-13 23:37:47 +00:00
Applies code to avoid conflicts between code coverage reports
...generated by parallel CI nodes, according to documentation here: https://docs.knapsackpro.com/ruby/simplecov/ Sets upload-artifact code on build file - for controllers
This commit is contained in:
12
.github/workflows/build.yml
vendored
12
.github/workflows/build.yml
vendored
@@ -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
|
||||
@@ -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!
|
||||
|
||||
Reference in New Issue
Block a user