From 83201b70d861b7f09e6640c28f9034e18b3faf3e Mon Sep 17 00:00:00 2001 From: Tricia Jenkins Date: Mon, 13 Feb 2023 17:03:33 -0700 Subject: [PATCH] Disable Spring in GithubActions I noticed that `rails test` was reporting low coverage (1.46%). I tried a number of things in the SimpleCov readme without success. In the process I did discovery that `rake test` was reporting reasonable coverage (82.06%). This lead me to reread the DISABLE_SPRING env var suggestion in the SimpleCov readme which did the trick. Spring keeps your Rails application preloaded so you don't need to boot it everytime you test, etc. Not necessary in CI and interferes with SimpleCov which requires that it's loaded before anything else. --- .github/workflows/push.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index e67e1f663..46ba08b9e 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -61,6 +61,7 @@ jobs: - name: Run Tests env: RAILS_ENV: test + DISABLE_SPRING: "true" run: | bundle exec rails db:create db:schema:load bundle exec rails test