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
This commit is contained in:
parent
011437dcb5
commit
7fa4144d48
2 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue