Class: Cyrun::Runner
Instance Attribute Summary collapse
-
#collector ⇒ Object
readonly
Returns the value of attribute collector.
-
#group_builder ⇒ Object
readonly
Returns the value of attribute group_builder.
-
#iterations ⇒ Object
readonly
Returns the value of attribute iterations.
-
#max_retries ⇒ Object
readonly
Returns the value of attribute max_retries.
-
#overall_results ⇒ Object
readonly
Returns the value of attribute overall_results.
-
#screenshots_directory ⇒ Object
readonly
Returns the value of attribute screenshots_directory.
-
#success ⇒ Object
readonly
Returns the value of attribute success.
-
#task_runner ⇒ Object
readonly
Returns the value of attribute task_runner.
Instance Method Summary collapse
-
#initialize(base_directory, pattern, screenshots_pattern, screenshots_directory, group_size, npm_task_name, max_retries: nil, iterations: nil) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
- #store_results(results_directory) ⇒ Object
Methods included from Logging
Constructor Details
#initialize(base_directory, pattern, screenshots_pattern, screenshots_directory, group_size, npm_task_name, max_retries: nil, iterations: nil) ⇒ Runner
Returns a new instance of Runner.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/cyrun/runner.rb', line 12 def initialize(base_directory, pattern, screenshots_pattern, screenshots_directory, group_size, npm_task_name, max_retries: nil, iterations: nil) @collector = SpecCollector.new(base_directory, npm_task_name, [pattern]) @group_builder = GroupBuilder.new(group_size) @task_runner = TaskRunner.new(screenshots_pattern) @overall_results = SpecGroupExecutionResult.create_empty @max_retries = max_retries @iterations = iterations @screenshots_directory = screenshots_directory @success = true end |
Instance Attribute Details
#collector ⇒ Object (readonly)
Returns the value of attribute collector.
9 10 11 |
# File 'lib/cyrun/runner.rb', line 9 def collector @collector end |
#group_builder ⇒ Object (readonly)
Returns the value of attribute group_builder.
9 10 11 |
# File 'lib/cyrun/runner.rb', line 9 def group_builder @group_builder end |
#iterations ⇒ Object (readonly)
Returns the value of attribute iterations.
9 10 11 |
# File 'lib/cyrun/runner.rb', line 9 def iterations @iterations end |
#max_retries ⇒ Object (readonly)
Returns the value of attribute max_retries.
9 10 11 |
# File 'lib/cyrun/runner.rb', line 9 def max_retries @max_retries end |
#overall_results ⇒ Object (readonly)
Returns the value of attribute overall_results.
9 10 11 |
# File 'lib/cyrun/runner.rb', line 9 def overall_results @overall_results end |
#screenshots_directory ⇒ Object (readonly)
Returns the value of attribute screenshots_directory.
9 10 11 |
# File 'lib/cyrun/runner.rb', line 9 def screenshots_directory @screenshots_directory end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
9 10 11 |
# File 'lib/cyrun/runner.rb', line 9 def success @success end |
#task_runner ⇒ Object (readonly)
Returns the value of attribute task_runner.
9 10 11 |
# File 'lib/cyrun/runner.rb', line 9 def task_runner @task_runner end |
Instance Method Details
#run ⇒ Object
24 25 26 27 28 29 |
# File 'lib/cyrun/runner.rb', line 24 def run collect_specs run_next_group while group_builder.any? overall_results end |
#store_results(results_directory) ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/cyrun/runner.rb', line 31 def store_results(results_directory) latest_results = overall_results.latest_results invalid_results = latest_results.select { |result| result.result_filename.nil? } valid_results = latest_results - invalid_results copy_result_files valid_results, results_directory invalid_results.empty? end |