diff options
author | ThibG <thib@sitedethib.com> | 2018-09-13 15:18:47 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-09-13 15:18:47 +0200 |
commit | 7fa4144d48c2372b73b5ece88588381aeb861948 (patch) | |
tree | bfc8dc2d07117b19347f0793b2aecf175401a4fd /config/webpacker.yml | |
parent | 011437dcb5c4719ad6627f3a4dc07a5ce1bd9db8 (diff) |
Fix building assets in test environment (#8691)
Webpacker (Ruby wrapper to webpack) uses RAILS_ENV-based environments while the javascript configuration for webpack re-reads this configuration file using the NODE_ENV environment variable. This means that when RAILS_ENV=test, running “assets:precompile” compiled the production packs in “public/packs” while webpacker expects them in “public/packs-test”. This causes Ruby to recompile them on-the-fly, possibly leading to race conditions in parallel_tests. This changes: - Disables on-the-fly compilation in test environment - Changes the javascript part to read the correct environment
Diffstat (limited to 'config/webpacker.yml')
-rw-r--r-- | config/webpacker.yml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/config/webpacker.yml b/config/webpacker.yml index 8d8470651..ea814a0e6 100644 --- a/config/webpacker.yml +++ b/config/webpacker.yml @@ -40,6 +40,10 @@ test: # Compile test packs to a separate directory public_output_path: packs-test + # CircleCI precompiles packs prior to running the tests. + # Also avoids race conditions in parallel_tests. + compile: false + production: <<: *default |