Class: ParallelTests::RSpec::Runner
Constant Summary
collapse
- DEV_NULL =
(WINDOWS ? "NUL" : "/dev/null")
Constants inherited
from Test::Runner
Test::Runner::RuntimeLogTooSmallError
Class Method Summary
collapse
execute_command, execute_command_and_capture_output, find_results, print_command, test_env_number, tests_in_groups, tests_with_size
Class Method Details
.command_with_seed(cmd, seed) ⇒ Object
remove old seed and add new seed –seed 1234 –order rand –order rand:1234 –order random:1234
51
52
53
54
|
# File 'lib/parallel_tests/rspec/runner.rb', line 51
def command_with_seed(cmd, seed)
clean = remove_command_arguments(cmd, '--seed', '--order')
[*clean, '--seed', seed]
end
|
.default_test_folder ⇒ Object
28
29
30
|
# File 'lib/parallel_tests/rspec/runner.rb', line 28
def default_test_folder
"spec"
end
|
.determine_executable ⇒ Object
.line_is_result?(line) ⇒ Boolean
42
43
44
|
# File 'lib/parallel_tests/rspec/runner.rb', line 42
def line_is_result?(line)
line =~ /\d+ examples?, \d+ failures?/
end
|
.run_tests(test_files, process_number, num_processes, options) ⇒ Object
9
10
11
12
|
# File 'lib/parallel_tests/rspec/runner.rb', line 9
def run_tests(test_files, process_number, num_processes, options)
cmd = [*executable, *options[:test_options], *color, *spec_opts, *test_files]
execute_command(cmd, process_number, num_processes, options)
end
|
.runtime_log ⇒ Object
24
25
26
|
# File 'lib/parallel_tests/rspec/runner.rb', line 24
def runtime_log
"tmp/parallel_runtime_rspec.log"
end
|
.summarize_results(results) ⇒ Object
Summarize results from threads and colorize results based on failure and pending counts.
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# File 'lib/parallel_tests/rspec/runner.rb', line 58
def summarize_results(results)
text = super
return text unless $stdout.tty?
sums = sum_up_results(results)
color =
if sums['failure'] > 0
31 elsif sums['pending'] > 0
33 else
32 end
"\e[#{color}m#{text}\e[0m"
end
|
.test_file_name ⇒ Object
32
33
34
|
# File 'lib/parallel_tests/rspec/runner.rb', line 32
def test_file_name
"spec"
end
|
.test_suffix ⇒ Object
used to find all _spec.rb files supports also feature files used by rspec turnip extension
38
39
40
|
# File 'lib/parallel_tests/rspec/runner.rb', line 38
def test_suffix
/(_spec\.rb|\.feature)$/
end
|