inferno_core 0.4.31 → 0.4.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/inferno/apps/cli/templates/.dockerignore +22 -0
- data/lib/inferno/apps/cli/templates/.env +1 -0
- data/lib/inferno/apps/cli/templates/.env.development +2 -0
- data/lib/inferno/apps/cli/templates/.env.production +2 -0
- data/lib/inferno/apps/cli/templates/.env.test +2 -0
- data/lib/inferno/apps/cli/templates/.gitignore +20 -0
- data/lib/inferno/apps/cli/templates/.rspec +1 -0
- data/lib/inferno/apps/cli/templates/.ruby-version +1 -0
- data/lib/inferno/apps/cli/templates/.tool-versions +1 -0
- data/lib/inferno/apps/cli/templates/README.md.tt +12 -14
- data/lib/inferno/apps/cli/templates/data/.keep +0 -0
- data/lib/inferno/apps/cli/templates/data/redis/.keep +0 -0
- data/lib/inferno/apps/cli/templates/lib/%library_name%/igs/.keep +0 -0
- data/lib/inferno/apps/web/controllers/test_session_form_post_controller.rb +39 -0
- data/lib/inferno/apps/web/router.rb +2 -0
- data/lib/inferno/dsl/configurable.rb +5 -0
- data/lib/inferno/test_runner.rb +12 -0
- data/lib/inferno/version.rb +1 -1
- metadata +15 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab265accd0c50a93d8b2e15f0dccc484975629498582de9a6dd468d1ce42726c
|
4
|
+
data.tar.gz: 0c952e5acbf1068654b6f3e7a5b71887a703bdae090cd89d7b45ef4004329165
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cf04aced45b2af4bbbcb1d0ac74eca6e5393f881bde1a526425cf023504db0be0450829cf8b69599973633ac97422094c7b0f343320876f8a9df5f9e46a405d
|
7
|
+
data.tar.gz: 6ea678a4ad6e349a3fedf9cda6c78f9614261e9fce63a9478b68962a8c98ac00ea582ac55de8e4e58f586cf40e73809b18515094c1d151c677e629a061790700
|
@@ -0,0 +1,22 @@
|
|
1
|
+
.env.local
|
2
|
+
.env.*.local
|
3
|
+
.env.development
|
4
|
+
.env.test
|
5
|
+
Dockerfile
|
6
|
+
.gitignore
|
7
|
+
|
8
|
+
.byebug_history
|
9
|
+
**/.DS_Store
|
10
|
+
.vscode/*
|
11
|
+
.project
|
12
|
+
.settings/.jsdtscope
|
13
|
+
.settings/org.eclipse.wst.jsdt.ui.superType.container
|
14
|
+
.settings/org.eclipse.wst.jsdt.ui.superType.name
|
15
|
+
.idea
|
16
|
+
|
17
|
+
/coverage
|
18
|
+
/data
|
19
|
+
/.git
|
20
|
+
/.github
|
21
|
+
/log
|
22
|
+
/tmp
|
@@ -0,0 +1 @@
|
|
1
|
+
JS_HOST=""
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/data/*.db
|
2
|
+
/data/redis/**/*.rdb
|
3
|
+
/data/redis/**/*.aof
|
4
|
+
/data/redis/**/*.manifest
|
5
|
+
/tmp
|
6
|
+
.env.local
|
7
|
+
.env.*.local
|
8
|
+
**/.DS_Store
|
9
|
+
.vscode/*
|
10
|
+
.project
|
11
|
+
.settings/.jsdtscope
|
12
|
+
.settings/org.eclipse.wst.jsdt.ui.superType.container
|
13
|
+
.settings/org.eclipse.wst.jsdt.ui.superType.name
|
14
|
+
.idea
|
15
|
+
|
16
|
+
/coverage
|
17
|
+
/spec/examples.txt
|
18
|
+
/docs/yard
|
19
|
+
.yardoc
|
20
|
+
node_modules
|
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
@@ -0,0 +1 @@
|
|
1
|
+
3.1.2
|
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.1.2
|
@@ -1,25 +1,23 @@
|
|
1
1
|
# <%= title_name %> Test Kit
|
2
2
|
|
3
|
-
<%= human_name %> [Inferno](https://github.com/inferno-community/inferno-core)
|
3
|
+
<%= human_name %> [Inferno](https://github.com/inferno-community/inferno-core) Test Kit
|
4
4
|
for FHIR testing.
|
5
5
|
|
6
|
-
##
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
## Instructions for Developing Your Test Kit
|
7
|
+
|
8
|
+
Refer to the Inferno documentation for information about [setting up
|
9
|
+
your development environment and running your Test Kit](https://inferno-framework.github.io/docs/getting-started/).
|
10
10
|
|
11
|
-
|
11
|
+
More information about what is included in this repository can be [found here](https://inferno-framework.github.io/docs/getting-started/repo-layout-and-organization.html).
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
Inferno](https://inferno-framework.github.io/inferno-core/getting-started.html#getting-started-for-inferno-test-writers).
|
13
|
+
## Documentation
|
14
|
+
- [Inferno documentation](https://inferno-framework.github.io/docs/)
|
15
|
+
- [Ruby API documentation](https://inferno-framework.github.io/inferno-core/docs/)
|
16
|
+
- [JSON API documentation](https://inferno-framework.github.io/inferno-core/api-docs/)
|
18
17
|
|
19
|
-
## Example Inferno
|
18
|
+
## Example Inferno Test Kits
|
20
19
|
|
21
|
-
|
22
|
-
- https://github.com/inferno-community/shc-vaccination-test-kit
|
20
|
+
A list of all Test Kits registered with the Inferno Team can be found on the [Test Kit Registry](https://inferno-framework.github.io/community/test-kits.html) page.
|
23
21
|
|
24
22
|
## License
|
25
23
|
Copyright <%= Time.now.year %> TODO
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Inferno
|
2
|
+
module Web
|
3
|
+
module Controllers
|
4
|
+
class TestSessionFormPostController < Hanami::Action
|
5
|
+
def self.call(...)
|
6
|
+
new.call(...)
|
7
|
+
end
|
8
|
+
|
9
|
+
def handle(req, res)
|
10
|
+
test_suite_id = req.params[:test_suite_id]
|
11
|
+
|
12
|
+
test_suite = Inferno::Repositories::TestSuites.new.find(test_suite_id)
|
13
|
+
halt 404, "Unable to find test suite with id #{test_suite_id}" if test_suite.nil?
|
14
|
+
|
15
|
+
params = { test_suite_id: }
|
16
|
+
suite_option_keys = test_suite.suite_options.map(&:id)
|
17
|
+
options = req.params.to_h.slice(*suite_option_keys)
|
18
|
+
|
19
|
+
params[:suite_options] = options.map { |key, value| { id: key, value: } } if options.present?
|
20
|
+
|
21
|
+
repo = Inferno::Repositories::TestSessions.new
|
22
|
+
session = repo.create(params)
|
23
|
+
|
24
|
+
preset_id = req.params[:preset_id]
|
25
|
+
|
26
|
+
if preset_id.present?
|
27
|
+
preset = Inferno::Repositories::Presets.new.find(preset_id)
|
28
|
+
|
29
|
+
halt 422, "Unable to find preset with id #{preset_id} for test suite #{test_suite_id}" if preset.nil?
|
30
|
+
|
31
|
+
repo.apply_preset(session, preset_id)
|
32
|
+
end
|
33
|
+
|
34
|
+
res.redirect_to "#{Inferno::Application['base_url']}/#{test_suite_id}/#{session.id}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -72,6 +72,8 @@ module Inferno
|
|
72
72
|
|
73
73
|
get '/test_sessions/:id', to: Inferno::Web::Controllers::TestSessions::ClientShow, as: :client_session_show
|
74
74
|
get '/:test_suite_id/:id', to: Inferno::Web::Controllers::TestSessions::ClientShow, as: :client_suite_session_show
|
75
|
+
|
76
|
+
post '/:test_suite_id', to: Inferno::Web::Controllers::TestSessionFormPostController, as: :session_form_post
|
75
77
|
end
|
76
78
|
|
77
79
|
Router = # rubocop:disable Naming/ConstantName
|
data/lib/inferno/test_runner.rb
CHANGED
@@ -73,6 +73,8 @@ module Inferno
|
|
73
73
|
result = begin
|
74
74
|
raise Exceptions::CancelException, 'Test cancelled by user' if test_run_is_cancelling
|
75
75
|
|
76
|
+
check_inputs(test, test_instance, inputs)
|
77
|
+
|
76
78
|
test_instance.load_named_requests
|
77
79
|
test_instance.instance_eval(&test.block)
|
78
80
|
'pass'
|
@@ -112,6 +114,16 @@ module Inferno
|
|
112
114
|
test_result
|
113
115
|
end
|
114
116
|
|
117
|
+
def check_inputs(test, _test_instance, inputs)
|
118
|
+
inputs.each do |key, value|
|
119
|
+
optional = test.config.input_optional?(key)
|
120
|
+
if value.nil? && !optional
|
121
|
+
raise Exceptions::SkipException,
|
122
|
+
"Input '#{test.config.input_name(key)}' is nil, skipping test."
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
115
127
|
def run_group(group, scratch)
|
116
128
|
group_inputs_with_values = group.available_inputs.map do |_input_identifier, input|
|
117
129
|
{
|
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.
|
4
|
+
version: 0.4.33
|
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-
|
13
|
+
date: 2024-04-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -552,6 +552,15 @@ files:
|
|
552
552
|
- lib/inferno/apps/cli/suite_input_template.rb
|
553
553
|
- lib/inferno/apps/cli/suites.rb
|
554
554
|
- lib/inferno/apps/cli/templates/%library_name%.gemspec.tt
|
555
|
+
- lib/inferno/apps/cli/templates/.dockerignore
|
556
|
+
- lib/inferno/apps/cli/templates/.env
|
557
|
+
- lib/inferno/apps/cli/templates/.env.development
|
558
|
+
- lib/inferno/apps/cli/templates/.env.production
|
559
|
+
- lib/inferno/apps/cli/templates/.env.test
|
560
|
+
- lib/inferno/apps/cli/templates/.gitignore
|
561
|
+
- lib/inferno/apps/cli/templates/.rspec
|
562
|
+
- lib/inferno/apps/cli/templates/.ruby-version
|
563
|
+
- lib/inferno/apps/cli/templates/.tool-versions
|
555
564
|
- lib/inferno/apps/cli/templates/Dockerfile.tt
|
556
565
|
- lib/inferno/apps/cli/templates/Gemfile.tt
|
557
566
|
- lib/inferno/apps/cli/templates/LICENSE.tt
|
@@ -563,9 +572,12 @@ files:
|
|
563
572
|
- lib/inferno/apps/cli/templates/config/nginx.background.conf.tt
|
564
573
|
- lib/inferno/apps/cli/templates/config/nginx.conf.tt
|
565
574
|
- lib/inferno/apps/cli/templates/config/puma.rb.tt
|
575
|
+
- lib/inferno/apps/cli/templates/data/.keep
|
576
|
+
- lib/inferno/apps/cli/templates/data/redis/.keep
|
566
577
|
- lib/inferno/apps/cli/templates/docker-compose.background.yml.tt
|
567
578
|
- lib/inferno/apps/cli/templates/docker-compose.yml.tt
|
568
579
|
- lib/inferno/apps/cli/templates/lib/%library_name%.rb.tt
|
580
|
+
- lib/inferno/apps/cli/templates/lib/%library_name%/igs/.keep
|
569
581
|
- lib/inferno/apps/cli/templates/lib/%library_name%/igs/put_ig_package_dot_tgz_here
|
570
582
|
- lib/inferno/apps/cli/templates/lib/%library_name%/patient_group.rb.tt
|
571
583
|
- lib/inferno/apps/cli/templates/run.sh
|
@@ -580,6 +592,7 @@ files:
|
|
580
592
|
- lib/inferno/apps/web/controllers/test_runs/destroy.rb
|
581
593
|
- lib/inferno/apps/web/controllers/test_runs/results/index.rb
|
582
594
|
- lib/inferno/apps/web/controllers/test_runs/show.rb
|
595
|
+
- lib/inferno/apps/web/controllers/test_session_form_post_controller.rb
|
583
596
|
- lib/inferno/apps/web/controllers/test_sessions/client_show.rb
|
584
597
|
- lib/inferno/apps/web/controllers/test_sessions/create.rb
|
585
598
|
- lib/inferno/apps/web/controllers/test_sessions/last_test_run.rb
|