-
-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve EnsureAssetsCompiled logic to wait for webpack process to finish #253
Conversation
f79e7c7
to
8c395c9
Compare
Looking great! Reviewed 6 of 6 files at r1. lib/react_on_rails/ensure_assets_compiled.rb, line 56 [r1] (raw file): lib/react_on_rails/ensure_assets_compiled.rb, line 63 [r1] (raw file): lib/react_on_rails/ensure_assets_compiled.rb, line 72 [r1] (raw file): -watch is not correct lib/react_on_rails/utils.rb, line 14 [r1] (raw file): IDEALLY, we should run both client and server concurrently, rather than sequentially, but you can defer on that one. Where are you capturing the results? and aborting if not success? Comments from the review on Reviewable.io |
Reviewed 2 of 6 files at r1. lib/react_on_rails/ensure_assets_compiled.rb, line 56 [r1] (raw file): lib/react_on_rails/ensure_assets_compiled.rb, line 63 [r1] (raw file): lib/react_on_rails/ensure_assets_compiled.rb, line 72 [r1] (raw file): Done. lib/react_on_rails/utils.rb, line 14 [r1] (raw file): Comments from the review on Reviewable.io |
8c395c9
to
c65c1f0
Compare
Reviewed 4 of 6 files at r1. Comments from the review on Reviewable.io |
c65c1f0
to
c94e859
Compare
More great code. Couple minor comments. Reviewed 3 of 3 files at r2. lib/react_on_rails/ensure_assets_compiled.rb, line 57 [r2] (raw file): lib/react_on_rails/ensure_assets_compiled.rb, line 79 [r2] (raw file): lib/react_on_rails/utils.rb, line 14 [r1] (raw file): Comments from the review on Reviewable.io |
c94e859
to
3b29494
Compare
Reviewed 2 of 3 files at r2. lib/react_on_rails/ensure_assets_compiled.rb, line 57 [r2] (raw file): I'm not sure what you meant by matching here though, I'm not matching anything. This is just the output that happens after we compile the bundle. lib/react_on_rails/utils.rb, line 14 [r1] (raw file): Comments from the review on Reviewable.io |
Reviewed 1 of 1 files at r3. lib/react_on_rails/ensure_assets_compiled.rb, line 57 [r2] (raw file): lib/react_on_rails/utils.rb, line 14 [r1] (raw file): Comments from the review on Reviewable.io |
3b29494
to
5d7647a
Compare
Review status: 5 of 6 files reviewed at latest revision, 2 unresolved discussions. lib/react_on_rails/ensure_assets_compiled.rb, line 57 [r2] (raw file): lib/react_on_rails/utils.rb, line 14 [r1] (raw file): Notice I'm still capturing the output of the process, then I check the exit code, and if the exit code is a failure, then I log an error message that includes the captured output so they know what the error was. Comments from the review on Reviewable.io |
Reviewed 1 of 3 files at r2, 1 of 1 files at r3. Comments from the review on Reviewable.io |
Amazing job @robwise! Reviewed 1 of 1 files at r4. Comments from the review on Reviewable.io |
Please merge, ensure changelog updated, docs ready etc. and let me know if I should release later today. Review status: all files reviewed at latest revision, all discussions resolved, all commit checks successful. Comments from the review on Reviewable.io |
2c4e00e
to
fef644e
Compare
Latest code makes it so we only run once per suite run (assuming the suite has a feature test in it) instead of running every feature test. Also, the config now allows for specifying where webpack is outputting generated files. By default, this is Lastly, we were using unix file separators in the configuration which I changed to be platform-dependent. @justin808 I think I should just update the docs in PR 252 to include this information, right? Reviewed 3 of 4 files at r5, 1 of 1 files at r6. lib/react_on_rails/ensure_assets_compiled.rb, line 5 [r5] (raw file): lib/react_on_rails/webpack_assets_status_checker.rb, line 14 [r5] (raw file): Comments from the review on Reviewable.io |
Review status: 6 of 7 files reviewed at latest revision, 3 unresolved discussions. lib/react_on_rails/ensure_assets_compiled.rb, line 5 [r5] (raw file): lib/react_on_rails/ensure_assets_compiled.rb, line 44 [r6] (raw file): Comments from the review on Reviewable.io |
Review status: 6 of 7 files reviewed at latest revision, 7 unresolved discussions. lib/react_on_rails/ensure_assets_compiled.rb, line 16 [r6] (raw file): Just use a static calls You can make this one API:
lib/react_on_rails/ensure_assets_compiled.rb, line 21 [r6] (raw file): lib/react_on_rails/ensure_assets_compiled.rb, line 21 [r6] (raw file): lib/react_on_rails/ensure_assets_compiled.rb, line 27 [r6] (raw file):
Comments from the review on Reviewable.io |
A couple comments. Reviewed 1 of 4 files at r5. Comments from the review on Reviewable.io |
Reviewed 1 of 4 files at r5. lib/react_on_rails/ensure_assets_compiled.rb, line 16 [r6] (raw file): lib/react_on_rails/ensure_assets_compiled.rb, line 21 [r6] (raw file): lib/react_on_rails/ensure_assets_compiled.rb, line 21 [r6] (raw file): lib/react_on_rails/ensure_assets_compiled.rb, line 44 [r6] (raw file): Comments from the review on Reviewable.io |
Review status: all files reviewed at latest revision, 6 unresolved discussions. lib/react_on_rails/ensure_assets_compiled.rb, line 27 [r6] (raw file): Comments from the review on Reviewable.io |
Review status: all files reviewed at latest revision, 5 unresolved discussions. lib/react_on_rails/ensure_assets_compiled.rb, line 21 [r6] (raw file): lib/react_on_rails/ensure_assets_compiled.rb, line 27 [r6] (raw file): lib/react_on_rails/ensure_assets_compiled.rb, line 44 [r6] (raw file): Comments from the review on Reviewable.io |
Review status: all files reviewed at latest revision, 3 unresolved discussions. lib/react_on_rails/ensure_assets_compiled.rb, line 44 [r6] (raw file): Comments from the review on Reviewable.io |
lib/react_on_rails/ensure_assets_compiled.rb, line 44 [r6] (raw file): Comments from the review on Reviewable.io |
lib/react_on_rails/ensure_assets_compiled.rb, line 16 [r6] (raw file): Comments from the review on Reviewable.io |
Because there may be situations where a user is running a webpack process in watch mode in the background that will recompile the assets, it is possible that if the build time is extremely long, the user could start tests before the build completes. In this case, EnsureAssetsCompiled would start compiling the assets again even though there is already a webpack process doing that. This commit adds behavior to EnsureAssetsCompiled to check whether or not the webpack process is running in the background, and will defer the responsibility of compilation to that process, re-checking the compiled assets every second until they are up to date.
6b5ae7d
to
975b9af
Compare
* Moved files under ReactOnRails::TestHelper * Improved printouts * Fixed issue if file touched outside of what webpack detects * Refactored to reduce complexity lint error * Moved logic in TestHelper to method object
* Also require simple_cov from the spec_helper
975b9af
to
fd85038
Compare
Let's merge if this passes CI. |
Reviewed 20 of 20 files at r7. Comments from the review on Reviewable.io |
…iled Improve EnsureAssetsCompiled logic to wait for webpack process to finish
BOOM 🎉 |
Because there may be situations where a user is running a webpack
process in watch mode in the background that will recompile the
assets, it is possible that if the build time is extremely long,
the user could start their test suite before the build completes. In this case,
EnsureAssetsCompiled
would start compiling the assets again eventhough there is already a webpack process doing that.
This commit adds behavior to
EnsureAssetsCompiled
to check whetheror not the webpack process is running in the background, and, if so, will
defer the responsibility of compilation to that process, re-checking
the compiled assets every second until they are up to date.