inferno_core 0.4.31 → 0.4.32
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/cli/templates/README.md.tt +12 -14
- 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 +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab7188504ca88cbb022aaab3dc6d42b4a818bec3cef33b3bf58a3cdea86babf2
|
4
|
+
data.tar.gz: 4ece00547e334cbde803409619443c41417a965e27fd820f760980e8211eada2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0920f31658a7a783033db4a0ed1a2ffc476ef50ca18a3c12f590efa7a4967865c6553e07158d9a19792d498bd3e8e88e60c44a237686a849a07cca1b5364f8fe'
|
7
|
+
data.tar.gz: c18d9237d93908e09c3fbe0631419ff74511dcf7bd645970820ab19457ec454cd83cfcff3357e06e26afe43892c19a73ec1010d654999368f47438d73f5d5704
|
@@ -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
|
@@ -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.32
|
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-03-
|
13
|
+
date: 2024-03-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -580,6 +580,7 @@ files:
|
|
580
580
|
- lib/inferno/apps/web/controllers/test_runs/destroy.rb
|
581
581
|
- lib/inferno/apps/web/controllers/test_runs/results/index.rb
|
582
582
|
- lib/inferno/apps/web/controllers/test_runs/show.rb
|
583
|
+
- lib/inferno/apps/web/controllers/test_session_form_post_controller.rb
|
583
584
|
- lib/inferno/apps/web/controllers/test_sessions/client_show.rb
|
584
585
|
- lib/inferno/apps/web/controllers/test_sessions/create.rb
|
585
586
|
- lib/inferno/apps/web/controllers/test_sessions/last_test_run.rb
|