-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into FI-3261-markdown-descriptions
- Loading branch information
Showing
22 changed files
with
269 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class JSONTestEndpoint < Inferno::DSL::SuiteEndpoint | ||
def test_run_identifier | ||
'ABC' | ||
end | ||
|
||
def make_response | ||
response.body = req.params[:json_param] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1 @@ | ||
require_relative '<%= library_name %>/patient_group' | ||
|
||
module <%= module_name %> | ||
class Suite < Inferno::TestSuite | ||
id :<%= test_suite_id %> | ||
title '<%= title_name %> Test Suite' | ||
description '<%= human_name %> test suite.' | ||
|
||
# These inputs will be available to all tests in this suite | ||
input :url, | ||
title: 'FHIR Server Base Url' | ||
|
||
input :credentials, | ||
title: 'OAuth Credentials', | ||
type: :oauth_credentials, | ||
optional: true | ||
|
||
# All FHIR requests in this suite will use this FHIR client | ||
fhir_client do | ||
url :url | ||
oauth_credentials :credentials | ||
end | ||
|
||
# All FHIR validation requests will use this FHIR validator | ||
fhir_resource_validator do | ||
# igs 'identifier#version' # Use this method for published IGs/versions | ||
# igs 'igs/filename.tgz' # Use this otherwise | ||
|
||
exclude_message do |message| | ||
message.message.match?(/\A\S+: \S+: URL value '.*' does not resolve/) | ||
end | ||
end | ||
|
||
# Tests and TestGroups can be defined inline | ||
group do | ||
id :capability_statement | ||
title 'Capability Statement' | ||
description 'Verify that the server has a CapabilityStatement' | ||
|
||
test do | ||
id :capability_statement_read | ||
title 'Read CapabilityStatement' | ||
description 'Read CapabilityStatement from /metadata endpoint' | ||
|
||
run do | ||
fhir_get_capability_statement | ||
|
||
assert_response_status(200) | ||
assert_resource_type(:capability_statement) | ||
end | ||
end | ||
end | ||
|
||
# Tests and TestGroups can be written in separate files and then included | ||
# using their id | ||
group from: :patient_group | ||
end | ||
end | ||
require_relative '<%= library_name %>/suite' |
18 changes: 18 additions & 0 deletions
18
lib/inferno/apps/cli/templates/lib/%library_name%/metadata.rb.tt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require_relative 'version' | ||
|
||
module <%= module_name %> | ||
class Metadata < Inferno::TestKit | ||
id :<%= test_kit_id %> | ||
title '<%= title_name %>' | ||
description <<~DESCRIPTION | ||
This is a big markdown description of the test kit. | ||
DESCRIPTION | ||
suite_ids [:<%= test_suite_id %>] | ||
# tags ['SMART App Launch', 'US Core'] | ||
# last_updated '2024-03-07' | ||
version VERSION | ||
maturity 'Low' | ||
authors <%= authors %> | ||
# repo 'TODO' | ||
end | ||
end |
59 changes: 59 additions & 0 deletions
59
lib/inferno/apps/cli/templates/lib/%library_name%/suite.rb.tt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
require_relative 'metadata' | ||
require_relative 'patient_group' | ||
|
||
module <%= module_name %> | ||
class Suite < Inferno::TestSuite | ||
id :<%= test_suite_id %> | ||
title '<%= title_name %> Test Suite' | ||
description '<%= human_name %> test suite.' | ||
|
||
# These inputs will be available to all tests in this suite | ||
input :url, | ||
title: 'FHIR Server Base Url' | ||
|
||
input :credentials, | ||
title: 'OAuth Credentials', | ||
type: :oauth_credentials, | ||
optional: true | ||
|
||
# All FHIR requests in this suite will use this FHIR client | ||
fhir_client do | ||
url :url | ||
oauth_credentials :credentials | ||
end | ||
|
||
# All FHIR validation requests will use this FHIR validator | ||
fhir_resource_validator do | ||
# igs 'identifier#version' # Use this method for published IGs/versions | ||
# igs 'igs/filename.tgz' # Use this otherwise | ||
|
||
exclude_message do |message| | ||
message.message.match?(/\A\S+: \S+: URL value '.*' does not resolve/) | ||
end | ||
end | ||
|
||
# Tests and TestGroups can be defined inline | ||
group do | ||
id :capability_statement | ||
title 'Capability Statement' | ||
description 'Verify that the server has a CapabilityStatement' | ||
|
||
test do | ||
id :capability_statement_read | ||
title 'Read CapabilityStatement' | ||
description 'Read CapabilityStatement from /metadata endpoint' | ||
|
||
run do | ||
fhir_get_capability_statement | ||
|
||
assert_response_status(200) | ||
assert_resource_type(:capability_statement) | ||
end | ||
end | ||
end | ||
|
||
# Tests and TestGroups can be written in separate files and then included | ||
# using their id | ||
group from: :patient_group | ||
end | ||
end |
3 changes: 3 additions & 0 deletions
3
lib/inferno/apps/cli/templates/lib/%library_name%/version.rb.tt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module <%= module_name %> | ||
VERSION = '0.0.0'.freeze | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Hanami | ||
module Middleware | ||
class BodyParser | ||
class JsonParser | ||
def self.mime_types | ||
['application/json', 'application/vnd.api+json', 'application/fhir+json'] | ||
end | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.