class Inferno::DSL::ResumeTestRoute
A base class for creating routes to resume test execution upon receiving an incoming request. @api private @see Inferno::DSL::Runnable#resume_test_route
Public Class Methods
call(params)
click to toggle source
# File lib/inferno/dsl/resume_test_route.rb, line 18 def self.call(params) new.call(params) end
Public Instance Methods
call(_params)
click to toggle source
@api private
# File lib/inferno/dsl/resume_test_route.rb, line 72 def call(_params) if test_run.nil? status(500, "Unable to find test run with identifier '#{test_run_identifier}'.") return end test_runs_repo.mark_as_no_longer_waiting(test_run.id) update_result persist_request Jobs.perform(Jobs::ResumeTestRun, test_run.id) redirect_to redirect_route end
persist_request()
click to toggle source
@api private
# File lib/inferno/dsl/resume_test_route.rb, line 46 def persist_request requests_repo.create( request.to_hash.merge( test_session_id: test_run.test_session_id, result_id: waiting_result.id, name: test.incoming_request_name ) ) end
redirect_route()
click to toggle source
@api private
# File lib/inferno/dsl/resume_test_route.rb, line 57 def redirect_route "/test_sessions/#{test_run.test_session_id}##{waiting_group_id}" end
request()
click to toggle source
The incoming request
@return [Inferno::Entities::Request]
# File lib/inferno/dsl/resume_test_route.rb, line 25 def request @request ||= Inferno::Entities::Request.from_rack_env(@params.env) end
test()
click to toggle source
@api private
# File lib/inferno/dsl/resume_test_route.rb, line 62 def test @test ||= tests_repo.find(waiting_result.test_id) end
test_run()
click to toggle source
@api private
# File lib/inferno/dsl/resume_test_route.rb, line 30 def test_run @test_run ||= test_runs_repo.find_latest_waiting_by_identifier(test_run_identifier) end
update_result()
click to toggle source
@api private
# File lib/inferno/dsl/resume_test_route.rb, line 41 def update_result results_repo.pass_waiting_result(waiting_result.id) end
waiting_group_id()
click to toggle source
@api private
# File lib/inferno/dsl/resume_test_route.rb, line 67 def waiting_group_id test.parent.id end
waiting_result()
click to toggle source
@api private
# File lib/inferno/dsl/resume_test_route.rb, line 36 def waiting_result @waiting_result ||= results_repo.find_waiting_result(test_run_id: test_run.id) end