inferno_core 0.6.1 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/lib/inferno/apps/cli/evaluate.rb +22 -12
  3. data/lib/inferno/apps/cli/templates/Dockerfile.tt +0 -1
  4. data/lib/inferno/apps/cli/templates/README.md.tt +10 -0
  5. data/lib/inferno/apps/cli/templates/docs/Overview.md +7 -0
  6. data/lib/inferno/apps/cli/templates/docs/README.md.tt +10 -0
  7. data/lib/inferno/apps/cli/templates/docs/_Footer.md +5 -0
  8. data/lib/inferno/apps/cli/templates/docs/_Sidebar.md +5 -0
  9. data/lib/inferno/config/boot/presets.rb +1 -1
  10. data/lib/inferno/dsl/auth_info.rb +87 -1
  11. data/lib/inferno/dsl/configurable.rb +14 -1
  12. data/lib/inferno/dsl/fhir_client.rb +66 -0
  13. data/lib/inferno/dsl/fhir_evaluation/evaluation_context.rb +4 -2
  14. data/lib/inferno/dsl/fhir_evaluation/evaluator.rb +8 -3
  15. data/lib/inferno/dsl/fhir_evaluation/profile_conformance_helper.rb +66 -0
  16. data/lib/inferno/dsl/fhir_evaluation/reference_extractor.rb +61 -0
  17. data/lib/inferno/dsl/fhir_evaluation/rules/all_must_supports_present.rb +379 -0
  18. data/lib/inferno/dsl/fhir_evaluation/rules/all_references_resolve.rb +53 -0
  19. data/lib/inferno/dsl/fhir_evaluation/rules/all_resources_reachable.rb +63 -0
  20. data/lib/inferno/dsl/fhir_resource_navigation.rb +226 -0
  21. data/lib/inferno/dsl/input_output_handling.rb +1 -0
  22. data/lib/inferno/dsl/must_support_metadata_extractor.rb +366 -0
  23. data/lib/inferno/dsl/primitive_type.rb +9 -0
  24. data/lib/inferno/dsl/runnable.rb +13 -1
  25. data/lib/inferno/dsl/value_extractor.rb +136 -0
  26. data/lib/inferno/dsl.rb +1 -0
  27. data/lib/inferno/entities/ig.rb +46 -24
  28. data/lib/inferno/entities/input.rb +63 -3
  29. data/lib/inferno/public/bundle.js +16 -16
  30. data/lib/inferno/repositories/session_data.rb +2 -0
  31. data/lib/inferno/version.rb +1 -1
  32. data/spec/runnable_context.rb +8 -5
  33. data/spec/shared/test_kit_examples.rb +23 -1
  34. metadata +15 -2
@@ -112,6 +112,8 @@ module Inferno
112
112
  auth =
113
113
  if params[:value].is_a? String
114
114
  DSL::AuthInfo.new(JSON.parse(params[:value]))
115
+ elsif params[:value].is_a? Hash
116
+ DSL::AuthInfo.new(params[:value])
115
117
  elsif !params[:value].is_a? DSL::AuthInfo
