Class: TestExecutor
- Inherits:
-
Object
- Object
- TestExecutor
- Defined in:
- lib/gitarro/backend.rb
Overview
This is a private class, which has the task to execute/run tests called by Backend
Instance Method Summary collapse
- #export_pr_data(pr) ⇒ Object
-
#initialize(options) ⇒ TestExecutor
constructor
A new instance of TestExecutor.
-
#pr_test(pr) ⇒ Object
this will clone the repo and execute the tests.
-
#run_script ⇒ Object
run validation script for validating the PR.
Constructor Details
#initialize(options) ⇒ TestExecutor
Returns a new instance of TestExecutor.
78 79 80 81 82 83 84 85 86 |
# File 'lib/gitarro/backend.rb', line 78 def initialize() @options = @options.each do |key, value| instance_variable_set("@#{key}", value) self.class.send(:attr_accessor, key) end Octokit.auto_paginate = true @client = Octokit::Client.new(netrc: true) end |
Instance Method Details
#export_pr_data(pr) ⇒ Object
101 102 103 104 105 |
# File 'lib/gitarro/backend.rb', line 101 def export_pr_data(pr) export_pr_variables(pr) export_pr_data_to_simple_file(pr) export_pr_data_to_json_file(pr) end |
#pr_test(pr) ⇒ Object
this will clone the repo and execute the tests
89 90 91 92 93 |
# File 'lib/gitarro/backend.rb', line 89 def pr_test(pr) clone_repo(@noshallow, pr) # do valid tests and return the result run_script end |
#run_script ⇒ Object
run validation script for validating the PR.
96 97 98 99 |
# File 'lib/gitarro/backend.rb', line 96 def run_script puts `#{@test_file}` $CHILD_STATUS.exitstatus.nonzero? ? 'failure' : 'success' end |