Class: RSpec::FlakeClassifier::Rerun::BisectDependencySearch::RunnerAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/flake/classifier/rerun/bisect_dependency_search.rb

Instance Method Summary collapse

Constructor Details

#initialize(runner, example_id, prior_examples, seed) ⇒ RunnerAdapter

Returns a new instance of RunnerAdapter.



52
53
54
55
56
57
# File 'lib/rspec/flake/classifier/rerun/bisect_dependency_search.rb', line 52

def initialize(runner, example_id, prior_examples, seed)
  @runner = runner
  @example_id = example_id
  @prior_examples = prior_examples
  @seed = seed
end

Instance Method Details

#original_resultsObject



59
60
61
62
63
64
# File 'lib/rspec/flake/classifier/rerun/bisect_dependency_search.rb', line 59

def original_results
  BisectRunResult.new(
    all_example_ids: @prior_examples + [@example_id],
    failed_example_ids: [@example_id]
  )
end

#run(example_ids) ⇒ Object



66
67
68
69
70
71
72
# File 'lib/rspec/flake/classifier/rerun/bisect_dependency_search.rb', line 66

def run(example_ids)
  result = @runner.run(example_ids, seed: @seed)
  BisectRunResult.new(
    all_example_ids: Array(example_ids),
    failed_example_ids: result.failed? ? [@example_id] : []
  )
end