-
Notifications
You must be signed in to change notification settings - Fork 243
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
Parallelising builds: Update info about knapsack gem #99
Conversation
(also with Docker) and knapsack_pro.
Thanks @ArturT! I've done some testing before we merge this in, and I have some problems getting |
One of knapsack_pro users found the problem with If you will encounter a problem with stack level too deep then you may want to ensure you load your dependencies only once in
|
I've updated example of |
@ArturT ah, I tried that but couldn't get it working. I've made some more adjustments to make sure the env check happens between the I'm running some more tests now… and I'd love to fix the underlying cause inside Do you know what part of knapsack might be causing that, so I can dig some more? |
I was looking at the Here is how I load RSpec Probably the problem is with RSpec that may load rails_helper.rb/spec_helper.rb again. The workaround with |
I sent you more details over the Buildkite Slack. Any chance you could jump on? Or support email better? |
@toolmantim You can send me details on my email. I will have more time to dig it later this evening (I'm in CEST). |
@ArturT I have a recreated the smallest possible example to show the error: https://gist.github.com/toolmantim/2a1d73fd2f8cca15f38255995af035a2 I hope that helps to figure out what's going on! |
I found root problem. Here is I will try to find some workaround how to solve it. |
Perhaps this would do it? diff --git a/lib/capybara-screenshot/rspec.rb b/lib/capybara-screenshot/rspec.rb
index cc51fb0..fa60d0e 100644
--- a/lib/capybara-screenshot/rspec.rb
+++ b/lib/capybara-screenshot/rspec.rb
@@ -88,6 +88,7 @@ RSpec.configure do |config|
if Capybara::Screenshot::RSpec.add_link_to_screenshot_for_failed_examples
RSpec.configuration.formatters.each do |formatter|
next unless (reporter_module = Capybara::Screenshot::RSpec::REPORTERS[formatter.class.to_s])
+ next if formatter.singleton_class.included_modules.include?(reporter_module)
formatter.singleton_class.send :include, reporter_module
end
end |
Perfect! It works. I will create PR for capybara-screenshot. |
Awesome! |
before(:suite) is run multiple times because of using RSpec::Core::Runner Related issue: buildkite/docs#99
I've created PR to capybara-screenshot. mattheworiordan/capybara-screenshot#205 |
Awesome! I've just tested and it works AOK. I also updated the gist: Will test that out on our app now. |
I update the documentation for knapsack_pro in Queue Mode section and in FAQ. I also updated examples rails apps: This should be good enough solution for now until capybara-screenshot fix is merged and a new gem version released. Then I will update docs for knapsack_pro to ensure the proper version of capybara-screenshot is in use. |
before(:suite) is run multiple times because of using RSpec::Core::Runner Related issue: buildkite/docs#99
@toolmantim It seems capybara-screenshot releases are not that often. I think we could merge this PR and I will keep an eye on the capybara-screenshot and when the release will be published then I will update documentation in buildkite-rails-parallel-example repos to point directly to capybara-screenshot version >= with our fix. |
Thanks @ArturT. This PR needs some changes before merging. We'll get to it shortly, I promise! |
@toolmantim Please let me know if I need to change anything in this PR or here buildkite/example-pipelines#4 |
Thanks Artur! I've just updated it to match the rest of the style of our documentation, and will merge it now :) Sorry for the wait. |
@toolmantim Looks awesome. Thanks! |
Thanks @ArturT. I'm not sure about merging that, because it's the only example that requires a commercial tool, and might be a little confusing. I wonder if we should simply update the Readme on the existing Knapsack example repo to point to the two Knapsack Pro example pipelines? |
Sorry for sitting on that one for a while… I had to figure out what to do! That's been fixed up on the other PR now. |
Sure 👍 |
I added a few more tests runners in knapsack gem.
I also worked with a few companies with large projects. They use Buildkite and knapsack_pro gem. Often people ask me how to run a project with knapsack_pro and what CI provider I recommend and my first choice is Buildkite because it can be really fast comparing to other solutions.
I prepared article with a simple introduction to Buildkite:
http://docs.knapsackpro.com/2017/auto-balancing-7-hours-tests-between-100-parallel-jobs-on-ci-buildkite-example
and examples of configured Ruby/Rails project + knapack_pro with and without Docker:
Here is related PR for list of pipelines:
buildkite/example-pipelines#4