Skip to content

Commit

Permalink
Dependency Updates 2024-04-05 (#20)
Browse files Browse the repository at this point in the history
* update dependencies

* Fix unit tests and make bearer_token optional in export cancel group tests

* Fix inputs to bulk data test kit tests and fix spec tests accordingly

* Create subclasses of each test that requires the group_id input so that the group test groups can import from these subclass tests containing the group_id input instead

---------

Co-authored-by: Emily Michaud <[email protected]>
  • Loading branch information
Jammjammjamm and emichaud998 authored Apr 12, 2024
1 parent 2f5d371 commit a712467
Show file tree
Hide file tree
Showing 32 changed files with 195 additions and 155 deletions.
18 changes: 9 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ GEM
database_cleaner (~> 1.99.0)
sequel
date_time_precision (0.8.1)
debug (1.9.1)
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
diff-lcs (1.5.1)
Expand Down Expand Up @@ -161,7 +161,7 @@ GEM
i18n (1.14.4)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
inferno_core (0.4.31)
inferno_core (0.4.33)
activesupport (~> 6.1.7.5)
base62-rb (= 0.3.1)
blueprinter (= 0.25.2)
Expand Down Expand Up @@ -217,7 +217,7 @@ GEM
mustermann (= 1.1.2)
ndjson (1.0.0)
netrc (0.11.0)
nio4r (2.7.0)
nio4r (2.7.1)
nokogiri (1.16.3)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
Expand All @@ -244,16 +244,16 @@ GEM
pry (>= 0.13, < 0.15)
psych (5.1.2)
stringio
public_suffix (5.0.4)
public_suffix (5.0.5)
puma (5.6.8)
nio4r (~> 2.0)
racc (1.7.3)
rack (2.2.8.1)
rake (13.1.0)
rdoc (6.6.2)
rack (2.2.9)
rake (13.2.1)
rdoc (6.6.3.1)
psych (>= 4.0.0)
redis (4.8.1)
reline (0.4.3)
reline (0.5.0)
io-console (~> 0.5)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
Expand Down Expand Up @@ -282,7 +282,7 @@ GEM
connection_pool (>= 2.2.5, < 3)
rack (~> 2.0)
redis (>= 4.5.0, < 5)
smart_app_launch_test_kit (0.4.1)
smart_app_launch_test_kit (0.4.2)
inferno_core (>= 0.4.2)
json-jwt (~> 1.15.3)
jwt (~> 2.6)
Expand Down
5 changes: 4 additions & 1 deletion lib/bulk_data_test_kit/export_cancel_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ module BulkDataExportCancelTests
def perform_export_cancel_test
use_token = !bearer_token.blank?
url = bulk_export_url.dup
url = bulk_export_url.gsub('[group_id]', group_id) if resource_type == 'Group'
if resource_type == 'Group'
skip_if group_id.blank?, 'Group id is blank, skipping test.'
url = bulk_export_url.gsub('[group_id]', group_id) if resource_type == 'Group'
end

perform_export_kick_off_request(use_token:, url:)
assert_response_status(202)
Expand Down
10 changes: 8 additions & 2 deletions lib/bulk_data_test_kit/export_operation_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ def rejects_without_authorization
skip_if bearer_token.blank?, 'Bearer token is not set and thus not required to connect to server.'

url = bulk_export_url.dup
url = bulk_export_url.gsub('[group_id]', group_id) if resource_type == 'Group'
if resource_type == 'Group'
skip_if group_id.blank?, 'Group id is blank, skipping test.'
url = bulk_export_url.gsub('[group_id]', group_id) if resource_type == 'Group'
end

perform_export_kick_off_request(use_token: false, url:)
assert_response_status([400, 401])
Expand All @@ -74,7 +77,10 @@ def export_kick_off_success
use_token = !bearer_token.blank?

url = bulk_export_url.dup
url = bulk_export_url.gsub('[group_id]', group_id) if resource_type == 'Group'
if resource_type == 'Group'
skip_if group_id.blank?, 'Group id is blank, skipping test.'
url = bulk_export_url.gsub('[group_id]', group_id) if resource_type == 'Group'
end

perform_export_kick_off_request(use_token:, url:)
assert_response_status(202)
Expand Down
10 changes: 8 additions & 2 deletions lib/bulk_data_test_kit/export_parameters_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ module BulkDataExportParametersTests

def perform_outputFormat_param_test
url = bulk_export_url.dup
url = bulk_export_url.gsub('[group_id]', group_id) if resource_type == 'Group'
if resource_type == 'Group'
skip_if group_id.blank?, 'Group id is blank, skipping test.'
url = bulk_export_url.gsub('[group_id]', group_id) if resource_type == 'Group'
end

['application/fhir+ndjson', 'application/ndjson', 'ndjson'].each do |format|
kickoff_url = url.dup
Expand All @@ -34,7 +37,10 @@ def perform_since_param_test(since_timestamp_param)
/x

url = bulk_export_url.dup
url = bulk_export_url.gsub('[group_id]', group_id) if resource_type == 'Group'
if resource_type == 'Group'
skip_if group_id.blank?, 'Group id is blank, skipping test.'
url = bulk_export_url.gsub('[group_id]', group_id) if resource_type == 'Group'
end

assert since_timestamp_param.match?(fhir_instant_regex),
"The provided `_since` timestamp `#{since_timestamp_param}` is not a valid " \
Expand Down
2 changes: 2 additions & 0 deletions lib/bulk_data_test_kit/v1.0.1/bulk_data_export_cancel_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class BulkDataExportCancelTest < Inferno::Test
DESCRIPTION
# link 'http://hl7.org/fhir/uv/bulkdata/STU1.0.1/export/index.html#bulk-data-delete-request'

input :bearer_token,
optional: true
output :cancelled_polling_url

def self.properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class BulkDataKickOffTest < Inferno::Test
DESCRIPTION
# link 'http://hl7.org/fhir/uv/bulkdata/STU1.0.1/export/index.html#response---success'

input :bearer_token,
optional: true
output :polling_url

def self.properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class BulkDataSmartBackendServicesGroupV101 < Inferno::TestGroup
id :bulk_data_export_tests_v101
title 'Bulk Data Export Tests'

input :bulk_server_url

group do
id :bulk_data_server_tests
title 'Bulk Data Server TLS Tests'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

require_relative 'bulk_data_export_cancel_test'

module BulkDataTestKit
module BulkDataV101
class BulkDataGroupExportCancelTest < BulkDataV101::BulkDataExportCancelTest
id :bulk_data_export_group_cancel
input :group_id

config(
options: { resource_type: 'Group', bulk_export_url: 'Group/[group_id]/$export' }
)
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

require_relative 'bulk_data_export_kick_off_test'

module BulkDataTestKit
module BulkDataV101
class BulkDataGroupKickOffTest < BulkDataV101::BulkDataKickOffTest
id :bulk_data_group_kick_off
input :group_id

config(
options: { resource_type: 'Group', bulk_export_url: 'Group/[group_id]/$export' }
)
end
end
end
16 changes: 16 additions & 0 deletions lib/bulk_data_test_kit/v1.0.1/bulk_data_group_no_auth_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

require_relative 'bulk_data_no_auth_test'

module BulkDataTestKit
module BulkDataV101
class BulkDataGroupExportNoAuthRejectTest < BulkDataV101::BulkDataExportNoAuthRejectTest
id :bulk_data_group_no_auth_reject
input :group_id

config(
options: { resource_type: 'Group', bulk_export_url: 'Group/[group_id]/$export' }
)
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class BulkDataNDJSONDownloadTest < Inferno::Test

input :bulk_download_url
input :requires_access_token
input :bearer_token,
optional: true

run do
ndjson_download_requiresAccessToken_check(bulk_data_download_url: bulk_download_url,
Expand Down
3 changes: 3 additions & 0 deletions lib/bulk_data_test_kit/v1.0.1/bulk_data_no_auth_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class BulkDataExportNoAuthRejectTest < Inferno::Test
DESCRIPTION
# link 'http://hl7.org/fhir/uv/bulkdata/STU1.0.1/export/index.html#bulk-data-kick-off-request'

input :bearer_token,
optional: true

def self.properties
@properties ||= BulkDataTestKitProperties.new(
resource_type: config.options[:resource_type],
Expand Down
4 changes: 3 additions & 1 deletion lib/bulk_data_test_kit/v1.0.1/bulk_data_status_check_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ class BulkDataStatusCheckTest < Inferno::Test
DESCRIPTION
# link 'http://hl7.org/fhir/uv/bulkdata/STU1.0.1/export/index.html#bulk-data-status-request'

input :polling_url
input :polling_url, :bulk_timeout
input :bearer_token,
optional: true

output :status_response, :requires_access_token

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require_relative '../../export_kick_off_performer'
require_relative '../bulk_data_export_cancel_test'
require_relative '../bulk_data_group_export_cancel_test'

module BulkDataTestKit
module BulkDataV101
Expand All @@ -14,19 +14,13 @@ class BulkDataGroupExportCancelGroup < Inferno::TestGroup
correct behavior.
)

input :bearer_token
input :bulk_server_url,
title: 'Bulk Data FHIR URL',
description: 'The URL of the Bulk FHIR server.'
input :bearer_token,
optional: true
input :group_id,
title: 'Group ID',
description: 'The Group ID associated with the group of patients to be exported.'

test from: :bulk_data_export_cancel,
id: :bulk_data_group_export_cancel,
config: {
options: { resource_type: 'Group', bulk_export_url: 'Group/[group_id]/$export' }
}
test from: :bulk_data_export_group_cancel
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
require 'tls_test_kit'
require_relative '../bulk_data_export_operation_support_test'
require_relative '../bulk_data_no_auth_test'
require_relative '../bulk_data_group_no_auth_test'
require_relative '../bulk_data_export_kick_off_test'
require_relative '../bulk_data_group_export_kick_off_test'
require_relative '../bulk_data_status_check_test'
require_relative '../bulk_data_output_check_test'

Expand All @@ -24,9 +26,6 @@ class BulkDataGroupExportGroup < Inferno::TestGroup
input :group_id,
title: 'Group ID',
description: 'The Group ID associated with the group of patients to be exported.'
input :bulk_server_url,
title: 'Bulk Data FHIR URL',
description: 'The URL of the Bulk FHIR server.'
input :bulk_timeout,
title: 'Export Times Out after (1-600)',
description: <<~DESCRIPTION,
Expand Down Expand Up @@ -74,17 +73,9 @@ class BulkDataGroupExportGroup < Inferno::TestGroup
)
end

test from: :bulk_data_no_auth_reject,
id: :bulk_data_group_no_auth_reject,
config: {
options: { resource_type: 'Group', bulk_export_url: 'Group/[group_id]/$export' }
}
test from: :bulk_data_group_no_auth_reject

test from: :bulk_data_kick_off,
id: :bulk_data_group_kick_off,
config: {
options: { resource_type: 'Group', bulk_export_url: 'Group/[group_id]/$export' }
}
test from: :bulk_data_group_kick_off

test from: :bulk_data_status_check,
id: :bulk_data_group_status_check,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ class BulkDataPatientExportCancelGroup < Inferno::TestGroup
correct behavior.
)

