diff --git a/.env b/.env index 578cc74..8e29e83 100644 --- a/.env +++ b/.env @@ -1,2 +1,3 @@ JS_HOST="" -VALIDATOR_URL=http://validator_service/validatorapi +VALIDATOR_URL=http://validator_service:4567 +REDIS_URL=redis://redis:6379/0 diff --git a/.env.test b/.env.test index e83c4d8..9e95769 100644 --- a/.env.test +++ b/.env.test @@ -1 +1,2 @@ VALIDATOR_URL=https://example.com/validatorapi +ASYNC_JOBS=false diff --git a/.gitignore b/.gitignore index 1196f79..f81db36 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ /data/*.db +/data/redis/*.rdb +/data/redis/*.aof /tmp .env.local .env.*.local diff --git a/Dockerfile b/Dockerfile index f72eb96..9d39a86 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,6 @@ ADD lib/ips/version.rb $INSTALL_PATH/lib/ips/version.rb ADD *.gemspec $INSTALL_PATH ADD Gemfile* $INSTALL_PATH RUN gem install bundler -RUN bundle config set --local deployment 'true' RUN bundle install ADD . $INSTALL_PATH diff --git a/Gemfile.lock b/Gemfile.lock index 8f6216d..1572750 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,19 +1,19 @@ PATH remote: . specs: - ips_test_kit (0.0.1) - inferno_core (>= 0.0.3) + ips_test_kit (0.0.2) + inferno_core (= 0.0.5) GEM remote: https://rubygems.org/ specs: - activesupport (6.1.3.2) + activesupport (6.1.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - addressable (2.7.0) + addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) bcp47 (0.3.3) i18n @@ -21,6 +21,7 @@ GEM byebug (11.1.3) coderay (1.1.3) concurrent-ruby (1.1.9) + connection_pool (2.2.5) crack (0.4.5) rexml database_cleaner (1.99.0) @@ -40,10 +41,10 @@ GEM dry-container (0.8.0) concurrent-ruby (~> 1.0) dry-configurable (~> 0.1, >= 0.1.3) - dry-core (0.6.0) + dry-core (0.7.1) concurrent-ruby (~> 1.0) dry-equalizer (0.3.0) - dry-inflector (0.2.0) + dry-inflector (0.2.1) dry-logic (1.2.0) concurrent-ruby (~> 1.0) dry-core (~> 0.5, >= 0.5) @@ -68,19 +69,25 @@ GEM dry-logic (~> 1.0, >= 1.0.2) factory_bot (6.2.0) activesupport (>= 5.0.0) - faraday (1.4.2) + faraday (1.7.0) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0.1) faraday-net_http (~> 1.0) faraday-net_http_persistent (~> 1.1) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) multipart-post (>= 1.2, < 3) ruby2_keywords (>= 0.0.4) faraday-em_http (1.0.0) faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) + faraday-httpclient (1.0.1) faraday-net_http (1.0.1) - faraday-net_http_persistent (1.1.0) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) fhir_client (4.0.6) activesupport (>= 3) addressable (>= 2.3) @@ -92,21 +99,21 @@ GEM rack (>= 1.5) rest-client (~> 2.0) tilt (>= 1.1) - fhir_dstu2_models (1.0.11) + fhir_dstu2_models (1.1.0) bcp47 (>= 0.3) date_time_precision (>= 0.8) mime-types (>= 3.0) - nokogiri (>= 1.10.4) - fhir_models (4.1.2) + nokogiri (>= 1.11.4) + fhir_models (4.2.0) bcp47 (>= 0.3) date_time_precision (>= 0.8) mime-types (>= 3.0) - nokogiri (>= 1.10.4) - fhir_stu3_models (3.0.2) + nokogiri (>= 1.11.4) + fhir_stu3_models (3.1.0) bcp47 (>= 0.3) date_time_precision (>= 0.8) mime-types (>= 3.0) - nokogiri (>= 1.10.4) + nokogiri (>= 1.11.4) hanami-controller (1.3.3) hanami-utils (~> 1.3) rack (~> 2.0) @@ -127,13 +134,14 @@ GEM i18n (1.8.10) concurrent-ruby (~> 1.0) ice_nine (0.11.2) - inferno_core (0.0.3) + inferno_core (0.0.5) activesupport (~> 6.1) blueprinter (= 0.25.2) dotenv (~> 2.7) dry-system (= 0.18.1) faraday (~> 1.2) fhir_client (~> 4.0) + fhir_models (~> 4.2.0) hanami-controller (~> 1.3) hanami-router (~> 1.3) oj (~> 3.11) @@ -142,21 +150,22 @@ GEM puma (~> 5.3) rake (~> 13.0) sequel (~> 5.42) + sidekiq (~> 6.2.1) sqlite3 (~> 1.4) jwt (2.2.3) method_source (1.0.0) mime-types (3.3.1) mime-types-data (~> 3.2015) - mime-types-data (3.2021.0225) + mime-types-data (3.2021.0704) minitest (5.14.4) multi_json (1.15.0) multi_xml (0.6.0) multipart-post (2.1.1) netrc (0.11.0) - nio4r (2.5.7) - nokogiri (1.11.7-x86_64-darwin) + nio4r (2.5.8) + nokogiri (1.12.2-x86_64-darwin) racc (~> 1.4) - nokogiri (1.11.7-x86_64-linux) + nokogiri (1.12.2-x86_64-linux) racc (~> 1.4) oauth2 (1.4.7) faraday (>= 0.8, < 2.0) @@ -164,7 +173,7 @@ GEM multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) - oj (3.11.6) + oj (3.13.1) pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) @@ -172,11 +181,12 @@ GEM byebug (~> 11.0) pry (~> 0.10) public_suffix (4.0.6) - puma (5.3.2) + puma (5.4.0) nio4r (~> 2.0) racc (1.5.2) rack (2.2.3) - rake (13.0.3) + rake (13.0.6) + redis (4.4.0) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) @@ -196,8 +206,12 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.10.0) rspec-support (3.10.2) - ruby2_keywords (0.0.4) - sequel (5.45.0) + ruby2_keywords (0.0.5) + sequel (5.47.0) + sidekiq (6.2.1) + connection_pool (>= 2.2.2) + rack (~> 2.0) + redis (>= 4.2.0) sqlite3 (1.4.2) tilt (2.0.10) transproc (1.1.1) diff --git a/README.md b/README.md index 2d8ccc7..e325ae4 100644 --- a/README.md +++ b/README.md @@ -14,5 +14,7 @@ these tests so that you don't have to configure ruby locally. - Clone this repo. - Run `docker-compose build` in this repo. - Run `docker-compose pull` in this repo. +- Run `docker-compose run inferno bundle exec rake db:migrate` to set up the + database. - Run `docker-compose up` in this repo. - Navigate to `http://localhost:4567`. The IPS test suite will be available. diff --git a/Rakefile b/Rakefile index aa3ea3d..5fbb673 100644 --- a/Rakefile +++ b/Rakefile @@ -4,3 +4,12 @@ begin task default: :spec rescue LoadError # rubocop:disable Lint/SuppressedException end + +namespace :db do + desc 'Apply changes to the database' + task :migrate do + require 'inferno' + + Inferno::Application.start(:db) + end +end diff --git a/data/redis/.keep b/data/redis/.keep new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml index a82adbd..5837097 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,3 +13,16 @@ services: image: infernocommunity/fhir-validator-service volumes: - ./lib/ips/igs:/home/igs + redis: + image: redis + volumes: + - ./data/redis:/data + command: redis-server --appendonly yes + worker: + build: + context: ./ + volumes: + - ./data:/opt/inferno/data + command: bundle exec sidekiq -r ./worker.rb + depends_on: + - redis diff --git a/ips_test_kit.gemspec b/ips_test_kit.gemspec index e848098..90621a4 100644 --- a/ips_test_kit.gemspec +++ b/ips_test_kit.gemspec @@ -11,8 +11,8 @@ Gem::Specification.new do |spec| spec.summary = 'A collection of tests for the International Patient Summary FHIR Implementation Guide' spec.description = 'A collection of tests for the International Patient Summary FHIR Implementation Guide' spec.homepage = 'https://github.com/inferno_community/ips-test-kit' - spec.license = 'Apache 2.0' - spec.add_runtime_dependency 'inferno_core', '>= 0.0.3' + spec.license = 'Apache-2.0' + spec.add_runtime_dependency 'inferno_core', '0.0.5' spec.add_development_dependency 'database_cleaner-sequel', '~> 1.8' spec.add_development_dependency 'factory_bot', '~> 6.1' spec.add_development_dependency 'rspec', '~> 3.10' diff --git a/lib/ips/document_operation.rb b/lib/ips/document_operation.rb index 57bd918..c0b3a4f 100644 --- a/lib/ips/document_operation.rb +++ b/lib/ips/document_operation.rb @@ -54,7 +54,7 @@ class DocumentOperation < Inferno::TestGroup composition = resource references_in_composition = [] - walk_resource(composition) do |value, meta, _path| + composition.each_element do |value, meta, _path| next if meta['type'] != 'Reference' next if value.reference.blank? diff --git a/lib/ips/version.rb b/lib/ips/version.rb index ad4bd61..fd9f57f 100644 --- a/lib/ips/version.rb +++ b/lib/ips/version.rb @@ -1,3 +1,3 @@ module IPS - VERSION = '0.0.1'.freeze + VERSION = '0.0.2'.freeze end diff --git a/spec/ips/condition_spec.rb b/spec/ips/condition_spec.rb index 54b5077..9162906 100644 --- a/spec/ips/condition_spec.rb +++ b/spec/ips/condition_spec.rb @@ -1,6 +1,7 @@ RSpec.describe IPS::Condition do let(:suite) { Inferno::Repositories::TestSuites.new.find('ips') } let(:group) { suite.groups[1].groups[21] } + let(:session_data_repo) { Inferno::Repositories::SessionData.new } let(:test_session) { repo_create(:test_session, test_suite_id: 'ips') } let(:url) { 'http://example.com/fhir' } let(:error_outcome) { FHIR::OperationOutcome.new(issue: [{ severity: 'error' }]) } @@ -8,8 +9,10 @@ def run(runnable, inputs = {}) test_run_params = { test_session_id: test_session.id }.merge(runnable.reference_hash) test_run = Inferno::Repositories::TestRuns.new.create(test_run_params) - Inferno::TestRunner.new(test_session: test_session, test_run: test_run).run(runnable, inputs) - Inferno::Repositories::TestRuns.new.results_for_test_run(test_run.id) + inputs.each do |name, value| + session_data_repo.save(test_session_id: test_session.id, name: name, value: value) + end + Inferno::TestRunner.new(test_session: test_session, test_run: test_run).run(runnable) end describe 'read test' do @@ -21,7 +24,7 @@ def run(runnable, inputs = {}) stub_request(:get, "#{url}/Condition/#{condition_id}") .to_return(status: 200, body: resource.to_json) - result = run(test, url: url, condition_id: condition_id).first + result = run(test, url: url, condition_id: condition_id) expect(result.result).to eq('pass') end @@ -31,7 +34,7 @@ def run(runnable, inputs = {}) stub_request(:get, "#{url}/Condition/#{condition_id}") .to_return(status: 201, body: resource.to_json) - result = run(test, url: url, condition_id: condition_id).first + result = run(test, url: url, condition_id: condition_id) expect(result.result).to eq('fail') expect(result.result_message).to match(/200/) @@ -42,7 +45,7 @@ def run(runnable, inputs = {}) stub_request(:get, "#{url}/Condition/#{condition_id}") .to_return(status: 200, body: resource.to_json) - result = run(test, url: url, condition_id: condition_id).first + result = run(test, url: url, condition_id: condition_id) expect(result.result).to eq('fail') expect(result.result_message).to match(/Condition/) @@ -53,7 +56,7 @@ def run(runnable, inputs = {}) stub_request(:get, "#{url}/Condition/#{condition_id}") .to_return(status: 200, body: resource.to_json) - result = run(test, url: url, condition_id: condition_id).first + result = run(test, url: url, condition_id: condition_id) expect(result.result).to eq('fail') expect(result.result_message).to match(/resource with id/) @@ -76,7 +79,7 @@ def run(runnable, inputs = {}) response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('pass') end @@ -94,7 +97,7 @@ def run(runnable, inputs = {}) response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') end diff --git a/spec/ips/document_operation_spec.rb b/spec/ips/document_operation_spec.rb index c3fea60..7e738f9 100644 --- a/spec/ips/document_operation_spec.rb +++ b/spec/ips/document_operation_spec.rb @@ -3,6 +3,7 @@ RSpec.describe IPS::DocumentOperation do let(:suite) { Inferno::Repositories::TestSuites.new.find('ips') } let(:group) { suite.groups.first.groups.first } + let(:session_data_repo) { Inferno::Repositories::SessionData.new } let(:test_session) { repo_create(:test_session, test_suite_id: 'ips') } let(:url) { 'http://example.com/fhir' } let(:error_outcome) { FHIR::OperationOutcome.new(issue: [{ severity: 'error' }]) } @@ -15,8 +16,10 @@ def run(runnable, inputs = {}) test_run_params = { test_session_id: test_session.id }.merge(runnable.reference_hash) test_run = Inferno::Repositories::TestRuns.new.create(test_run_params) - Inferno::TestRunner.new(test_session: test_session, test_run: test_run).run(runnable, inputs) - Inferno::Repositories::TestRuns.new.results_for_test_run(test_run.id) + inputs.each do |name, value| + session_data_repo.save(test_session_id: test_session.id, name: name, value: value) + end + Inferno::TestRunner.new(test_session: test_session, test_run: test_run).run(runnable) end describe 'Capability test' do @@ -41,7 +44,7 @@ def run(runnable, inputs = {}) stub_request(:get, "#{url}/metadata") .to_return(status: 200, body: resource.to_json) - result = run(test, { url: url }).first + result = run(test, { url: url }) expect(stubbed_request).to have_been_made.once expect(result.result).to eq('pass') @@ -52,7 +55,7 @@ def run(runnable, inputs = {}) stub_request(:get, "#{url}/metadata") .to_return(status: 500) - result = run(test, { url: url }).first + result = run(test, { url: url }) expect(stubbed_request).to have_been_made.at_least_once expect(result.result).to eq('fail') @@ -89,7 +92,7 @@ def run(runnable, inputs = {}) .with(query: { persist: true }) .to_return(status: 200, body: bundle.to_json) - result = run(test, { url: url, composition_id: composition_id }).first + result = run(test, { url: url, composition_id: composition_id }) expect(result.result).to eq('pass') expect(read_request).to have_been_made.once @@ -106,7 +109,7 @@ def run(runnable, inputs = {}) stub_request(:get, "#{url}/Composition/#{composition_id}") .to_return(status: 200, body: composition.to_json) - result = run(test, { url: url, composition_id: composition_id }).first + result = run(test, { url: url, composition_id: composition_id }) expect(result.result).to eq('fail') expect(read_request).to have_been_made.once @@ -138,7 +141,7 @@ def run(runnable, inputs = {}) .with(query: { persist: true }) .to_return(status: 200, body: bundle.to_json) - result = run(test, { url: url, composition_id: composition_id }).first + result = run(test, { url: url, composition_id: composition_id }) expect(result.result).to eq('fail') expect(read_request).to have_been_made.once @@ -164,7 +167,7 @@ def run(runnable, inputs = {}) test_session_id: test_session.id, response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('pass') end @@ -177,7 +180,7 @@ def run(runnable, inputs = {}) response_body: FHIR::Patient.new.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('skip') end @@ -195,7 +198,7 @@ def run(runnable, inputs = {}) response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') expect(result.result_message).to match(/Resource does not conform/) @@ -218,7 +221,7 @@ def run(runnable, inputs = {}) .with(query: hash_including({})) .to_return(status: 200, body: FHIR::OperationOutcome.new.to_json) - result = run(test).first + result = run(test) expect(result.result).to eq('pass') end @@ -231,7 +234,7 @@ def run(runnable, inputs = {}) response_body: FHIR::Patient.new.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('skip') end @@ -249,7 +252,7 @@ def run(runnable, inputs = {}) .with(query: hash_including({})) .to_return(status: 200, body: FHIR::OperationOutcome.new.to_json) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') expect(result.result_message).to match(/first entry/) @@ -268,7 +271,7 @@ def run(runnable, inputs = {}) response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') expect(result.result_message).to match(/Resource does not conform/) @@ -291,7 +294,7 @@ def run(runnable, inputs = {}) .with(query: hash_including({})) .to_return(status: 200, body: FHIR::OperationOutcome.new.to_json) - result = run(test).first + result = run(test) expect(result.result).to eq('pass') end @@ -304,7 +307,7 @@ def run(runnable, inputs = {}) response_body: FHIR::Patient.new.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('skip') end @@ -318,7 +321,7 @@ def run(runnable, inputs = {}) response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') expect(result.result_message).to match(/does not contain/) @@ -337,7 +340,7 @@ def run(runnable, inputs = {}) response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') expect(result.result_message).to match(/bundle entries are invalid/) @@ -360,7 +363,7 @@ def run(runnable, inputs = {}) .with(query: hash_including({})) .to_return(status: 200, body: FHIR::OperationOutcome.new.to_json) - result = run(test).first + result = run(test) expect(result.result).to eq('pass') end @@ -373,7 +376,7 @@ def run(runnable, inputs = {}) response_body: FHIR::Patient.new.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('skip') end @@ -387,7 +390,7 @@ def run(runnable, inputs = {}) response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') expect(result.result_message).to match(/does not contain/) @@ -406,7 +409,7 @@ def run(runnable, inputs = {}) response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') expect(result.result_message).to match(/bundle entries are invalid/) @@ -429,7 +432,7 @@ def run(runnable, inputs = {}) .with(query: hash_including({})) .to_return(status: 200, body: FHIR::OperationOutcome.new.to_json) - result = run(test).first + result = run(test) expect(result.result).to eq('pass') end @@ -442,7 +445,7 @@ def run(runnable, inputs = {}) response_body: FHIR::Patient.new.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('skip') end @@ -456,7 +459,7 @@ def run(runnable, inputs = {}) response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') expect(result.result_message).to match(/does not contain/) @@ -475,7 +478,7 @@ def run(runnable, inputs = {}) response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') expect(result.result_message).to match(/bundle entries are invalid/) diff --git a/spec/ips/summary_operation_spec.rb b/spec/ips/summary_operation_spec.rb index ff25d0a..f99625b 100644 --- a/spec/ips/summary_operation_spec.rb +++ b/spec/ips/summary_operation_spec.rb @@ -3,6 +3,7 @@ RSpec.describe IPS::SummaryOperation do let(:suite) { Inferno::Repositories::TestSuites.new.find('ips') } let(:group) { suite.groups.first.groups.last } + let(:session_data_repo) { Inferno::Repositories::SessionData.new } let(:test_session) { repo_create(:test_session, test_suite_id: 'ips') } let(:url) { 'http://example.com/fhir' } let(:error_outcome) { FHIR::OperationOutcome.new(issue: [{ severity: 'error' }]) } @@ -15,8 +16,10 @@ def run(runnable, inputs = {}) test_run_params = { test_session_id: test_session.id }.merge(runnable.reference_hash) test_run = Inferno::Repositories::TestRuns.new.create(test_run_params) - Inferno::TestRunner.new(test_session: test_session, test_run: test_run).run(runnable, inputs) - Inferno::Repositories::TestRuns.new.results_for_test_run(test_run.id) + inputs.each do |name, value| + session_data_repo.save(test_session_id: test_session.id, name: name, value: value) + end + Inferno::TestRunner.new(test_session: test_session, test_run: test_run).run(runnable) end describe 'Capability test' do @@ -41,7 +44,7 @@ def run(runnable, inputs = {}) stub_request(:get, "#{url}/metadata") .to_return(status: 200, body: resource.to_json) - result = run(test, { url: url }).first + result = run(test, { url: url }) expect(stubbed_request).to have_been_made.once expect(result.result).to eq('pass') @@ -52,7 +55,7 @@ def run(runnable, inputs = {}) stub_request(:get, "#{url}/metadata") .to_return(status: 500) - result = run(test, { url: url }).first + result = run(test, { url: url }) expect(stubbed_request).to have_been_made.at_least_once expect(result.result).to eq('fail') @@ -65,7 +68,7 @@ def run(runnable, inputs = {}) stub_request(:get, "#{url}/metadata") .to_return(status: 200, body: resource.to_json) - result = run(test, { url: url }).first + result = run(test, { url: url }) expect(stubbed_request).to have_been_made.once expect(result.result).to eq('fail') @@ -87,7 +90,7 @@ def run(runnable, inputs = {}) stub_request(:post, "#{url}/Patient/#{patient_id}/$summary") .to_return(status: 200, body: resource.to_json) - result = run(test, { url: url, patient_id: patient_id }).first + result = run(test, { url: url, patient_id: patient_id }) expect(stubbed_request).to have_been_made.once expect(result.result).to eq('pass') @@ -99,7 +102,7 @@ def run(runnable, inputs = {}) stub_request(:post, "#{url}/Patient/#{patient_id}/$summary") .to_return(status: 201, body: resource.to_json) - result = run(test, { url: url, patient_id: patient_id }).first + result = run(test, { url: url, patient_id: patient_id }) expect(stubbed_request).to have_been_made.once expect(result.result).to eq('fail') @@ -111,7 +114,7 @@ def run(runnable, inputs = {}) stub_request(:post, "#{url}/Patient/#{patient_id}/$summary") .to_return(status: 200, body: FHIR::Patient.new.to_json) - result = run(test, { url: url, patient_id: patient_id }).first + result = run(test, { url: url, patient_id: patient_id }) expect(stubbed_request).to have_been_made.once expect(result.result).to eq('fail') @@ -128,7 +131,7 @@ def run(runnable, inputs = {}) stub_request(:post, "#{url}/Patient/#{patient_id}/$summary") .to_return(status: 200, body: resource.to_json) - result = run(test, { url: url, patient_id: patient_id }).first + result = run(test, { url: url, patient_id: patient_id }) expect(stubbed_request).to have_been_made.once expect(result.result).to eq('fail') @@ -152,7 +155,7 @@ def run(runnable, inputs = {}) .with(query: hash_including({})) .to_return(status: 200, body: FHIR::OperationOutcome.new.to_json) - result = run(test).first + result = run(test) expect(result.result).to eq('pass') end @@ -165,7 +168,7 @@ def run(runnable, inputs = {}) response_body: FHIR::Patient.new.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('skip') end @@ -183,7 +186,7 @@ def run(runnable, inputs = {}) .with(query: hash_including({})) .to_return(status: 200, body: FHIR::OperationOutcome.new.to_json) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') expect(result.result_message).to match(/first entry/) @@ -202,7 +205,7 @@ def run(runnable, inputs = {}) response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') expect(result.result_message).to match(/Resource does not conform/) @@ -225,7 +228,7 @@ def run(runnable, inputs = {}) .with(query: hash_including({})) .to_return(status: 200, body: FHIR::OperationOutcome.new.to_json) - result = run(test).first + result = run(test) expect(result.result).to eq('pass') end @@ -238,7 +241,7 @@ def run(runnable, inputs = {}) response_body: FHIR::Patient.new.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('skip') end @@ -252,7 +255,7 @@ def run(runnable, inputs = {}) response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') expect(result.result_message).to match(/does not contain/) @@ -271,7 +274,7 @@ def run(runnable, inputs = {}) response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') expect(result.result_message).to match(/bundle entries are invalid/) @@ -294,7 +297,7 @@ def run(runnable, inputs = {}) .with(query: hash_including({})) .to_return(status: 200, body: FHIR::OperationOutcome.new.to_json) - result = run(test).first + result = run(test) expect(result.result).to eq('pass') end @@ -307,7 +310,7 @@ def run(runnable, inputs = {}) response_body: FHIR::Patient.new.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('skip') end @@ -321,7 +324,7 @@ def run(runnable, inputs = {}) response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') expect(result.result_message).to match(/does not contain/) @@ -340,7 +343,7 @@ def run(runnable, inputs = {}) response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') expect(result.result_message).to match(/bundle entries are invalid/) @@ -363,7 +366,7 @@ def run(runnable, inputs = {}) .with(query: hash_including({})) .to_return(status: 200, body: FHIR::OperationOutcome.new.to_json) - result = run(test).first + result = run(test) expect(result.result).to eq('pass') end @@ -376,7 +379,7 @@ def run(runnable, inputs = {}) response_body: FHIR::Patient.new.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('skip') end @@ -390,7 +393,7 @@ def run(runnable, inputs = {}) response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') expect(result.result_message).to match(/does not contain/) @@ -409,7 +412,7 @@ def run(runnable, inputs = {}) response_body: resource.to_json ) - result = run(test).first + result = run(test) expect(result.result).to eq('fail') expect(result.result_message).to match(/bundle entries are invalid/) diff --git a/worker.rb b/worker.rb new file mode 100644 index 0000000..d0183c3 --- /dev/null +++ b/worker.rb @@ -0,0 +1,3 @@ +require 'inferno' + +Inferno::Application.finalize!