Class: ParallelTests::Cucumber::Runner

Inherits:
Gherkin::Runner show all
Defined in:
lib/parallel_tests/cucumber/runner.rb

Constant Summary collapse

SCENARIOS_RESULTS_BOUNDARY_REGEX =
/^(Failing|Flaky) Scenarios:$/.freeze
SCENARIO_REGEX =
%r{^cucumber features/.+:\d+}.freeze

Constants inherited from Test::Runner

Test::Runner::RuntimeLogTooSmallError

Class Method Summary collapse

Methods inherited from Gherkin::Runner

cucumber_opts, determine_executable, profile_from_config, run_tests, runtime_log, runtime_logging, test_file_name, test_suffix, tests_in_groups

Methods inherited from Test::Runner

execute_command, execute_command_and_capture_output, find_results, print_command, run_tests, runtime_log, test_env_number, test_file_name, test_suffix, tests_in_groups, tests_with_size

Class Method Details

.command_with_seed(cmd, seed) ⇒ Object



37
38
39
40
# File 'lib/parallel_tests/cucumber/runner.rb', line 37

def command_with_seed(cmd, seed)
  clean = remove_command_arguments(cmd, '--order')
  [*clean, '--order', "random:#{seed}"]
end

.default_test_folderObject



15
16
17
# File 'lib/parallel_tests/cucumber/runner.rb', line 15

def default_test_folder
  'features'
end

.line_is_result?(line) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/parallel_tests/cucumber/runner.rb', line 19

def line_is_result?(line)
  super || line =~ SCENARIO_REGEX || line =~ SCENARIOS_RESULTS_BOUNDARY_REGEX
end

.nameObject



11
12
13
# File 'lib/parallel_tests/cucumber/runner.rb', line 11

def name
  'cucumber'
end

.summarize_results(results) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/parallel_tests/cucumber/runner.rb', line 23

def summarize_results(results)
  output = []

  scenario_groups = results.slice_before(SCENARIOS_RESULTS_BOUNDARY_REGEX).group_by(&:first)
  scenario_groups.each do |header, group|
    scenarios = group.flatten.grep(SCENARIO_REGEX)
    output << ([header] + scenarios).join("\n") if scenarios.any?
  end

  output << super

  output.join("\n\n")
end