Skip to content

Commit

Permalink
[ci] Set eager-load depending on environment var
Browse files Browse the repository at this point in the history
because otherwise we also eager load when only running
one single test which increases the boot time.
We only set EAGER_LOAD=1 in Travis CI where we run
the full test suite and the boot time does not matter.

See rails/rails#28736
  • Loading branch information
ChrisBr committed Mar 27, 2018
1 parent 3acd715 commit 8b10b95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions dist/ci/travis_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pushd src/api

if test -z "$SUBTEST"; then
export DO_COVERAGE=1
export EAGER_LOAD=1
export TESTOPTS="-v"
case $TEST_SUITE in
api)
Expand Down
4 changes: 4 additions & 0 deletions src/api/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true

# We set eager loading to true in Travis CI
# to run with the same configuration as in production
config.eager_load = ENV.fetch('EAGER_LOAD', '0') == '1'

# Show full error reports and disable caching
# local requests don't trigger the global exception handler -> set to false
config.consider_all_requests_local = false
Expand Down

0 comments on commit 8b10b95

Please sign in to comment.