inferno_core 0.4.37.dev → 0.4.37
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/inferno/dsl/resume_test_route.rb +20 -59
- data/lib/inferno/dsl/runnable.rb +1 -1
- data/lib/inferno/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fad068333ba8fce867afba323937728da89231ded560129675318866059975a
|
4
|
+
data.tar.gz: d231cf80975b781b0584c5bb2b4677e1493eaba2fa6469ffca490e113d46ba08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34c983546c7ea05443d9edde97e59d9c9dab2e1848271eefb4f888ff58cafc1219541de91634250ae4831162689cdd9e1e8f043735bc0fe6e495c86eb3a1bf41
|
7
|
+
data.tar.gz: 2208622633268affb624426a91f4d6b7feed45cd7eac97dbad7c750c22169d7c08c5297fa96f8be86d13785faccf9966ad328b700528bcce0d2b8c6ba9cf97d1
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
require_relative 'suite_endpoint'
|
2
2
|
|
3
3
|
module Inferno
|
4
4
|
module DSL
|
@@ -6,58 +6,47 @@ module Inferno
|
|
6
6
|
# an incoming request.
|
7
7
|
# @private
|
8
8
|
# @see Inferno::DSL::Runnable#resume_test_route
|
9
|
-
class ResumeTestRoute <
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
]
|
16
|
-
|
17
|
-
def self.call(...)
|
18
|
-
new.call(...)
|
9
|
+
class ResumeTestRoute < SuiteEndpoint
|
10
|
+
# The incoming request
|
11
|
+
#
|
12
|
+
# @return [Inferno::Entities::Request]
|
13
|
+
def request
|
14
|
+
@request ||= Inferno::Entities::Request.from_hanami_request(req)
|
19
15
|
end
|
20
16
|
|
21
17
|
# @private
|
22
|
-
def
|
23
|
-
|
18
|
+
def test_run_identifier
|
19
|
+
@test_run_identifier ||= instance_exec(request, &test_run_identifier_block)
|
24
20
|
end
|
25
21
|
|
26
22
|
# @private
|
27
23
|
def tags
|
28
|
-
self.class.singleton_class.instance_variable_get(:@tags)
|
24
|
+
self.class.singleton_class.instance_variable_get(:@tags) || []
|
29
25
|
end
|
30
26
|
|
31
27
|
# @private
|
32
|
-
def
|
33
|
-
|
28
|
+
def update_result
|
29
|
+
results_repo.update_result(result.id, new_result)
|
34
30
|
end
|
35
31
|
|
36
32
|
# @private
|
37
|
-
def
|
38
|
-
|
33
|
+
def make_response
|
34
|
+
res.redirect_to redirect_route(test_run, test)
|
39
35
|
end
|
40
36
|
|
41
37
|
# @private
|
42
|
-
def
|
43
|
-
|
38
|
+
def name
|
39
|
+
test.config.request_name(test.incoming_request_name)
|
44
40
|
end
|
45
41
|
|
46
42
|
# @private
|
47
|
-
def
|
48
|
-
|
43
|
+
def test_run_identifier_block
|
44
|
+
self.class.singleton_class.instance_variable_get(:@test_run_identifier_block)
|
49
45
|
end
|
50
46
|
|
51
47
|
# @private
|
52
|
-
def
|
53
|
-
|
54
|
-
request.to_hash.merge(
|
55
|
-
test_session_id: test_run.test_session_id,
|
56
|
-
result_id: waiting_result.id,
|
57
|
-
name: test.config.request_name(test.incoming_request_name),
|
58
|
-
tags:
|
59
|
-
)
|
60
|
-
)
|
48
|
+
def new_result
|
49
|
+
self.class.singleton_class.instance_variable_get(:@new_result)
|
61
50
|
end
|
62
51
|
|
63
52
|
# @private
|
@@ -65,38 +54,10 @@ module Inferno
|
|
65
54
|
"#{Application['base_url']}/test_sessions/#{test_run.test_session_id}##{resume_ui_at_id(test_run, test)}"
|
66
55
|
end
|
67
56
|
|
68
|
-
# @private
|
69
|
-
def find_test(waiting_result)
|
70
|
-
tests_repo.find(waiting_result.test_id)
|
71
|
-
end
|
72
|
-
|
73
57
|
# @private
|
74
58
|
def resume_ui_at_id(test_run, test)
|
75
59
|
test_run.test_suite_id || test_run.test_group_id || test.parent.id
|
76
60
|
end
|
77
|
-
|
78
|
-
# @private
|
79
|
-
def handle(req, res)
|
80
|
-
request = Inferno::Entities::Request.from_hanami_request(req)
|
81
|
-
|
82
|
-
test_run_identifier = instance_exec(request, &test_run_identifier_block)
|
83
|
-
|
84
|
-
test_run = find_test_run(test_run_identifier)
|
85
|
-
|
86
|
-
halt 500, "Unable to find test run with identifier '#{test_run_identifier}'." if test_run.nil?
|
87
|
-
|
88
|
-
test_runs_repo.mark_as_no_longer_waiting(test_run.id)
|
89
|
-
|
90
|
-
waiting_result = find_waiting_result(test_run)
|
91
|
-
test = find_test(waiting_result)
|
92
|
-
|
93
|
-
update_result(waiting_result)
|
94
|
-
persist_request(request, test_run, waiting_result, test)
|
95
|
-
|
96
|
-
Jobs.perform(Jobs::ResumeTestRun, test_run.id)
|
97
|
-
|
98
|
-
res.redirect_to redirect_route(test_run, test)
|
99
|
-
end
|
100
61
|
end
|
101
62
|
end
|
102
63
|
end
|
data/lib/inferno/dsl/runnable.rb
CHANGED
@@ -343,7 +343,7 @@ module Inferno
|
|
343
343
|
route_class = Class.new(ResumeTestRoute) do |klass|
|
344
344
|
klass.singleton_class.instance_variable_set(:@test_run_identifier_block, block)
|
345
345
|
klass.singleton_class.instance_variable_set(:@tags, tags)
|
346
|
-
klass.singleton_class.instance_variable_set(:@
|
346
|
+
klass.singleton_class.instance_variable_set(:@new_result, result)
|
347
347
|
end
|
348
348
|
|
349
349
|
route(method, path, route_class)
|
data/lib/inferno/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inferno_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.37
|
4
|
+
version: 0.4.37
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen MacVicar
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-05-
|
13
|
+
date: 2024-05-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -755,7 +755,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
755
755
|
- !ruby/object:Gem::Version
|
756
756
|
version: '0'
|
757
757
|
requirements: []
|
758
|
-
rubygems_version: 3.
|
758
|
+
rubygems_version: 3.3.7
|
759
759
|
signing_key:
|
760
760
|
specification_version: 4
|
761
761
|
summary: Inferno Core is an open source tool for testing data exchanges enabled by
|