Skip to content

Make incremental webpack compilation work better when running RSpec tests

As mentioned in #300412 (comment 579157279):

If you run a feature spec with js for a page that will be compiled for the first time, it'll likely fail due to the compilation. But in any case if it fails and you run it again, it'll likely succeed, it's just that the compilation takes some time.

Workarounds

  1. Re-run the spec after the page's bundles have compiled
  2. Visit the page manually in the GDK before running the spec
  3. Disable incremental webpack compilation before starting rspec...
    • ... either by editing gdk.yml then running gdk reconfigure
    • ... or by adding export DEV_SERVER_INCREMENTAL=false to env.runit
  4. ???

Possible fixes

  1. Make rspec "aware" of incremental webpack compilation by waiting for compilation to finish before running assertions
  2. Making rspec automatically restart webpack with incremental compilation disabled if it's detected as enabled?
  3. ???