inferno_core 0.6.11 → 0.6.12
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/evaluate.rb +8 -7
- data/lib/inferno/apps/cli/main.rb +12 -1
- data/lib/inferno/apps/cli/requirements.rb +49 -0
- data/lib/inferno/apps/cli/requirements_coverage_checker.rb +238 -0
- data/lib/inferno/apps/cli/suite.rb +9 -0
- data/lib/inferno/apps/web/controllers/test_sessions/results/io_value.rb +68 -0
- data/lib/inferno/apps/web/router.rb +3 -0
- data/lib/inferno/apps/web/serializers/result.rb +2 -2
- data/lib/inferno/dsl/fhir_client.rb +9 -1
- data/lib/inferno/dsl/http_client.rb +9 -1
- data/lib/inferno/dsl/runnable.rb +15 -30
- data/lib/inferno/dsl/suite_requirements.rb +26 -26
- data/lib/inferno/entities/result.rb +39 -0
- data/lib/inferno/entities/test_kit.rb +4 -0
- data/lib/inferno/public/bundle.js +11 -11
- data/lib/inferno/repositories/repository.rb +19 -0
- data/lib/inferno/repositories/requirements.rb +4 -3
- data/lib/inferno/repositories/results.rb +6 -3
- data/lib/inferno/repositories/runnable_repository.rb +29 -0
- data/lib/inferno/repositories/test_groups.rb +2 -2
- data/lib/inferno/repositories/test_sessions.rb +1 -0
- data/lib/inferno/repositories/test_suites.rb +2 -2
- data/lib/inferno/repositories/tests.rb +2 -2
- data/lib/inferno/repositories.rb +1 -0
- data/lib/inferno/version.rb +1 -1
- metadata +5 -2
@@ -9,33 +9,33 @@ module Inferno
|
|
9
9
|
# @return [Array<Inferno::DSL::RequirementSet>]
|
10
10
|
#
|
11
11
|
# @example
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
12
|
+
# class Suite < Inferno::TestSuite
|
13
|
+
# requirement_sets(
|
14
|
+
# {
|
15
|
+
# identifier: 'example-regulation-1',
|
16
|
+
# title: 'Example Regulation 1',
|
17
|
+
# actor: 'Provider' # Only include requirements for the 'Provider'
|
18
|
+
# # actor
|
19
|
+
# },
|
20
|
+
# {
|
21
|
+
# identifier: 'example-ig-1',
|
22
|
+
# title: 'Example Implementation Guide 1',
|
23
|
+
# actor: 'Provider',
|
24
|
+
# requirements: '2, 4-5' # Only include these specific requirements
|
25
|
+
# },
|
26
|
+
# {
|
27
|
+
# identifier: 'example-ig-2',
|
28
|
+
# title: 'Example Implementation Guide 2',
|
29
|
+
# requirements: 'Referenced', # Only include requirements from this
|
30
|
+
# # set that are referenced by other
|
31
|
+
# # included requirements
|
32
|
+
# actor: 'Server',
|
33
|
+
# suite_options: { # Only include these requirements if the ig
|
34
|
+
# ig_version: '3.0.0' # version 3.0.0 suite option is selected
|
35
|
+
# }
|
35
36
|
# }
|
36
|
-
#
|
37
|
-
#
|
38
|
-
# end
|
37
|
+
# )
|
38
|
+
# end
|
39
39
|
def requirement_sets(*sets)
|
40
40
|
@requirement_sets = sets.map { |set| RequirementSet.new(**set) } if sets.present?
|
41
41
|
|
@@ -71,6 +71,45 @@ module Inferno
|
|
71
71
|
def waiting?
|
72
72
|
result == 'wait'
|
73
73
|
end
|
74
|
+
|
75
|
+
def inputs
|
76
|
+
input_json.present? ? JSON.parse(input_json) : []
|
77
|
+
end
|
78
|
+
|
79
|
+
def outputs
|
80
|
+
output_json.present? ? JSON.parse(output_json) : []
|
81
|
+
end
|
82
|
+
|
83
|
+
# Flags large inputs or outputs and replaces their values with a reference message.
|
84
|
+
#
|
85
|
+
# This method inspects either the `inputs` or `outputs` array and,
|
86
|
+
# for each item whose `value` exceeds the configured size threshold, sets `is_large: true`
|
87
|
+
# and replaces the `value` with a message pointing to the full content endpoint.
|
88
|
+
#
|
89
|
+
# @param io_type [String] Must be either `'inputs'` or `'outputs'`.
|
90
|
+
# @return [Array<Hash>] The mutated list of inputs or outputs.
|
91
|
+
def handle_large_io(io_type)
|
92
|
+
io_array = public_send(io_type)
|
93
|
+
|
94
|
+
io_array.each do |io|
|
95
|
+
next unless io_is_large?(io['value'])
|
96
|
+
|
97
|
+
io['is_large'] = true
|
98
|
+
io['value'] = <<~MESSAGE
|
99
|
+
#{io_type.singularize.capitalize} is too large to display, please visit
|
100
|
+
#{Inferno::Application['base_url']}/api/test_sessions/#{test_session_id}/results/#{id}/io/#{io_type}/#{io['name']}
|
101
|
+
for details
|
102
|
+
MESSAGE
|
103
|
+
end
|
104
|
+
|
105
|
+
io_array
|
106
|
+
end
|
107
|
+
|
108
|
+
# @private
|
109
|
+
def io_is_large?(io_value)
|
110
|
+
size_in_char = io_value.is_a?(String) ? io_value.length : io_value.to_json.length
|
111
|
+
size_in_char > ENV.fetch('MAX_IO_DISPLAY_CHAR', 10000).to_i
|
112
|
+
end
|
74
113
|
end
|
75
114
|
end
|
76
115
|
end
|
@@ -149,6 +149,10 @@ module Inferno
|
|
149
149
|
@options = suites.each_with_object({}) { |suite, hash| hash[suite.id] = suite.suite_options }
|
150
150
|
end
|
151
151
|
|
152
|
+
def contains_test_suite?(test_suite_id)
|
153
|
+
suite_ids.map(&:to_sym).include? test_suite_id.to_sym
|
154
|
+
end
|
155
|
+
|
152
156
|
# @private
|
153
157
|
def add_self_to_repository
|
154
158
|
repository.insert(self)
|