116
118
  raise Exceptions::BadSessionDataType.new(
117
119
  params[:name],
@@ -1,4 +1,4 @@
1
1
  module Inferno
2
2
  # Standard patterns for gem versions: https://guides.rubygems.org/patterns/
3
- VERSION = '0.6.1'.freeze
3
+ VERSION = '0.6.3'.freeze
4
4
  end
@@ -5,24 +5,27 @@ RSpec.shared_context('when testing a runnable') do
5
5
  let(:test_session) { repo_create(:test_session, test_suite_id: suite_id) }
6
6
 
7
7
  before do
8
- allow(described_class).to receive(:suite).and_return(suite) if described_class.parent.nil?
8
+ if described_class.respond_to?(:parent) && described_class.parent.nil?
9
+ allow(described_class).to receive(:suite).and_return(suite)
10
+ end
9
11
  rescue NameError
10
12
  raise StandardError, "No suite id defined. Add `let(:suite_id) { 'your_suite_id' }` to the spec"
11
13
  end
12
14
 
13
- def run(runnable, inputs = {})
15
+ def run(runnable, inputs = {}, scratch = {})
14
16
  test_run_params = { test_session_id: test_session.id }.merge(runnable.reference_hash)
15
17
  test_run = Inferno::Repositories::TestRuns.new.create(test_run_params)
16
- inputs.each do |name, value|
18
+ inputs.each do |original_name, value|
19
+ name = runnable.config.input_name(original_name).presence || original_name
17
20
  session_data_repo.save(
18
21
  test_session_id: test_session.id,
19
22
  name:,
20
23
  value:,
21
- type: runnable.config.input_type(name)
24
+ type: runnable.available_inputs[name.to_sym]&.type
22
25
  )
23
26
  end
24
27
 
25
- Inferno::TestRunner.new(test_session:, test_run:).run(runnable)
28
+ Inferno::TestRunner.new(test_session:, test_run:).run(runnable, scratch)
26
29
  end
27
30
 
28
31
  # depth-first search looking for a runnable with a runtime id
@@ -16,6 +16,13 @@ RSpec.shared_examples 'platform_deployable_test_kit' do
16
16
  let(:suites) do
17
17
  test_kit.suite_ids.map { |id| Inferno::Repositories::TestSuites.new.find(id) }
18
18
  end
19
+ let(:tests) do
20
+ Inferno::Repositories::Tests.new.all.select do |test|
21
+ test_kit.suite_ids.include?(test.suite.id)
22
+ rescue NoMethodError
23
+ false
24
+ end
25
+ end
19
26
 
20
27
  describe 'TestKit' do
21
28
  it 'defines test kit in the Metadata class' do
@@ -89,7 +96,7 @@ RSpec.shared_examples 'platform_deployable_test_kit' do
89
96
  error_message =
90
97
  "Include the standard 'Report Issue', 'Open Source', and 'Download links in " \
91
98
  'each suite.\n'
92
- expect(link_labels).to match_array(expected_labels), error_message
99
+ expect(link_labels).to include(*expected_labels), error_message
93
100
  end
94
101
  end
95
102
  end
@@ -130,4 +137,19 @@ RSpec.shared_examples 'platform_deployable_test_kit' do
130
137
  expect(test_kit_gem.metadata['inferno_test_kit']).to eq('true'), error_message
131
138
  end
132
139
  end
140
+
141
+ describe 'test methods integrity' do
142
+ it 'ensures `fetch_all_bundled_resources` is not overriden in a Test' do
143
+ tests.each do |test|
144
+ error_msg = 'Integrity Error: `fetch_all_bundled_resources` is now implemented in Inferno Core. ' \
145
+ "It should no longer be defined in Test `#{test.id}`. Please remove the " \
146
+ '`fetch_all_bundled_resources` definition from that test to avoid conflicts.'
147
+
148
+ method_path = test.instance_method(:fetch_all_bundled_resources).source_location
149
+ expected_path = Inferno::Test.instance_method(:fetch_all_bundled_resources).source_location
150
+
151
+ expect(method_path).to eq(expected_path), error_msg
152
+ end
153
+ end
154
+ end
133
155
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inferno_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen MacVicar
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2025-01-22 00:00:00.000000000 Z
13
+ date: 2025-02-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -444,6 +444,10 @@ files:
444
444
  - lib/inferno/apps/cli/templates/data/redis/.keep
445
445
  - lib/inferno/apps/cli/templates/docker-compose.background.yml.tt
446
446
  - lib/inferno/apps/cli/templates/docker-compose.yml.tt
447
+ - lib/inferno/apps/cli/templates/docs/Overview.md
448
+ - lib/inferno/apps/cli/templates/docs/README.md.tt
449
+ - lib/inferno/apps/cli/templates/docs/_Footer.md
450
+ - lib/inferno/apps/cli/templates/docs/_Sidebar.md
447
451
  - lib/inferno/apps/cli/templates/lib/%library_name%.rb.tt
448
452
  - lib/inferno/apps/cli/templates/lib/%library_name%/igs/.keep
449
453
  - lib/inferno/apps/cli/templates/lib/%library_name%/igs/README.md
@@ -525,7 +529,13 @@ files:
525
529
  - lib/inferno/dsl/fhir_evaluation/evaluation_context.rb
526
530
  - lib/inferno/dsl/fhir_evaluation/evaluation_result.rb
527
531
  - lib/inferno/dsl/fhir_evaluation/evaluator.rb
532
+ - lib/inferno/dsl/fhir_evaluation/profile_conformance_helper.rb
533
+ - lib/inferno/dsl/fhir_evaluation/reference_extractor.rb
528
534
  - lib/inferno/dsl/fhir_evaluation/rule.rb
535
+ - lib/inferno/dsl/fhir_evaluation/rules/all_must_supports_present.rb
536
+ - lib/inferno/dsl/fhir_evaluation/rules/all_references_resolve.rb
537
+ - lib/inferno/dsl/fhir_evaluation/rules/all_resources_reachable.rb
538
+ - lib/inferno/dsl/fhir_resource_navigation.rb
529
539
  - lib/inferno/dsl/fhir_resource_validation.rb
530
540
  - lib/inferno/dsl/fhir_validation.rb
531
541
  - lib/inferno/dsl/fhirpath_evaluation.rb
@@ -536,7 +546,9 @@ files:
536
546
  - lib/inferno/dsl/jwks.rb
537
547
  - lib/inferno/dsl/links.rb
538
548
  - lib/inferno/dsl/messages.rb
549
+ - lib/inferno/dsl/must_support_metadata_extractor.rb
539
550
  - lib/inferno/dsl/oauth_credentials.rb
551
+ - lib/inferno/dsl/primitive_type.rb
540
552
  - lib/inferno/dsl/request_storage.rb
541
553
  - lib/inferno/dsl/results.rb
542
554
  - lib/inferno/dsl/resume_test_route.rb
@@ -544,6 +556,7 @@ files:
544
556
  - lib/inferno/dsl/suite_endpoint.rb
545
557
  - lib/inferno/dsl/suite_option.rb
546
558
  - lib/inferno/dsl/tcp_exception_handler.rb
559
+ - lib/inferno/dsl/value_extractor.rb
547
560
  - lib/inferno/entities.rb
548
561
  - lib/inferno/entities/attributes.rb
549
562
  - lib/inferno/entities/entity.rb