Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/data/*.db
/data/*.db*
/data/igs/*.tgz
/data/redis/**/*.rdb
/data/redis/**/*.aof
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# 0.13.0
### Breaking Change
This release validates tester-provided content that Inferno uses (the notification Bundle input in the
client suite and the Subscription input in the server suite) using a new validator named
`:no_custom_extensions`, which treats extensions not defined in the loaded IGs as errors. Test kits that
reuse the following tests must define a `fhir_resource_validator :no_custom_extensions` in their suite
(e.g., the same as their default validator with `extensions []` in the `validation_context`). Otherwise
these tests will result in an error with the message `No 'no_custom_extensions' validator found`.
* `subscriptions_r4_client_notification_input_verification` (also included in the
`subscriptions_r4_client_workflow` group)
* `subscriptions_r4_server_subscription_conformance` (also included in the `subscriptions_r4_server_interaction`
group and the groups that include it, such as `subscriptions_r4_server_workflow` and the event notification
content groups)

Test kits that only use the `SubscriptionConformanceVerification` and `NotificationConformanceVerification`
modules are not affected, as the default validator is still used unless another is specified via the new
`validator:` argument.

* ID-240: Subscription update and delete tests, and validation of tester-provided content without custom extensions

# 0.12.2
* ID-145 inferno-core and jwt gem updates by @FlexonyoPizza in: https://github.com/inferno-framework/subscriptions-test-kit/pull/46

Expand Down
40 changes: 23 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ PATH
specs:
subscriptions_test_kit (0.12.2)
faraday (~> 1.10.5)
inferno_core (~> 1.3, >= 1.3.1)
hana (~> 1.3)
inferno_core (~> 1.4, >= 1.4.6)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -35,8 +36,8 @@ GEM
byebug (13.0.0)
reline (>= 0.6.0)
coderay (1.1.3)
concurrent-ruby (1.3.4)
connection_pool (3.0.2)
concurrent-ruby (1.3.8)
connection_pool (2.5.5)
crack (1.0.1)
bigdecimal
rexml
Expand Down Expand Up @@ -77,7 +78,7 @@ GEM
erb (6.0.4)
factory_bot (6.6.0)
activesupport (>= 6.1.0)
faraday (1.10.5)
faraday (1.10.6)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
Expand Down Expand Up @@ -128,6 +129,7 @@ GEM
date_time_precision (>= 0.8)
mime-types (>= 3.0)
nokogiri (>= 1.11.4)
hana (1.3.7)
hanami-controller (2.0.0)
dry-configurable (~> 1.0, < 2)
dry-core (~> 1.0)
Expand All @@ -151,19 +153,19 @@ GEM
domain_name (~> 0.5)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
inferno_core (1.3.1)
inferno_core (1.4.6)
activesupport (~> 7.2.3.1)
base62-rb (= 0.3.1)
blueprinter (= 0.25.2)
concurrent-ruby (= 1.3.4)
concurrent-ruby (~> 1.3, >= 1.3.7)
csv (~> 3.3.5)
dotenv (~> 2.7)
dry-configurable (= 1.0.0)
dry-container (= 0.10.0)
dry-core (= 1.0.0)
dry-inflector (= 1.0.0)
dry-system (= 1.0.0)
faraday (~> 1.10.5)
faraday (~> 1.10.6)
faraday_middleware (~> 1.2)
fhir_client (>= 6.2.0)
fhir_models (>= 5.1.0)
Expand All @@ -172,15 +174,15 @@ GEM
kramdown (~> 2.5.2)
kramdown-parser-gfm (~> 1.1.0)
mutex_m (~> 0.3.0)
oj (= 3.11.0)
oj (~> 3.17, >= 3.17.3)
pastel (~> 0.8.0)
pry
pry-byebug
puma (~> 5.6.7)
puma (~> 8.0, >= 8.0.2)
rake (~> 13.0)
roo (~> 2.10.1)
sequel (~> 5.42.0)
sidekiq (~> 7.2.4)
sidekiq (~> 7.3.10)
sqlite3 (~> 1.4)
thor (~> 1.4)
tty-markdown (~> 0.7.1)
Expand Down Expand Up @@ -242,7 +244,10 @@ GEM
rack (>= 1.2, < 4)
snaky_hash (~> 2.0, >= 2.0.4)
version_gem (~> 1.1, >= 1.1.9)
oj (3.11.0)
oj (3.17.7)
bigdecimal (>= 3.0)
ostruct (>= 0.2)
ostruct (0.6.3)
parallel (2.1.0)
parser (3.3.11.1)
ast (~> 2.4.1)
Expand All @@ -264,7 +269,7 @@ GEM
date
stringio
public_suffix (7.0.5)
puma (5.6.9)
puma (8.0.2)
nio4r (~> 2.0)
racc (1.8.1)
rack (2.2.23)
Expand Down Expand Up @@ -328,11 +333,12 @@ GEM
rubyzip (2.4.1)
securerandom (0.4.1)
sequel (5.42.0)
sidekiq (7.2.4)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
rack (>= 2.2.4)
redis-client (>= 0.19.0)
sidekiq (7.3.10)
base64
connection_pool (>= 2.3.0, < 3)
logger
rack (>= 2.2.4, < 3.3)
redis-client (>= 0.23.0, < 1)
snaky_hash (2.0.4)
hashie (>= 0.1.0, < 6)
version_gem (>= 1.1.8, < 3)
Expand Down
23 changes: 23 additions & 0 deletions execution_scripts/subscriptions_r4_empty_with_commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,29 @@ steps:
next_poll_session: client
action_description: Attest that event notification was processed correctly