input :bearer_token
input :bulk_server_url,
title: 'Bulk Data FHIR URL',
description: 'The URL of the Bulk FHIR server.'
input :bearer_token,
optional: true

output :patient_cancelled_polling_url

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ class BulkDataPatientExportGroup < Inferno::TestGroup
title: 'Bulk Data Authorization Bearer Token',
description: 'The authorization bearer token for the Bulk FHIR server. If not required, leave blank.',
optional: true
input :bulk_server_url,
title: 'Bulk Data FHIR URL',
description: 'The URL of the Bulk FHIR server.'
input :bulk_timeout,
title: 'Export Times Out after (1-600)',
description: <<~DESCRIPTION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ class BulkDataSystemExportCancelGroup < Inferno::TestGroup
correct behavior.
)

input :bearer_token
input :bulk_server_url,
title: 'Bulk Data FHIR URL',
description: 'The URL of the Bulk FHIR server.'
input :bearer_token,
optional: true

output :system_cancelled_polling_url

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ class BulkDataSystemExportGroup < Inferno::TestGroup
title: 'Bulk Data Authorization Bearer Token',
description: 'The authorization bearer token for the Bulk FHIR server. If not required, leave blank.',
optional: true
input :bulk_server_url,
title: 'Bulk Data FHIR URL',
description: 'The URL of the Bulk FHIR server.'
input :bulk_timeout,
title: 'Export Times Out after (1-600)',
description: <<~DESCRIPTION,
Expand Down
2 changes: 2 additions & 0 deletions lib/bulk_data_test_kit/v2.0.0/bulk_data_export_cancel_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class BulkDataExportCancelTest < Inferno::Test
id :bulk_data_export_cancel_stu2

