Skip to content

Commit

Permalink
Fix codecov integration (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
fblupi committed Dec 19, 2023
1 parent ff66e74 commit 907dad8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
DATABASE_PASSWORD: postgres

- name: Run RSpec
run: SIMPLECOV=1 CODECOV=1 bundle exec rspec
run: CODECOV=1 bundle exec rspec
env:
RAILS_ENV: test
DATABASE_USERNAME: postgres
Expand Down
11 changes: 0 additions & 11 deletions .simplecov

This file was deleted.

15 changes: 8 additions & 7 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# frozen_string_literal: true

ENV["RAILS_ENV"] ||= "test"

require "simplecov"
require "codecov"

SimpleCov.start "rails"
SimpleCov.formatter = SimpleCov::Formatter::Codecov if ENV["CODECOV"]

require File.expand_path("../config/environment", __dir__)

# Prevent database truncation if the environment is production
Expand All @@ -15,14 +22,8 @@

require "decidim/dev/test/base_spec_helper"

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

require "support/database_cleaner"

# Add additional requires below this line. Rails is not loaded until this point!
require "support/database_cleaner"

# Checks for pending migrations and applies them before tests are run.
# If you are not using ActiveRecord, you can remove these lines.
Expand Down

0 comments on commit 907dad8

Please sign in to comment.