Class: RunscopeCi::RsTest
- Inherits:
-
Object
- Object
- RunscopeCi::RsTest
- Includes:
- HTTParty
- Defined in:
- lib/runscope_ci.rb
Instance Attribute Summary collapse
-
#agent ⇒ Object
readonly
Returns the value of attribute agent.
-
#assertions_defined ⇒ Object
readonly
Returns the value of attribute assertions_defined.
-
#assertions_failed ⇒ Object
readonly
Returns the value of attribute assertions_failed.
-
#assertions_passed ⇒ Object
readonly
Returns the value of attribute assertions_passed.
-
#bucket_key ⇒ Object
readonly
Returns the value of attribute bucket_key.
-
#environment_id ⇒ Object
readonly
Returns the value of attribute environment_id.
-
#environment_name ⇒ Object
readonly
Returns the value of attribute environment_name.
-
#finished_at ⇒ Object
readonly
Returns the value of attribute finished_at.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#requests ⇒ Object
readonly
Returns the value of attribute requests.
-
#requests_executed ⇒ Object
readonly
Returns the value of attribute requests_executed.
-
#result ⇒ Object
Returns the value of attribute result.
-
#scripts_defined ⇒ Object
readonly
Returns the value of attribute scripts_defined.
-
#scripts_failed ⇒ Object
readonly
Returns the value of attribute scripts_failed.
-
#scripts_passed ⇒ Object
readonly
Returns the value of attribute scripts_passed.
-
#started_at ⇒ Object
readonly
Returns the value of attribute started_at.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#test_id ⇒ Object
readonly
Returns the value of attribute test_id.
-
#test_name ⇒ Object
readonly
Returns the value of attribute test_name.
-
#test_run_id ⇒ Object
readonly
Returns the value of attribute test_run_id.
-
#test_run_url ⇒ Object
readonly
Returns the value of attribute test_run_url.
-
#test_url ⇒ Object
readonly
Returns the value of attribute test_url.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#variables ⇒ Object
readonly
Returns the value of attribute variables.
-
#variables_defined ⇒ Object
readonly
Returns the value of attribute variables_defined.
-
#variables_failed ⇒ Object
readonly
Returns the value of attribute variables_failed.
-
#variables_passed ⇒ Object
readonly
Returns the value of attribute variables_passed.
Instance Method Summary collapse
-
#initialize(run) ⇒ RsTest
constructor
expects parsed json ‘run’ block from Runscope API response like trigger bucket call.
- #result_detail ⇒ Object
Constructor Details
#initialize(run) ⇒ RsTest
expects parsed json ‘run’ block from Runscope API response like trigger bucket call
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/runscope_ci.rb', line 56 def initialize(run) @status = run["status"] @environment_id = run["environment_id"] @bucket_key = run["bucket_key"] @variables = run["variables"] @agent = run["agent"] @test_name = run["test_name"] @test_id = run["test_id"] @url = run["url"] @region = run["region"] @environment_name = run["environment_name"] @test_url = run["test_url"] @test_run_url = run["test_run_url"] @test_run_id = run["test_run_id"] end |
Instance Attribute Details
#agent ⇒ Object (readonly)
Returns the value of attribute agent.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def agent @agent end |
#assertions_defined ⇒ Object (readonly)
Returns the value of attribute assertions_defined.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def assertions_defined @assertions_defined end |
#assertions_failed ⇒ Object (readonly)
Returns the value of attribute assertions_failed.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def assertions_failed @assertions_failed end |
#assertions_passed ⇒ Object (readonly)
Returns the value of attribute assertions_passed.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def assertions_passed @assertions_passed end |
#bucket_key ⇒ Object (readonly)
Returns the value of attribute bucket_key.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def bucket_key @bucket_key end |
#environment_id ⇒ Object (readonly)
Returns the value of attribute environment_id.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def environment_id @environment_id end |
#environment_name ⇒ Object (readonly)
Returns the value of attribute environment_name.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def environment_name @environment_name end |
#finished_at ⇒ Object (readonly)
Returns the value of attribute finished_at.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def finished_at @finished_at end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def region @region end |
#requests ⇒ Object (readonly)
Returns the value of attribute requests.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def requests @requests end |
#requests_executed ⇒ Object (readonly)
Returns the value of attribute requests_executed.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def requests_executed @requests_executed end |
#result ⇒ Object
Returns the value of attribute result.
53 54 55 |
# File 'lib/runscope_ci.rb', line 53 def result @result end |
#scripts_defined ⇒ Object (readonly)
Returns the value of attribute scripts_defined.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def scripts_defined @scripts_defined end |
#scripts_failed ⇒ Object (readonly)
Returns the value of attribute scripts_failed.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def scripts_failed @scripts_failed end |
#scripts_passed ⇒ Object (readonly)
Returns the value of attribute scripts_passed.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def scripts_passed @scripts_passed end |
#started_at ⇒ Object (readonly)
Returns the value of attribute started_at.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def started_at @started_at end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def status @status end |
#test_id ⇒ Object (readonly)
Returns the value of attribute test_id.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def test_id @test_id end |
#test_name ⇒ Object (readonly)
Returns the value of attribute test_name.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def test_name @test_name end |
#test_run_id ⇒ Object (readonly)
Returns the value of attribute test_run_id.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def test_run_id @test_run_id end |
#test_run_url ⇒ Object (readonly)
Returns the value of attribute test_run_url.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def test_run_url @test_run_url end |
#test_url ⇒ Object (readonly)
Returns the value of attribute test_url.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def test_url @test_url end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def url @url end |
#variables ⇒ Object (readonly)
Returns the value of attribute variables.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def variables @variables end |
#variables_defined ⇒ Object (readonly)
Returns the value of attribute variables_defined.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def variables_defined @variables_defined end |
#variables_failed ⇒ Object (readonly)
Returns the value of attribute variables_failed.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def variables_failed @variables_failed end |
#variables_passed ⇒ Object (readonly)
Returns the value of attribute variables_passed.
49 50 51 |
# File 'lib/runscope_ci.rb', line 49 def variables_passed @variables_passed end |
Instance Method Details
#result_detail ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/runscope_ci.rb', line 72 def result_detail res = self.class.get("/buckets/#{@bucket_key}/tests/#{@test_id}/results/#{@test_run_id}", headers: {"Authorization" => "Bearer #{access_token}"}) raise "Received error #{res.code} #{res.message} #{res.body}" unless res.code == 200 result = JSON.parse(res.body)["data"] @started_at = result["started_at"] @finished_at = result["finished_at"] @scripts_defined = result["scripts_defined"] @assertions_failed = result["assertions_failed"] @variables_failed = result["variables_failed"] @variables_passed = result["variables_passed"] @result = result["result"] @requests_executed = result["requests_executed"] @assertions_defined = result["assertions_defined"] @assertions_passed = result["assertions_passed"] @scripts_passed = result["scripts_passed"] @scripts_failed = result["scripts_failed"] @variables_defined = result["variables_defined"] @requests = result["requests"] self end |