input :cancelled_polling_url
input :bearer_token,
optional: true

run do
perform_cancelled_polling_test(cancelled_polling_url)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class BulkDataSmartBackendServicesGroupV200 < Inferno::TestGroup
id :bulk_data_export_tests_v200
title 'Bulk Data Export Tests'

input :bulk_server_url

group do
id :bulk_data_server_tests_stu2
title 'Bulk Data Server TLS Tests'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

require_relative 'bulk_data_outputFormat_param_test'

module BulkDataTestKit
module BulkDataV200
class BulkDataGroupOutputFormatParamTest < BulkDataV200::BulkDataOutputFormatParamTest
id :output_format_in_group_export_response
input :group_id

config(
options: { resource_type: 'Group', bulk_export_url: 'Group/[group_id]/$export' }
)
end
end
end
16 changes: 16 additions & 0 deletions lib/bulk_data_test_kit/v2.0.0/bulk_data_group_since_param_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

require_relative 'bulk_data_since_param_test'

module BulkDataTestKit
module BulkDataV200
class BulkDataGroupSinceParamTest < BulkDataV200::BulkDataSinceParamTest
id :since_in_group_export_response
input :group_id

config(
options: { resource_type: 'Group', bulk_export_url: 'Group/[group_id]/$export' }
)
end
end
end
Loading

0 comments on commit a712467

Please sign in to comment.