aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2018-11-22 18:20:28 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2018-11-22 18:20:28 +0900
commit6d854f9d077b34b846de7a2f998423a6aa66b1e4 (patch)
tree02cd8b9db3db1e24dfedc7abfc03712a718f4aea /railties/test
parentf8bd01cdd9a0ce77cd51b43f82f85df33df762fb (diff)
downloadrails-6d854f9d077b34b846de7a2f998423a6aa66b1e4.tar.gz
rails-6d854f9d077b34b846de7a2f998423a6aa66b1e4.tar.bz2
rails-6d854f9d077b34b846de7a2f998423a6aa66b1e4.zip
Compile packs before run test
Sometimes `test_scaffold_tests_pass_by_default` test fails in CI. https://travis-ci.org/rails/rails/jobs/457621750#L2095-L2120 It seems `manifest.json` was broken. `webpacker` will compile automatically if packs is not compiled. If parallel test is enabled, it seems that this compilation process is executed simultaneously in multiple processes, and it may become an inconsistent state. In order to avoid this, compile before running the test.
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/rake_test.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb
index c38b91ef03..44e3b0f66b 100644
--- a/railties/test/application/rake_test.rb
+++ b/railties/test/application/rake_test.rb
@@ -160,7 +160,10 @@ module ApplicationTests
def test_scaffold_tests_pass_by_default
rails "generate", "scaffold", "user", "username:string", "password:string"
- with_rails_env("test") { rails("db:migrate") }
+ with_rails_env("test") do
+ rails("db:migrate")
+ rails("webpacker:compile")
+ end
output = rails("test")
assert_match(/7 runs, 9 assertions, 0 failures, 0 errors/, output)