diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-25 15:08:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-25 15:08:19 +0300 |
commit | e6baeabaa9651d90b03bb64ffce75a2c3cb89aab (patch) | |
tree | 85f3cbd6e437b17be59505cf3ac4794c1838609e /spec/lib/gitlab/ci | |
parent | 5064bf8c5647d4c4430cbb4d097cf1592416de29 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/ci')
-rw-r--r-- | spec/lib/gitlab/ci/build/image_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/config/entry/image_spec.rb | 16 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/config/entry/root_spec.rb | 14 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/config/external/file/project_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/config/external/mapper_spec.rb | 26 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/config/external/processor_spec.rb | 20 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/config_spec.rb | 26 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/yaml_processor_spec.rb | 20 |
8 files changed, 64 insertions, 64 deletions
diff --git a/spec/lib/gitlab/ci/build/image_spec.rb b/spec/lib/gitlab/ci/build/image_spec.rb index 04bab9c58b8..4f7cfc9783a 100644 --- a/spec/lib/gitlab/ci/build/image_spec.rb +++ b/spec/lib/gitlab/ci/build/image_spec.rb @@ -9,7 +9,7 @@ describe Gitlab::Ci::Build::Image do subject { described_class.from_image(job) } context 'when image is defined in job' do - let(:image_name) { 'ruby:2.1' } + let(:image_name) { 'ruby:2.7' } let(:job) { create(:ci_build, options: { image: image_name } ) } context 'when image is defined as string' do diff --git a/spec/lib/gitlab/ci/config/entry/image_spec.rb b/spec/lib/gitlab/ci/config/entry/image_spec.rb index 8de2e5de724..de3e887a6ed 100644 --- a/spec/lib/gitlab/ci/config/entry/image_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/image_spec.rb @@ -6,11 +6,11 @@ describe Gitlab::Ci::Config::Entry::Image do let(:entry) { described_class.new(config) } context 'when configuration is a string' do - let(:config) { 'ruby:2.2' } + let(:config) { 'ruby:2.7' } describe '#value' do it 'returns image hash' do - expect(entry.value).to eq({ name: 'ruby:2.2' }) + expect(entry.value).to eq({ name: 'ruby:2.7' }) end end @@ -28,7 +28,7 @@ describe Gitlab::Ci::Config::Entry::Image do describe '#image' do it "returns image's name" do - expect(entry.name).to eq 'ruby:2.2' + expect(entry.name).to eq 'ruby:2.7' end end @@ -46,7 +46,7 @@ describe Gitlab::Ci::Config::Entry::Image do end context 'when configuration is a hash' do - let(:config) { { name: 'ruby:2.2', entrypoint: %w(/bin/sh run) } } + let(:config) { { name: 'ruby:2.7', entrypoint: %w(/bin/sh run) } } describe '#value' do it 'returns image hash' do @@ -68,7 +68,7 @@ describe Gitlab::Ci::Config::Entry::Image do describe '#image' do it "returns image's name" do - expect(entry.name).to eq 'ruby:2.2' + expect(entry.name).to eq 'ruby:2.7' end end @@ -80,7 +80,7 @@ describe Gitlab::Ci::Config::Entry::Image do context 'when configuration has ports' do let(:ports) { [{ number: 80, protocol: 'http', name: 'foobar' }] } - let(:config) { { name: 'ruby:2.2', entrypoint: %w(/bin/sh run), ports: ports } } + let(:config) { { name: 'ruby:2.7', entrypoint: %w(/bin/sh run), ports: ports } } let(:entry) { described_class.new(config, { with_image_ports: image_ports }) } let(:image_ports) { false } @@ -112,7 +112,7 @@ describe Gitlab::Ci::Config::Entry::Image do end context 'when entry value is not correct' do - let(:config) { ['ruby:2.2'] } + let(:config) { ['ruby:2.7'] } describe '#errors' do it 'saves errors' do @@ -129,7 +129,7 @@ describe Gitlab::Ci::Config::Entry::Image do end context 'when unexpected key is specified' do - let(:config) { { name: 'ruby:2.2', non_existing: 'test' } } + let(:config) { { name: 'ruby:2.7', non_existing: 'test' } } describe '#errors' do it 'saves errors' do diff --git a/spec/lib/gitlab/ci/config/entry/root_spec.rb b/spec/lib/gitlab/ci/config/entry/root_spec.rb index c3871b6b3cf..ba2dbf72fba 100644 --- a/spec/lib/gitlab/ci/config/entry/root_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/root_spec.rb @@ -29,7 +29,7 @@ describe Gitlab::Ci::Config::Entry::Root do let(:hash) do { before_script: %w(ls pwd), - image: 'ruby:2.2', + image: 'ruby:2.7', default: {}, services: ['postgres:9.1', 'mysql:5.5'], variables: { VAR: 'root' }, @@ -124,7 +124,7 @@ describe Gitlab::Ci::Config::Entry::Root do { name: :rspec, script: %w[rspec ls], before_script: %w(ls pwd), - image: { name: 'ruby:2.2' }, + image: { name: 'ruby:2.7' }, services: [{ name: 'postgres:9.1' }, { name: 'mysql:5.5' }], stage: 'test', cache: { key: 'k', untracked: true, paths: ['public/'], policy: 'pull-push' }, @@ -138,7 +138,7 @@ describe Gitlab::Ci::Config::Entry::Root do { name: :spinach, before_script: [], script: %w[spinach], - image: { name: 'ruby:2.2' }, + image: { name: 'ruby:2.7' }, services: [{ name: 'postgres:9.1' }, { name: 'mysql:5.5' }], stage: 'test', cache: { key: 'k', untracked: true, paths: ['public/'], policy: 'pull-push' }, @@ -154,7 +154,7 @@ describe Gitlab::Ci::Config::Entry::Root do before_script: [], script: ["make changelog | tee release_changelog.txt"], release: { name: "Release $CI_TAG_NAME", tag_name: 'v0.06', description: "./release_changelog.txt" }, - image: { name: "ruby:2.2" }, + image: { name: "ruby:2.7" }, services: [{ name: "postgres:9.1" }, { name: "mysql:5.5" }], cache: { key: "k", untracked: true, paths: ["public/"], policy: "pull-push" }, only: { refs: %w(branches tags) }, @@ -173,7 +173,7 @@ describe Gitlab::Ci::Config::Entry::Root do { before_script: %w(ls pwd), after_script: ['make clean'], default: { - image: 'ruby:2.1', + image: 'ruby:2.7', services: ['postgres:9.1', 'mysql:5.5'] }, variables: { VAR: 'root' }, @@ -200,7 +200,7 @@ describe Gitlab::Ci::Config::Entry::Root do rspec: { name: :rspec, script: %w[rspec ls], before_script: %w(ls pwd), - image: { name: 'ruby:2.1' }, + image: { name: 'ruby:2.7' }, services: [{ name: 'postgres:9.1' }, { name: 'mysql:5.5' }], stage: 'test', cache: { key: 'k', untracked: true, paths: ['public/'], policy: "pull-push" }, @@ -212,7 +212,7 @@ describe Gitlab::Ci::Config::Entry::Root do spinach: { name: :spinach, before_script: [], script: %w[spinach], - image: { name: 'ruby:2.1' }, + image: { name: 'ruby:2.7' }, services: [{ name: 'postgres:9.1' }, { name: 'mysql:5.5' }], stage: 'test', cache: { key: 'k', untracked: true, paths: ['public/'], policy: "pull-push" }, diff --git a/spec/lib/gitlab/ci/config/external/file/project_spec.rb b/spec/lib/gitlab/ci/config/external/file/project_spec.rb index b2924ae9d91..4d8f0dbc861 100644 --- a/spec/lib/gitlab/ci/config/external/file/project_spec.rb +++ b/spec/lib/gitlab/ci/config/external/file/project_spec.rb @@ -71,7 +71,7 @@ describe Gitlab::Ci::Config::External::File::Project do let(:root_ref_sha) { project.repository.root_ref_sha } before do - stub_project_blob(root_ref_sha, '/file.yml') { 'image: ruby:2.1' } + stub_project_blob(root_ref_sha, '/file.yml') { 'image: ruby:2.7' } end it 'returns true' do @@ -96,7 +96,7 @@ describe Gitlab::Ci::Config::External::File::Project do let(:ref_sha) { project.commit('master').sha } before do - stub_project_blob(ref_sha, '/file.yml') { 'image: ruby:2.1' } + stub_project_blob(ref_sha, '/file.yml') { 'image: ruby:2.7' } end it 'returns true' do diff --git a/spec/lib/gitlab/ci/config/external/mapper_spec.rb b/spec/lib/gitlab/ci/config/external/mapper_spec.rb index 6839002c3ab..fa358f36527 100644 --- a/spec/lib/gitlab/ci/config/external/mapper_spec.rb +++ b/spec/lib/gitlab/ci/config/external/mapper_spec.rb @@ -15,7 +15,7 @@ describe Gitlab::Ci::Config::External::Mapper do let(:file_content) do <<~HEREDOC - image: 'ruby:2.2' + image: 'ruby:2.7' HEREDOC end @@ -34,7 +34,7 @@ describe Gitlab::Ci::Config::External::Mapper do context 'when the string is a local file' do let(:values) do { include: local_file, - image: 'ruby:2.2' } + image: 'ruby:2.7' } end it 'returns File instances' do @@ -46,7 +46,7 @@ describe Gitlab::Ci::Config::External::Mapper do context 'when the key is a local file hash' do let(:values) do { include: { 'local' => local_file }, - image: 'ruby:2.2' } + image: 'ruby:2.7' } end it 'returns File instances' do @@ -57,7 +57,7 @@ describe Gitlab::Ci::Config::External::Mapper do context 'when the string is a remote file' do let(:values) do - { include: remote_url, image: 'ruby:2.2' } + { include: remote_url, image: 'ruby:2.7' } end it 'returns File instances' do @@ -69,7 +69,7 @@ describe Gitlab::Ci::Config::External::Mapper do context 'when the key is a remote file hash' do let(:values) do { include: { 'remote' => remote_url }, - image: 'ruby:2.2' } + image: 'ruby:2.7' } end it 'returns File instances' do @@ -81,7 +81,7 @@ describe Gitlab::Ci::Config::External::Mapper do context 'when the key is a template file hash' do let(:values) do { include: { 'template' => template_file }, - image: 'ruby:2.2' } + image: 'ruby:2.7' } end it 'returns File instances' do @@ -93,7 +93,7 @@ describe Gitlab::Ci::Config::External::Mapper do context 'when the key is a hash of file and remote' do let(:values) do { include: { 'local' => local_file, 'remote' => remote_url }, - image: 'ruby:2.2' } + image: 'ruby:2.7' } end it 'returns ambigious specification error' do @@ -105,7 +105,7 @@ describe Gitlab::Ci::Config::External::Mapper do context "when 'include' is defined as an array" do let(:values) do { include: [remote_url, local_file], - image: 'ruby:2.2' } + image: 'ruby:2.7' } end it 'returns Files instances' do @@ -117,7 +117,7 @@ describe Gitlab::Ci::Config::External::Mapper do context "when 'include' is defined as an array of hashes" do let(:values) do { include: [{ remote: remote_url }, { local: local_file }], - image: 'ruby:2.2' } + image: 'ruby:2.7' } end it 'returns Files instances' do @@ -128,7 +128,7 @@ describe Gitlab::Ci::Config::External::Mapper do context 'when it has ambigious match' do let(:values) do { include: [{ remote: remote_url, local: local_file }], - image: 'ruby:2.2' } + image: 'ruby:2.7' } end it 'returns ambigious specification error' do @@ -140,7 +140,7 @@ describe Gitlab::Ci::Config::External::Mapper do context "when 'include' is not defined" do let(:values) do { - image: 'ruby:2.2' + image: 'ruby:2.7' } end @@ -155,7 +155,7 @@ describe Gitlab::Ci::Config::External::Mapper do { 'local' => local_file }, { 'local' => local_file } ], - image: 'ruby:2.2' } + image: 'ruby:2.7' } end it 'raises an exception' do @@ -169,7 +169,7 @@ describe Gitlab::Ci::Config::External::Mapper do { 'local' => local_file }, { 'remote' => remote_url } ], - image: 'ruby:2.2' } + image: 'ruby:2.7' } end before do diff --git a/spec/lib/gitlab/ci/config/external/processor_spec.rb b/spec/lib/gitlab/ci/config/external/processor_spec.rb index ff08d4703fe..45f646660a7 100644 --- a/spec/lib/gitlab/ci/config/external/processor_spec.rb +++ b/spec/lib/gitlab/ci/config/external/processor_spec.rb @@ -24,7 +24,7 @@ describe Gitlab::Ci::Config::External::Processor do subject { processor.perform } context 'when no external files defined' do - let(:values) { { image: 'ruby:2.2' } } + let(:values) { { image: 'ruby:2.7' } } it 'returns the same values' do expect(processor.perform).to eq(values) @@ -32,7 +32,7 @@ describe Gitlab::Ci::Config::External::Processor do end context 'when an invalid local file is defined' do - let(:values) { { include: '/lib/gitlab/ci/templates/non-existent-file.yml', image: 'ruby:2.2' } } + let(:values) { { include: '/lib/gitlab/ci/templates/non-existent-file.yml', image: 'ruby:2.7' } } it 'raises an error' do expect { processor.perform }.to raise_error( @@ -44,7 +44,7 @@ describe Gitlab::Ci::Config::External::Processor do context 'when an invalid remote file is defined' do let(:remote_file) { 'http://doesntexist.com/.gitlab-ci-1.yml' } - let(:values) { { include: remote_file, image: 'ruby:2.2' } } + let(:values) { { include: remote_file, image: 'ruby:2.7' } } before do stub_full_request(remote_file).and_raise(SocketError.new('Some HTTP error')) @@ -60,7 +60,7 @@ describe Gitlab::Ci::Config::External::Processor do context 'with a valid remote external file is defined' do let(:remote_file) { 'https://gitlab.com/gitlab-org/gitlab-foss/blob/1234/.gitlab-ci-1.yml' } - let(:values) { { include: remote_file, image: 'ruby:2.2' } } + let(:values) { { include: remote_file, image: 'ruby:2.7' } } let(:external_file_content) do <<-HEREDOC before_script: @@ -94,7 +94,7 @@ describe Gitlab::Ci::Config::External::Processor do end context 'with a valid local external file is defined' do - let(:values) { { include: '/lib/gitlab/ci/templates/template.yml', image: 'ruby:2.2' } } + let(:values) { { include: '/lib/gitlab/ci/templates/template.yml', image: 'ruby:2.7' } } let(:local_file_content) do <<-HEREDOC before_script: @@ -131,7 +131,7 @@ describe Gitlab::Ci::Config::External::Processor do let(:values) do { include: external_files, - image: 'ruby:2.2' + image: 'ruby:2.7' } end @@ -163,7 +163,7 @@ describe Gitlab::Ci::Config::External::Processor do end context 'when external files are defined but not valid' do - let(:values) { { include: '/lib/gitlab/ci/templates/template.yml', image: 'ruby:2.2' } } + let(:values) { { include: '/lib/gitlab/ci/templates/template.yml', image: 'ruby:2.7' } } let(:local_file_content) { 'invalid content file ////' } @@ -185,7 +185,7 @@ describe Gitlab::Ci::Config::External::Processor do let(:values) do { include: remote_file, - image: 'ruby:2.2' + image: 'ruby:2.7' } end @@ -198,7 +198,7 @@ describe Gitlab::Ci::Config::External::Processor do it 'takes precedence' do stub_full_request(remote_file).to_return(body: remote_file_content) - expect(processor.perform[:image]).to eq('ruby:2.2') + expect(processor.perform[:image]).to eq('ruby:2.7') end end @@ -208,7 +208,7 @@ describe Gitlab::Ci::Config::External::Processor do include: [ { local: '/local/file.yml' } ], - image: 'ruby:2.2' + image: 'ruby:2.7' } end diff --git a/spec/lib/gitlab/ci/config_spec.rb b/spec/lib/gitlab/ci/config_spec.rb index d8101e8a621..3b65dbe11ec 100644 --- a/spec/lib/gitlab/ci/config_spec.rb +++ b/spec/lib/gitlab/ci/config_spec.rb @@ -20,7 +20,7 @@ describe Gitlab::Ci::Config do context 'when config is valid' do let(:yml) do <<-EOS - image: ruby:2.2 + image: ruby:2.7 rspec: script: @@ -32,7 +32,7 @@ describe Gitlab::Ci::Config do describe '#to_hash' do it 'returns hash created from string' do hash = { - image: 'ruby:2.2', + image: 'ruby:2.7', rspec: { script: ['gem install rspec', 'rspec'] @@ -85,7 +85,7 @@ describe Gitlab::Ci::Config do context 'when using extendable hash' do let(:yml) do <<-EOS - image: ruby:2.2 + image: ruby:2.7 rspec: script: rspec @@ -98,7 +98,7 @@ describe Gitlab::Ci::Config do it 'correctly extends the hash' do hash = { - image: 'ruby:2.2', + image: 'ruby:2.7', rspec: { script: 'rspec' }, test: { extends: 'rspec', @@ -188,7 +188,7 @@ describe Gitlab::Ci::Config do let(:yml) do <<-EOS image: - name: ruby:2.2 + name: ruby:2.7 ports: - 80 EOS @@ -202,12 +202,12 @@ describe Gitlab::Ci::Config do context 'in the job image' do let(:yml) do <<-EOS - image: ruby:2.2 + image: ruby:2.7 test: script: rspec image: - name: ruby:2.2 + name: ruby:2.7 ports: - 80 EOS @@ -221,11 +221,11 @@ describe Gitlab::Ci::Config do context 'in the services' do let(:yml) do <<-EOS - image: ruby:2.2 + image: ruby:2.7 test: script: rspec - image: ruby:2.2 + image: ruby:2.7 services: - name: test alias: test @@ -266,7 +266,7 @@ describe Gitlab::Ci::Config do - #{local_location} - #{remote_location} - image: ruby:2.2 + image: ruby:2.7 HEREDOC end @@ -296,7 +296,7 @@ describe Gitlab::Ci::Config do } composed_hash = { before_script: before_script_values, - image: "ruby:2.2", + image: "ruby:2.7", rspec: { script: ["bundle exec rspec"] }, variables: variables } @@ -381,7 +381,7 @@ describe Gitlab::Ci::Config do include: - #{remote_location} - image: ruby:2.2 + image: ruby:2.7 HEREDOC end @@ -392,7 +392,7 @@ describe Gitlab::Ci::Config do end it 'takes precedence' do - expect(config.to_hash).to eq({ image: 'ruby:2.2' }) + expect(config.to_hash).to eq({ image: 'ruby:2.7' }) end end diff --git a/spec/lib/gitlab/ci/yaml_processor_spec.rb b/spec/lib/gitlab/ci/yaml_processor_spec.rb index af0a85f6c4e..62adba4319e 100644 --- a/spec/lib/gitlab/ci/yaml_processor_spec.rb +++ b/spec/lib/gitlab/ci/yaml_processor_spec.rb @@ -665,7 +665,7 @@ module Gitlab describe "Image and service handling" do context "when extended docker configuration is used" do it "returns image and service when defined" do - config = YAML.dump({ image: { name: "ruby:2.1", entrypoint: ["/usr/local/bin/init", "run"] }, + config = YAML.dump({ image: { name: "ruby:2.7", entrypoint: ["/usr/local/bin/init", "run"] }, services: ["mysql", { name: "docker:dind", alias: "docker", entrypoint: ["/usr/local/bin/init", "run"], command: ["/usr/local/bin/init", "run"] }], @@ -683,7 +683,7 @@ module Gitlab options: { before_script: ["pwd"], script: ["rspec"], - image: { name: "ruby:2.1", entrypoint: ["/usr/local/bin/init", "run"] }, + image: { name: "ruby:2.7", entrypoint: ["/usr/local/bin/init", "run"] }, services: [{ name: "mysql" }, { name: "docker:dind", alias: "docker", entrypoint: ["/usr/local/bin/init", "run"], command: ["/usr/local/bin/init", "run"] }] @@ -696,7 +696,7 @@ module Gitlab end it "returns image and service when overridden for job" do - config = YAML.dump({ image: "ruby:2.1", + config = YAML.dump({ image: "ruby:2.7", services: ["mysql"], before_script: ["pwd"], rspec: { image: { name: "ruby:2.5", entrypoint: ["/usr/local/bin/init", "run"] }, @@ -731,7 +731,7 @@ module Gitlab context "when etended docker configuration is not used" do it "returns image and service when defined" do - config = YAML.dump({ image: "ruby:2.1", + config = YAML.dump({ image: "ruby:2.7", services: ["mysql", "docker:dind"], before_script: ["pwd"], rspec: { script: "rspec" } }) @@ -747,7 +747,7 @@ module Gitlab options: { before_script: ["pwd"], script: ["rspec"], - image: { name: "ruby:2.1" }, + image: { name: "ruby:2.7" }, services: [{ name: "mysql" }, { name: "docker:dind" }] }, allow_failure: false, @@ -758,7 +758,7 @@ module Gitlab end it "returns image and service when overridden for job" do - config = YAML.dump({ image: "ruby:2.1", + config = YAML.dump({ image: "ruby:2.7", services: ["mysql"], before_script: ["pwd"], rspec: { image: "ruby:2.5", services: ["postgresql", "docker:dind"], script: "rspec" } }) @@ -1292,7 +1292,7 @@ module Gitlab describe "Artifacts" do it "returns artifacts when defined" do config = YAML.dump({ - image: "ruby:2.1", + image: "ruby:2.7", services: ["mysql"], before_script: ["pwd"], rspec: { @@ -1318,7 +1318,7 @@ module Gitlab options: { before_script: ["pwd"], script: ["rspec"], - image: { name: "ruby:2.1" }, + image: { name: "ruby:2.7" }, services: [{ name: "mysql" }], artifacts: { name: "custom_name", @@ -1945,7 +1945,7 @@ module Gitlab context 'when hidden job have a script definition' do let(:config) do YAML.dump({ - '.hidden_job' => { image: 'ruby:2.1', script: 'test' }, + '.hidden_job' => { image: 'ruby:2.7', script: 'test' }, 'normal_job' => { script: 'test' } }) end @@ -1956,7 +1956,7 @@ module Gitlab context "when hidden job doesn't have a script definition" do let(:config) do YAML.dump({ - '.hidden_job' => { image: 'ruby:2.1' }, + '.hidden_job' => { image: 'ruby:2.7' }, 'normal_job' => { script: 'test' } }) end |