production - for test segments of their 15 million engaged users @mrkn (Kenta Murata), @shingo (Shingo Morita) http://www.flickr.com/photos/june29/3396011694/ http://www.confreaks.com/events/railsconf2012 https://speakerdeck.com/u/mrkn/p/chanko Sunday, September 16, 12
8 hours == 480 min The maximum count of deploy 480 / 2N == 240 / N N : The CI waiting time to deploy 40 times 240 / 40 == 6 min Sunday, September 16, 12
8 hours == 480 min The maximum count of deploy 480 / 2N == 240 / N N : The CI waiting time to deploy 40 times 240 / 40 == 6 min Sunday, September 16, 12
8 hours == 480 min The maximum count of deploy 480 / 2N == 240 / N N : The CI waiting time to deploy 40 times 240 / 40 == 6 min Sunday, September 16, 12
8 hours == 480 min The maximum count of deploy 480 / 2N == 240 / N N : The CI waiting time to deploy 40 times 240 / 40 == 6 min Sunday, September 16, 12
should be available for simultaneous executions • Developer-testing should be fast • The system should be able to scale out for increasing tests Sunday, September 16, 12
almost same execution time based on the last execution time log 2. Executing RSpec for each the group on the remote workers via ssh 3. Results of RSpec is collected via pipe, and displayed so that the user can easily distinguish which worker makes the results. How to distribute Sunday, September 16, 12
varied. • Runtime conditions of servers affected the execution times. • I retired the way to divide spec les into groups before executing RSpec. Sunday, September 16, 12
processing. • Producers produce tasks and enqueue them into a queue. • Consumers dequeue tasks from the queue, and processes them. Sunday, September 16, 12
the others. • Fast workers process much more tasks than the others. • As a result the execution times of workers are almost same. Sunday, September 16, 12
and consumers communicate with each other via a queue represented by Rinda::TupleSpace • On workers, dRuby gateway is executed via ssh, and the gateway process launches each consumer DRbObject. Sunday, September 16, 12
a queue, a TupleSpace, and execute it. • I want to avoid spending time for generating a new process and loading and initializing Rails environment by executing “rspec” command. • I need to use rspec abnormally. Sunday, September 16, 12
@configuration.run_hook(:before, :suite) @world.example_groups.ordered.map {|g| g.run(reporter) }.all? ? 0 : @configuration.failure_exit_code ensure @configuration.run_hook(:after, :suite) end end end Sunday, September 16, 12
@configuration.run_hook(:before, :suite) @world.example_groups.ordered.map {|g| g.run(reporter) }.all? ? 0 : @configuration.failure_exit_code ensure @configuration.run_hook(:after, :suite) end end end Sunday, September 16, 12
@configuration.run_hook(:before, :suite) @world.example_groups.ordered.map {|g| g.run(reporter) }.all? ? 0 : @configuration.failure_exit_code ensure @configuration.run_hook(:after, :suite) end end end Sunday, September 16, 12
world end # RSpec::Core::Runner.run def run(...) ... CommandLine.new(options).run(err, out) ... end # RSpec.world def self.world @world ||= RSpec::Core::World.new end Sunday, September 16, 12
run example groups only de ned in the spec le, and clear the all example groups from the global RSpec environment. • RSpec::Core::World#clear does it. Sunday, September 16, 12
mechanisms of distributed RSpec in COOKPAD are introduced • My current attempts don’t get in time. • remote_spec.gem is coming soon. Sunday, September 16, 12