-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Preload assets before backend specs #2117
Preload assets before backend specs #2117
Conversation
We've been seeing some builds fail with "Request failed to reach server" on the first request. This happens because we have quite a few assets and it can take some time to compile them. Since this was done on the first request, this sometimes caused poltergeist to error. This commit gets sprockets-rails to preload the assets before the suite is run (if there is a feature spec included in the run). This has the added advantage of not including the time to precompile specs as part of the first spec's runtime. Running rspec --profile=10 should now be more useful in showing actually slow specs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a nice solution
Before
After
Time for the suite hasn't changed (the ~14 seconds to load assets is just moved earlier), but the first specs run in a more similar time to the other specs in the suite and won't error waiting on assets to compile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇
I will happily steal this right off the bat into our projects, as I've struggled with this for quite a while now with no good solution on the horizon. Thanks a lot! |
We've been seeing some builds fail with "Request failed to reach server" on the first request.
This happens because we have quite a few assets and it can take some time to compile them. Since this was done on the first request, this sometimes caused poltergeist to error.
This commit gets sprockets-rails to preload the assets before the suite is run (if there is a feature spec included in the run).
This has the added advantage of not including the time to precompile specs as part of the first spec's run time. Running
rspec --profile=10
should now be more useful in showing actually slow specs.Alternative to #2116