31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
# File 'lib/minitest/distributed/configuration.rb', line 31
def from_command_line_options(opts, options)
configuration = from_env
configuration.progress = options[:io].tty?
opts.on("--coordinator=URI", "The URI pointing to the coordinator") do |uri|
configuration.coordinator_uri = URI.parse(uri)
end
opts.on("--test-timeout=TIMEOUT", "The maximum run time for a single test in seconds") do |timeout|
configuration.test_timeout_seconds = Float(timeout)
end
opts.on("--max-attempts=ATTEMPTS", "The maximum number of attempts to run a test") do |attempts|
configuration.max_attempts = Integer(attempts)
end
opts.on("--test-batch-size=NUMBER", "The number of tests to process per batch") do |batch_size|
configuration.test_batch_size = Integer(batch_size)
end
opts.on("--max-failures=FAILURES", "The maximum allowed failure before aborting a run") do |failures|
configuration.max_failures = Integer(failures)
end
opts.on("--run-id=ID", "The ID for this run shared between coordinated workers") do |id|
configuration.run_id = id
end
opts.on("--worker-id=ID", "The unique ID for this worker") do |id|
configuration.worker_id = id
end
opts.on(
"--[no-]retry-failures", "Retry failed and errored tests from a previous run attempt " \
"with the same run ID (default: enabled)"
) do |enabled|
configuration.retry_failures = enabled
end
opts.on("--[no-]progress", "Show progress during the test run") do |enabled|
configuration.progress = enabled
end
opts.on("--exclude-file=FILE_PATH", "Specify a file of tests to be excluded from running") do |file_path|
configuration.exclude_file = file_path
end
opts.on("--include-file=FILE_PATH", "Specify a file of tests to be included in the test run") do |file_path|
configuration.include_file = file_path
end
opts.on("--[no-]shuffle-suites", "Shuffle test suites as well") do |enabled|
configuration.shuffle_suites = enabled
end
configuration
end
|