inferno_core 0.0.5 → 0.0.6
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 +15 -2
- data/lib/inferno/apps/web/serializers/hash_value_extractor.rb +11 -0
- data/lib/inferno/apps/web/serializers/test.rb +3 -4
- data/lib/inferno/apps/web/serializers/test_group.rb +4 -6
- data/lib/inferno/config/application.rb +1 -0
- data/lib/inferno/config/boot/suites.rb +4 -6
- data/lib/inferno/dsl/assertions.rb +20 -0
- data/lib/inferno/dsl/configurable.rb +126 -0
- data/lib/inferno/dsl/fhir_client.rb +4 -2
- data/lib/inferno/dsl/http_client.rb +10 -8
- data/lib/inferno/dsl/request_storage.rb +21 -12
- data/lib/inferno/dsl/resume_test_route.rb +1 -1
- data/lib/inferno/dsl/runnable.rb +69 -21
- data/lib/inferno/entities/request.rb +2 -2
- data/lib/inferno/entities/test.rb +16 -2
- data/lib/inferno/entities/test_group.rb +8 -0
- data/lib/inferno/exceptions.rb +12 -0
- data/lib/inferno/public/bundle.js +1 -1
- data/lib/inferno/repositories/test_runs.rb +15 -0
- data/lib/inferno/test_runner.rb +20 -18
- data/lib/inferno/utils/markdown_formatter.rb +15 -0
- data/lib/inferno/version.rb +1 -1
- data/spec/factories/request.rb +14 -7
- metadata +5 -2
@@ -1,19 +1,23 @@
|
|
1
1
|
require_relative '../dsl'
|
2
2
|
require_relative '../repositories/tests'
|
3
|
+
require_relative '../utils/markdown_formatter'
|
4
|
+
require 'pry'
|
3
5
|
|
4
6
|
module Inferno
|
5
7
|
module Entities
|
6
8
|
class Test
|
7
9
|
extend Forwardable
|
8
10
|
include DSL
|
11
|
+
include Inferno::Utils::MarkdownFormatter
|
9
12
|
|
10
13
|
def_delegators 'self.class', :title, :id, :block, :inputs, :outputs
|
11
14
|
|
12
15
|
attr_accessor :result_message
|
13
|
-
attr_reader :test_session_id
|
16
|
+
attr_reader :test_session_id, :scratch
|
14
17
|
|
15
18
|
def initialize(**params)
|
16
19
|
params[:inputs]&.each { |key, value| instance_variable_set("@#{key}", value) }
|
20
|
+
@scratch = params[:scratch]
|
17
21
|
@test_session_id = params[:test_session_id]
|
18
22
|
end
|
19
23
|
|
@@ -22,7 +26,7 @@ module Inferno
|
|
22
26
|
end
|
23
27
|
|
24
28
|
def add_message(type, message)
|
25
|
-
messages << { type: type.to_s, message: message }
|
29
|
+
messages << { type: type.to_s, message: format_markdown(message) }
|
26
30
|
end
|
27
31
|
|
28
32
|
# Set output values. Once set, these values will be available to any
|
@@ -33,11 +37,21 @@ module Inferno
|
|
33
37
|
# @example
|
34
38
|
# output(patient_id: '5', bearer_token: 'ABC')
|
35
39
|
def output(outputs)
|
40
|
+
# TODO: update to track outputs that need to be updated
|
36
41
|
outputs.each do |key, value|
|
37
42
|
send("#{key}=", value)
|
43
|
+
outputs_to_persist[key] = value
|
38
44
|
end
|
39
45
|
end
|
40
46
|
|
47
|
+
# @api private
|
48
|
+
# A hash containing outputs that have been set during execution and need
|
49
|
+
# to be persisted. A test may not always update all outputs, so this is
|
50
|
+
# used to prevent overwriting an output with nil when it wasn't updated.
|
51
|
+
def outputs_to_persist
|
52
|
+
@outputs_to_persist ||= {}
|
53
|
+
end
|
54
|
+
|
41
55
|
# Add an informational message to the results of a test. If passed a
|
42
56
|
# block, a failed assertion will become an info message and test execution
|
43
57
|
# will continue.
|
data/lib/inferno/exceptions.rb
CHANGED
@@ -50,5 +50,17 @@ module Inferno
|
|
50
50
|
super("No '#{validator_name}' validator found")
|
51
51
|
end
|
52
52
|
end
|
53
|
+
|
54
|
+
class RequiredInputsNotFound < RuntimeError
|
55
|
+
def initialize(missing_inputs)
|
56
|
+
super("Missing the following required inputs: #{missing_inputs.join(', ')}")
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
class NotUserRunnableException < RuntimeError
|
61
|
+
def initialize
|
62
|
+
super('The chosen runnable must be run as part of a group')
|
63
|
+
end
|
64
|
+
end
|
53
65
|
end
|
54
66
|
end
|