inferno_core 0.5.4 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/inferno/apps/cli/execute/console_outputter.rb +2 -2
- data/lib/inferno/apps/cli/new.rb +8 -3
- data/lib/inferno/apps/cli/suites.rb +0 -2
- data/lib/inferno/apps/cli/templates/%library_name%.gemspec.tt +3 -14
- data/lib/inferno/apps/cli/templates/.rubocop.yml +77 -0
- data/lib/inferno/apps/cli/templates/.ruby-version +1 -1
- data/lib/inferno/apps/cli/templates/.tool-versions +1 -1
- data/lib/inferno/apps/cli/templates/Dockerfile.tt +2 -1
- data/lib/inferno/apps/cli/templates/Gemfile.tt +7 -0
- data/lib/inferno/apps/cli/templates/lib/%library_name%/suite.rb.tt +1 -1
- data/lib/inferno/config/boot/suites.rb +1 -0
- data/lib/inferno/dsl/fhir_resource_validation.rb +7 -5
- data/lib/inferno/dsl/fhir_validation.rb +13 -7
- data/lib/inferno/dsl/suite_endpoint.rb +1 -1
- data/lib/inferno/public/bundle.js +17 -17
- data/lib/inferno/route_storage.rb +10 -0
- data/lib/inferno/spec_support.rb +2 -0
- data/lib/inferno/version.rb +1 -1
- data/lib/inferno.rb +1 -3
- data/spec/shared/test_kit_examples.rb +133 -0
- metadata +21 -4
data/lib/inferno/spec_support.rb
CHANGED
@@ -7,11 +7,13 @@ module Inferno
|
|
7
7
|
FACTORY_PATH = File.expand_path('../../spec/factories', __dir__).freeze
|
8
8
|
REQUEST_HELPER_PATH = File.expand_path('../../spec/request_helper', __dir__).freeze
|
9
9
|
RUNNABLE_HELPER_PATH = File.expand_path('../../spec/runnable_helper', __dir__).freeze
|
10
|
+
TEST_KIT_SPEC = File.expand_path('../../spec/shared/test_kit_examples', __dir__).freeze
|
10
11
|
|
11
12
|
def self.require_helpers
|
12
13
|
require FACTORY_BOT_SUPPORT_PATH
|
13
14
|
require RUNNABLE_HELPER_PATH
|
14
15
|
require REQUEST_HELPER_PATH
|
16
|
+
require TEST_KIT_SPEC
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
data/lib/inferno/version.rb
CHANGED
data/lib/inferno.rb
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
module Inferno
|
2
|
-
def self.routes
|
3
|
-
@routes ||= []
|
4
|
-
end
|
5
2
|
end
|
6
3
|
|
7
4
|
require_relative 'inferno/config/application'
|
@@ -14,3 +11,4 @@ require_relative 'inferno/spec_support'
|
|
14
11
|
require_relative 'inferno/test_runner'
|
15
12
|
require_relative 'inferno/version'
|
16
13
|
require_relative 'inferno/utils/static_assets'
|
14
|
+
require_relative 'inferno/route_storage'
|
@@ -0,0 +1,133 @@
|
|
1
|
+
RSpec.shared_examples 'platform_deployable_test_kit' do
|
2
|
+
let(:test_kit_location) do
|
3
|
+
Object.const_source_location(described_class.name).first
|
4
|
+
end
|
5
|
+
let(:test_kit_gem) do
|
6
|
+
Bundler.definition.specs.find { |gem| test_kit_location.start_with? gem.full_gem_path }
|
7
|
+
end
|
8
|
+
let(:base_path) do
|
9
|
+
test_kit_gem.full_gem_path
|
10
|
+
end
|
11
|
+
let(:test_kit) do
|
12
|
+
described_class.const_get('Metadata')
|
13
|
+
rescue NameError
|
14
|
+
skip 'TestKit must be defined first'
|
15
|
+
end
|
16
|
+
let(:suites) do
|
17
|
+
test_kit.suite_ids.map { |id| Inferno::Repositories::TestSuites.new.find(id) }
|
18
|
+
end
|
19
|
+
|
20
|
+
describe 'TestKit' do
|
21
|
+
it 'defines test kit in the Metadata class' do
|
22
|
+
error_message =
|
23
|
+
"Define #{described_class.name}::Metadata at " \
|
24
|
+
"lib/#{described_class.name.underscore}/metadata.rb and require it in " \
|
25
|
+
"lib/#{described_class.name.underscore}.rb\n"
|
26
|
+
|
27
|
+
expect { described_class.const_get('Metadata') }.to_not raise_error(NameError), error_message
|
28
|
+
|
29
|
+
expect(described_class.const_get('Metadata') < Inferno::Entities::TestKit).to be(true)
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'defines all required fields' do
|
33
|
+
required_fields = [
|
34
|
+
:id,
|
35
|
+
:title,
|
36
|
+
:description,
|
37
|
+
:suite_ids,
|
38
|
+
:version,
|
39
|
+
:maturity
|
40
|
+
]
|
41
|
+
|
42
|
+
required_fields.each do |field_name|
|
43
|
+
expect(test_kit.send(field_name)).to be_present
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'has a description with a <!-- break -->' do
|
48
|
+
error_message =
|
49
|
+
'The test kit description must begin with one paragraph followed by "<!-- ' \
|
50
|
+
'break -->". The portion of the description above the break is displayed ' \
|
51
|
+
"on the test kit listing page.\n"
|
52
|
+
|
53
|
+
expect(test_kit.description).to include('<!-- break -->'), error_message
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'has a maturity of "Low", "Medium", or "High"' do
|
57
|
+
expect(['Low', 'Medium', 'High']).to include(test_kit.maturity) # rubocop:disable RSpec/ExpectActual
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'uses the correct ruby version in its Dockerfile' do
|
61
|
+
dockerfile_path = File.join(base_path, 'Dockerfile')
|
62
|
+
dockerfile_contents = File.read(dockerfile_path)
|
63
|
+
|
64
|
+
expect(dockerfile_contents.lines.first.chomp).to eq('FROM ruby:3.3.6')
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
describe 'suites' do
|
69
|
+
it 'relies on the test kit version rather than defining the version in the suites' do
|
70
|
+
suite_paths = suites.map { |suite| Object.const_source_location(suite.name).first }
|
71
|
+
suite_contents = suite_paths.map { |path| File.read(path) }
|
72
|
+
|
73
|
+
suite_contents.each_with_index do |suite, i|
|
74
|
+
error_message =
|
75
|
+
"Suite at #{suite_paths[i]} should not explicitly declare a version, as " \
|
76
|
+
'its version can now be determined by the version of its Test Kit.' \
|
77
|
+
"Remove the `version` method call in the suite definition.\n"
|
78
|
+
|
79
|
+
expect(suite).to_not match(/^\s+version(\s|\()\S+\)?/), error_message
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
it 'contains standard links' do
|
84
|
+
suites.each do |suite|
|
85
|
+
link_labels = suite.links.map { |link| link[:label] }
|
86
|
+
|
87
|
+
expected_labels = ['Report Issue', 'Open Source', 'Download']
|
88
|
+
|
89
|
+
error_message =
|
90
|
+
"Include the standard 'Report Issue', 'Open Source', and 'Download links in " \
|
91
|
+
'each suite.\n'
|
92
|
+
expect(link_labels).to match_array(expected_labels), error_message
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
describe 'presets' do
|
98
|
+
it 'includes presets in the gem' do
|
99
|
+
presets = Dir[
|
100
|
+
File.join(base_path, 'config', 'presets', '*.json'),
|
101
|
+
File.join(base_path, 'config', 'presets', '*.json.erb')
|
102
|
+
].map { |file_path| file_path.delete_prefix "#{Dir.pwd}/" }
|
103
|
+
|
104
|
+
missing_presets = presets - test_kit_gem.files
|
105
|
+
|
106
|
+
error_message =
|
107
|
+
"The following presets are not included in the gem: #{missing_presets.join(', ')}\n" \
|
108
|
+
"Ensure that config/presets is included in spec.files in #{test_kit_gem.name}.gemspec"
|
109
|
+
|
110
|
+
expect(missing_presets).to be_empty, error_message
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
describe 'gemspec' do
|
115
|
+
it 'uses git to determine files to include in the gem' do
|
116
|
+
gemspec_contents = File.read(File.join(base_path, "#{test_kit_gem.name}.gemspec"))
|
117
|
+
|
118
|
+
error_message =
|
119
|
+
'Use git to determine which files to include in the gem. In ' \
|
120
|
+
"#{test_kit_gem.name}.gemspec, use: " \
|
121
|
+
"spec.files = `[ -d .git ] && git ls-files -z lib config/presets LICENSE`.split(\"\\x0\")\n"
|
122
|
+
|
123
|
+
expect(gemspec_contents).to include('[ -d .git ] && git ls-files'), error_message
|
124
|
+
end
|
125
|
+
|
126
|
+
it 'includes the inferno test kit metadata tag' do
|
127
|
+
error_message =
|
128
|
+
%(Add "spec.metadata['inferno_test_kit'] = 'true'" to #{test_kit_gem.name}.gemspec)
|
129
|
+
|
130
|
+
expect(test_kit_gem.metadata['inferno_test_kit']).to eq('true'), error_message
|
131
|
+
end
|
132
|
+
end
|
133
|
+
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.
|
4
|
+
version: 0.6.1
|
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:
|
13
|
+
date: 2025-01-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -54,6 +54,20 @@ dependencies:
|
|
54
54
|
- - '='
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: 0.25.2
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: concurrent-ruby
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - '='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 1.3.4
|
64
|
+
type: :runtime
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - '='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 1.3.4
|
57
71
|
- !ruby/object:Gem::Dependency
|
58
72
|
name: dotenv
|
59
73
|
requirement: !ruby/object:Gem::Requirement
|
@@ -412,6 +426,7 @@ files:
|
|
412
426
|
- lib/inferno/apps/cli/templates/.env.test
|
413
427
|
- lib/inferno/apps/cli/templates/.gitignore
|
414
428
|
- lib/inferno/apps/cli/templates/.rspec
|
429
|
+
- lib/inferno/apps/cli/templates/.rubocop.yml
|
415
430
|
- lib/inferno/apps/cli/templates/.ruby-version
|
416
431
|
- lib/inferno/apps/cli/templates/.tool-versions
|
417
432
|
- lib/inferno/apps/cli/templates/Dockerfile.tt
|
@@ -586,6 +601,7 @@ files:
|
|
586
601
|
- lib/inferno/repositories/validator_sessions.rb
|
587
602
|
- lib/inferno/result_collection.rb
|
588
603
|
- lib/inferno/result_summarizer.rb
|
604
|
+
- lib/inferno/route_storage.rb
|
589
605
|
- lib/inferno/spec_support.rb
|
590
606
|
- lib/inferno/test_runner.rb
|
591
607
|
- lib/inferno/utils/ig_downloader.rb
|
@@ -614,6 +630,7 @@ files:
|
|
614
630
|
- spec/request_helper.rb
|
615
631
|
- spec/runnable_context.rb
|
616
632
|
- spec/runnable_helper.rb
|
633
|
+
- spec/shared/test_kit_examples.rb
|
617
634
|
- spec/spec_helper.rb
|
618
635
|
- spec/support/factory_bot.rb
|
619
636
|
homepage: https://github.com/inferno-framework/inferno-core
|
@@ -632,14 +649,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
632
649
|
requirements:
|
633
650
|
- - "~>"
|
634
651
|
- !ruby/object:Gem::Version
|
635
|
-
version: 3.
|
652
|
+
version: 3.3.6
|
636
653
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
637
654
|
requirements:
|
638
655
|
- - ">="
|
639
656
|
- !ruby/object:Gem::Version
|
640
657
|
version: '0'
|
641
658
|
requirements: []
|
642
|
-
rubygems_version: 3.
|
659
|
+
rubygems_version: 3.5.22
|
643
660
|
signing_key:
|
644
661
|
specification_version: 4
|
645
662
|
summary: Inferno Core is an open source tool for testing data exchanges enabled by
|