class RSpec::Core::Bisect::Server
started by the bisect process.
A DRb server that receives run results from a separate RSpec process
@private
def self.run
def self.run server = new server.start yield server ensure server.stop end
def capture_run_results(files_or_directories_to_run=[], expected_failures=[])
def capture_run_results(files_or_directories_to_run=[], expected_failures=[]) self.expected_failures = expected_failures self.files_or_directories_to_run = files_or_directories_to_run self.latest_run_results = nil run_output = yield if latest_run_results.nil? || latest_run_results.all_example_ids.empty? raise_bisect_failed(run_output) end latest_run_results end
def drb_port
def drb_port @drb_port ||= Integer(@drb.uri[/\d+$/]) end
def raise_bisect_failed(run_output)
def raise_bisect_failed(run_output) raise BisectFailedError, "Failed to get results from the spec " \ "run. Spec run output:\n\n#{run_output}" end
def start
def start # Only allow remote DRb requests from this machine. DRb.install_acl ACL.new(%w[ deny all allow localhost allow 127.0.0.1 ]) # We pass `nil` as the first arg to allow it to pick a DRb port. @drb = DRb.start_service(nil, self) end
def stop
def stop @drb.stop_service end