Class: CemAcpt::Runner
- Inherits:
-
Object
- Object
- CemAcpt::Runner
- Includes:
- Logging
- Defined in:
- lib/cem_acpt/runner.rb
Overview
Runner is a class that runs a single acceptance test suite on a single node. It is responsible for managing the lifecycle of the test suite and reporting the results back to the main thread. Runner objects are created by the RunHandler and then, when started, execute their logic in a thread.
Instance Attribute Summary collapse
-
#spec_exit_code ⇒ Object
readonly
Returns the value of attribute spec_exit_code.
Instance Method Summary collapse
-
#exit ⇒ Object
Runner thread exits and runner node is destroyed, if it exists.
-
#initialize(node, conf, tdata, node_inv, module_pkg_path, results) ⇒ Runner
constructor
A new instance of Runner.
-
#join(timeout = 600) ⇒ Object
Joins the runner thread.
-
#kill ⇒ Object
Runner thread is killed and runner node is destroyed, if it exists.
-
#start ⇒ Object
Starts the runner thread and runs the lifecycle stages of the acceptance test suite.
Methods included from Logging
current_log_config, #current_log_config, current_log_format, current_log_level, #current_log_level, included, #logger, new_log_config, #new_log_config, new_log_formatter, new_log_level, #new_log_level
Constructor Details
#initialize(node, conf, tdata, node_inv, module_pkg_path, results) ⇒ Runner
Returns a new instance of Runner.
196 197 198 199 200 201 202 203 204 205 |
# File 'lib/cem_acpt/runner.rb', line 196 def initialize(node, conf, tdata, node_inv, module_pkg_path, results) @node = node @conf = conf @tdata = tdata @node_inv = node_inv @module_pkg_path = module_pkg_path @results = results @spec_exit_code = 0 validate! end |
Instance Attribute Details
#spec_exit_code ⇒ Object (readonly)
Returns the value of attribute spec_exit_code.
188 189 190 |
# File 'lib/cem_acpt/runner.rb', line 188 def spec_exit_code @spec_exit_code end |
Instance Method Details
#exit ⇒ Object
Runner thread exits and runner node is destroyed, if it exists.
226 227 228 229 |
# File 'lib/cem_acpt/runner.rb', line 226 def exit @thread.exit @node&.destroy end |
#join(timeout = 600) ⇒ Object
Joins the runner thread.
221 222 223 |
# File 'lib/cem_acpt/runner.rb', line 221 def join(timeout = 600) @thread.join(timeout) end |
#kill ⇒ Object
Runner thread is killed and runner node is destroyed, if it exists.
232 233 234 235 |
# File 'lib/cem_acpt/runner.rb', line 232 def kill @thread.kill @node&.destroy end |
#start ⇒ Object
Starts the runner thread and runs the lifecycle stages of the acceptance test suite.
209 210 211 212 213 214 215 216 217 |
# File 'lib/cem_acpt/runner.rb', line 209 def start logger.info("Starting test suite for #{@node.node_name}") @thread = Thread.new do provision bootstrap run_tests destroy end end |