-
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-3428-share-session
- Loading branch information
Showing
18 changed files
with
158 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.1.2 | ||
3.3.6 |
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,2 +1,2 @@ | ||
ruby 3.1.2 | ||
ruby 3.3.6 | ||
nodejs 20.17.0 |
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,6 +1,6 @@ | ||
source 'https://rubygems.org' | ||
|
||
ruby '3.1.2' | ||
ruby '3.3.6' | ||
|
||
gemspec | ||
|
||
|
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 |
---|---|---|
|
@@ -352,7 +352,7 @@ DEPENDENCIES | |
yard-junk | ||
|
||
RUBY VERSION | ||
ruby 3.1.2p20 | ||
ruby 3.3.6p108 | ||
|
||
BUNDLED WITH | ||
2.4.22 |
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
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 +1 @@ | ||
3.1.2 | ||
3.3.6 |
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 +1 @@ | ||
ruby 3.1.2 | ||
ruby 3.3.6 |
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,4 +1,4 @@ | ||
FROM ruby:3.1.2 | ||
FROM ruby:3.3.6 | ||
|
||
ENV INSTALL_PATH=/opt/inferno/ | ||
ENV APP_ENV=production | ||
|
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,133 @@ | ||
RSpec.shared_examples 'platform_deployable_test_kit' do | ||
let(:test_kit_location) do | ||
Object.const_source_location(described_class.name).first | ||
end | ||
let(:test_kit_gem) do | ||
Bundler.definition.specs.find { |gem| test_kit_location.start_with? gem.full_gem_path } | ||
end | ||
let(:base_path) do | ||
test_kit_gem.full_gem_path | ||
end | ||
let(:test_kit) do | ||
described_class.const_get('Metadata') | ||
rescue NameError | ||
skip 'TestKit must be defined first' | ||
end | ||
let(:suites) do | ||
test_kit.suite_ids.map { |id| Inferno::Repositories::TestSuites.new.find(id) } | ||
end | ||
|
||
describe 'TestKit' do | ||
it 'defines test kit in the Metadata class' do | ||
error_message = | ||
"Define #{described_class.name}::Metadata at " \ | ||
"lib/#{described_class.name.underscore}/metadata.rb and require it in " \ | ||
"lib/#{described_class.name.underscore}.rb\n" | ||
|
||
expect { described_class.const_get('Metadata') }.to_not raise_error(NameError), error_message | ||
|
||
expect(described_class.const_get('Metadata') < Inferno::Entities::TestKit).to be(true) | ||
end | ||
|
||
it 'defines all required fields' do | ||
required_fields = [ | ||
:id, | ||
:title, | ||
:description, | ||
:suite_ids, | ||
:version, | ||
:maturity | ||
] | ||
|
||
required_fields.each do |field_name| | ||
expect(test_kit.send(field_name)).to be_present | ||
end | ||
end | ||
|
||
it 'has a description with a <!-- break -->' do | ||
error_message = | ||
'The test kit description must begin with one paragraph followed by "<!-- ' \ | ||
'break -->". The portion of the description above the break is displayed ' \ | ||
"on the test kit listing page.\n" | ||
|
||
expect(test_kit.description).to include('<!-- break -->'), error_message | ||
end | ||
|
||
it 'has a maturity of "Low", "Medium", or "High"' do | ||
expect(['Low', 'Medium', 'High']).to include(test_kit.maturity) # rubocop:disable RSpec/ExpectActual | ||
end | ||
|
||
it 'uses the correct ruby version in its Dockerfile' do | ||
dockerfile_path = File.join(base_path, 'Dockerfile') | ||
dockerfile_contents = File.read(dockerfile_path) | ||
|
||
expect(dockerfile_contents.lines.first.chomp).to eq('FROM ruby:3.3.6') | ||
end | ||
end | ||
|
||
describe 'suites' do | ||
it 'relies on the test kit version rather than defining the version in the suites' do | ||
suite_paths = suites.map { |suite| Object.const_source_location(suite.name).first } | ||
suite_contents = suite_paths.map { |path| File.read(path) } | ||
|
||
suite_contents.each_with_index do |suite, i| | ||
error_message = | ||
"Suite at #{suite_paths[i]} should not explicitly declare a version, as " \ | ||
'its version can now be determined by the version of its Test Kit.' \ | ||
"Remove the `version` method call in the suite definition.\n" | ||
|
||
expect(suite).to_not match(/^\s+version(\s|\()\S+\)?/), error_message | ||
end | ||
end | ||
|
||
it 'contains standard links' do | ||
suites.each do |suite| | ||
link_labels = suite.links.map { |link| link[:label] } | ||
|
||
expected_labels = ['Report Issue', 'Open Source', 'Download'] | ||
|
||
error_message = | ||
"Include the standard 'Report Issue', 'Open Source', and 'Download links in " \ | ||
'each suite.\n' | ||
expect(link_labels).to match_array(expected_labels), error_message | ||
end | ||
end | ||
end | ||
|
||
describe 'presets' do | ||
it 'includes presets in the gem' do | ||
presets = Dir[ | ||
File.join(base_path, 'config', 'presets', '*.json'), | ||
File.join(base_path, 'config', 'presets', '*.json.erb') | ||
].map { |file_path| file_path.delete_prefix "#{Dir.pwd}/" } | ||
|
||
missing_presets = presets - test_kit_gem.files | ||
|
||
error_message = | ||
"The following presets are not included in the gem: #{missing_presets.join(', ')}\n" \ | ||
"Ensure that config/presets is included in spec.files in #{test_kit_gem.name}.gemspec" | ||
|
||
expect(missing_presets).to be_empty, error_message | ||
end | ||
end | ||
|
||
describe 'gemspec' do | ||
it 'uses git to determine files to include in the gem' do | ||
gemspec_contents = File.read(File.join(base_path, "#{test_kit_gem.name}.gemspec")) | ||
|
||
error_message = | ||
'Use git to determine which files to include in the gem. In ' \ | ||
"#{test_kit_gem.name}.gemspec, use: " \ | ||
"spec.files = `[ -d .git ] && git ls-files -z lib config/presets LICENSE`.split(\"\\x0\")\n" | ||
|
||
expect(gemspec_contents).to include('[ -d .git ] && git ls-files'), error_message | ||
end | ||
|
||
it 'includes the inferno test kit metadata tag' do | ||
error_message = | ||
%(Add "spec.metadata['inferno_test_kit'] = 'true'" to #{test_kit_gem.name}.gemspec) | ||
|
||
expect(test_kit_gem.metadata['inferno_test_kit']).to eq('true'), error_message | ||
end | ||
end | ||
end |