- session: client
status: waiting
last_completed: 2.1.01
state_description: >
Step 6: Client is waiting at the update and delete interaction (2.1.01). The server suite's
update and deletion tests already updated (PUT and JSON Patch) but they will have failed,
so re-run the last server group.
start_run:
session: server
runnable: 7
next_poll_session: server
action_description: Start server group 7 "Subscription Update and Deletion Verification"

- session: server
status: done
last_completed: 7
state_description: >
Step 7: Server Update / Delete group re-run is done. Advance the client wait so the client
suite can continue with update and delete conformance verification.
command: bundle exec ruby execution_scripts/advance_wait.rb '{client.wait_outputs.confirmation_url}'
next_poll_session: client
action_description: Advance client update and delete wait

- session: client
status: done
last_completed: suite
Expand Down

Large diffs are not rendered by default.

2,374 changes: 2,373 additions & 1 deletion execution_scripts/subscriptions_r4_empty_with_commands_server_expected.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,29 @@ steps:
next_poll_session: client
action_description: Attest that event notification was processed correctly

- session: client
status: waiting
last_completed: 2.1.01
state_description: >
Step 6: Client is waiting at the update and delete interaction (2.1.01). The server suite's
update and deletion tests already updated (PUT and JSON Patch) but they will have failed,
so re-run the last server group.
start_run:
session: server
runnable: 7
next_poll_session: server
action_description: Start server group 7 "Subscription Update and Deletion Verification"

- session: server
status: done
last_completed: 7
state_description: >
Step 7: Server Update / Delete group re-run is done. Advance the client wait so the client
suite can continue with update and delete conformance verification.
command: bundle exec ruby execution_scripts/advance_wait.rb '{client.wait_outputs.confirmation_url}'
next_poll_session: client
action_description: Advance client update and delete wait

- session: client
status: done
last_completed: suite
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions execution_scripts/subscriptions_r4_id_only_with_commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,29 @@ steps:
next_poll_session: client
action_description: Attest that event notification was processed correctly

- session: client
status: waiting
last_completed: 2.1.01
state_description: >
Step 6: Client is waiting at the update and delete interaction (2.1.01). The server suite's
update and deletion tests already updated (PUT and JSON Patch) but they will have failed,
so re-run the last server group.
start_run:
session: server
runnable: 7
next_poll_session: server
action_description: Start server group 7 "Subscription Update and Deletion Verification"

- session: server
status: done
last_completed: 7
state_description: >
Step 7: Server Update / Delete group re-run is done. Advance the client wait so the client
suite can continue with update and delete conformance verification.
command: bundle exec ruby execution_scripts/advance_wait.rb '{client.wait_outputs.confirmation_url}'
next_poll_session: client
action_description: Advance client update and delete wait

- session: client
status: done
last_completed: suite
Expand Down

Large diffs are not rendered by default.

2,374 changes: 2,373 additions & 1 deletion execution_scripts/subscriptions_r4_id_only_with_commands_server_expected.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,19 @@ def check_history_bundle_request_response(bundle, subscription_status_entry, sub
end
end

def parameters_verification(subscription_status)
def parameters_verification(subscription_status, validator: :default)
resource_type = subscription_status.resourceType
if resource_type == 'Parameters'
resource_is_valid?(resource: subscription_status, profile_url: 'http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-subscription-status-r4')
resource_is_valid?(resource: subscription_status, validator:,
profile_url: 'http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-subscription-status-r4')
else
add_message('error',
"Unexpected resource type: Expected `Parameters`. Got `#{resource_type}`")
end
end

def notification_verification(notification_bundle, notification_type, subscription_id: nil, status: nil)
def notification_verification(notification_bundle, notification_type, subscription_id: nil, status: nil,
validator: :default)
assert_valid_json(notification_bundle)
bundle = FHIR.from_contents(notification_bundle)
assert bundle.present?, 'Not a FHIR resource'
Expand All @@ -76,7 +78,7 @@ def notification_verification(notification_bundle, notification_type, subscripti
check_history_bundle_request_response(bundle, subscription_status_entry, subscription_id)

subscription_status = subscription_status_entry.resource
parameters_verification(subscription_status)
parameters_verification(subscription_status, validator:)

return unless subscription_status.respond_to?(:parameter)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ def valid_url?(url)
false
end

def subscription_verification(subscription_resource)
def subscription_verification(subscription_resource, validator: :default)
assert_valid_json(subscription_resource)
subscription = JSON.parse(subscription_resource)
assert(subscription.is_a?(Hash), 'The Subscription must be a JSON object.')

subscription_channel = subscription['channel']
assert(subscription_channel.is_a?(Hash), 'The Subscription must include a `channel` element.')
assert(channel_field_matches?(subscription_channel, 'type', 'rest-hook'), %(
The `type` element on the Subscription resource must be set to `rest-hook`,
the `#{subscription_channel['type']}` channel type is unsupported.))
Expand All @@ -62,7 +64,7 @@ def subscription_verification(subscription_resource)
end
subscription_resource = FHIR.from_contents(subscription.to_json)
assert_resource_type('Subscription', resource: subscription_resource)
assert_valid_resource(resource: subscription_resource,
assert_valid_resource(resource: subscription_resource, validator:,
profile_url: 'http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-subscription')

cross_version_extension_check(subscription)
Expand Down
Loading
Loading