inferno_core 0.1.1 → 0.1.3.pre2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/inferno/apps/web/controllers/test_runs/create.rb +2 -0
- data/lib/inferno/apps/web/controllers/test_runs/destroy.rb +39 -0
- data/lib/inferno/apps/web/router.rb +1 -1
- data/lib/inferno/dsl/configurable.rb +4 -0
- data/lib/inferno/dsl/fhir_validation.rb +1 -1
- data/lib/inferno/dsl/oauth_credentials.rb +1 -1
- data/lib/inferno/dsl/runnable.rb +6 -5
- data/lib/inferno/entities/test_run.rb +1 -1
- data/lib/inferno/public/72a5cd989e6aea904540824ec865a0f8.png +0 -0
- data/lib/inferno/public/assets.json +2 -2
- data/lib/inferno/public/bundle.js +15 -15
- data/lib/inferno/public/bundle.js.LICENSE.txt +1 -1
- data/lib/inferno/repositories/results.rb +4 -0
- data/lib/inferno/repositories/session_data.rb +1 -1
- data/lib/inferno/repositories/test_runs.rb +8 -0
- data/lib/inferno/test_runner.rb +8 -1
- data/lib/inferno/version.rb +1 -1
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9600a6e94a1bcd029d0bbce4f3640cae2d277cee01faf89545d3ffcd3906393
|
4
|
+
data.tar.gz: 8f9904f1c6580f1767924392e29c05388c6283204fe057cbc8600f929b3a8f57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bedf3e5026184977b81b8986da99b6a8d3b6c8f835543dc4783bd8f9d2e0f413b7ae1b1309062e5f57e97778c31242732aa30725faac9c5de46209e8c0ee161
|
7
|
+
data.tar.gz: 177a0b5f06d5a8dd6d636d496a74766f5f186047d10e79361c96d3be237fb45c2cc05065ca41d5dc739919d594ad094fb910b1b3a89d02bf074cfc227259399c
|
@@ -21,6 +21,8 @@ module Inferno
|
|
21
21
|
return
|
22
22
|
end
|
23
23
|
|
24
|
+
# TODO: This test run shouldn't be created until after the inputs
|
25
|
+
# and runnable are validated
|
24
26
|
test_run = repo.create(create_params(params).merge(status: 'queued'))
|
25
27
|
missing_inputs = test_run.runnable.missing_inputs(params[:inputs])
|
26
28
|
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Inferno
|
2
|
+
module Web
|
3
|
+
module Controllers
|
4
|
+
module TestRuns
|
5
|
+
class Destroy < Controller
|
6
|
+
include Import[
|
7
|
+
test_runs_repo: 'repositories.test_runs',
|
8
|
+
results_repo: 'repositories.results'
|
9
|
+
]
|
10
|
+
|
11
|
+
def call(params)
|
12
|
+
test_run = test_runs_repo.find(params[:id])
|
13
|
+
|
14
|
+
if test_run.nil? || ['done', 'cancelling'].include?(test_run.status)
|
15
|
+
# If it doesn't exist, already finished, or currently being cancelled
|
16
|
+
self.status = 204
|
17
|
+
return
|
18
|
+
end
|
19
|
+
|
20
|
+
test_run_is_waiting = (test_run.status == 'waiting')
|
21
|
+
test_runs_repo.mark_as_cancelling(params[:id])
|
22
|
+
|
23
|
+
if test_run_is_waiting
|
24
|
+
waiting_result = results_repo.find_waiting_result(test_run_id: test_run.id)
|
25
|
+
results_repo.cancel_waiting_result(waiting_result.id, 'Test cancelled by user')
|
26
|
+
Jobs.perform(Jobs::ResumeTestRun, test_run.id)
|
27
|
+
end
|
28
|
+
|
29
|
+
self.status = 204
|
30
|
+
rescue StandardError => e
|
31
|
+
Application['logger'].error(e.full_message)
|
32
|
+
self.body = { errors: e.message }.to_json
|
33
|
+
self.status = 500
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -7,7 +7,7 @@ module Inferno
|
|
7
7
|
|
8
8
|
Router = Hanami::Router.new(namespace: Inferno::Web::Controllers) do
|
9
9
|
namespace 'api' do
|
10
|
-
resources 'test_runs', only: [:create, :show] do
|
10
|
+
resources 'test_runs', only: [:create, :show, :destroy] do
|
11
11
|
resources 'results', only: [:index]
|
12
12
|
end
|
13
13
|
|
@@ -31,7 +31,7 @@ module Inferno
|
|
31
31
|
instance_variable_set(:"@#{name}", value)
|
32
32
|
end
|
33
33
|
|
34
|
-
self.token_retrieval_time = DateTime.now if token_retrieval_time.blank?
|
34
|
+
self.token_retrieval_time = DateTime.now if access_token.present? && token_retrieval_time.blank?
|
35
35
|
end
|
36
36
|
|
37
37
|
# @api private
|
data/lib/inferno/dsl/runnable.rb
CHANGED
@@ -456,12 +456,13 @@ module Inferno
|
|
456
456
|
|
457
457
|
# @private
|
458
458
|
def required_inputs(prior_outputs = [])
|
459
|
-
required_inputs =
|
460
|
-
|
461
|
-
|
462
|
-
|
459
|
+
required_inputs =
|
460
|
+
inputs
|
461
|
+
.reject { |input| input_definitions[input][:optional] }
|
462
|
+
.map { |input| config.input_name(input) }
|
463
|
+
.reject { |input| prior_outputs.include?(input) }
|
463
464
|
children_required_inputs = children.flat_map { |child| child.required_inputs(prior_outputs) }
|
464
|
-
prior_outputs.concat(outputs)
|
465
|
+
prior_outputs.concat(outputs.map { |output| config.output_name(output) })
|
465
466
|
(required_inputs + children_required_inputs).flatten.uniq
|
466
467
|
end
|
467
468
|
|
@@ -32,7 +32,7 @@ module Inferno
|
|
32
32
|
# @return [String, nil] identfier for a waiting `TestRun`
|
33
33
|
# @!attribute wait_timeout
|
34
34
|
class TestRun < Entity
|
35
|
-
STATUS_OPTIONS = ['queued', 'running', 'waiting', 'done'].freeze
|
35
|
+
STATUS_OPTIONS = ['queued', 'running', 'waiting', 'cancelling', 'done'].freeze
|
36
36
|
ATTRIBUTES = [
|
37
37
|
:id,
|
38
38
|
:test_session_id,
|
Binary file
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"main.js": "/public/bundle.js",
|
3
|
-
"main.png": "/public/e09b16f5cb645eb05f90c8f38f3409fb.png",
|
4
3
|
"217.bundle.js": "/public/217.bundle.js",
|
5
|
-
"inferno_logo.png": "/public/e09b16f5cb645eb05f90c8f38f3409fb.png"
|
4
|
+
"inferno_logo.png": "/public/e09b16f5cb645eb05f90c8f38f3409fb.png",
|
5
|
+
"inferno_icon.png": "/public/72a5cd989e6aea904540824ec865a0f8.png"
|
6
6
|
}
|