diff options
Diffstat (limited to 'spec/lib/gitlab/ci/config/entry/root_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/config/entry/root_spec.rb | 127 |
1 files changed, 1 insertions, 126 deletions
diff --git a/spec/lib/gitlab/ci/config/entry/root_spec.rb b/spec/lib/gitlab/ci/config/entry/root_spec.rb index 041eb748fc9..31e3545e8d8 100644 --- a/spec/lib/gitlab/ci/config/entry/root_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/root_spec.rb @@ -175,68 +175,6 @@ RSpec.describe Gitlab::Ci::Config::Entry::Root do ) end end - - context 'with multuple_cache_per_job FF disabled' do - before do - stub_feature_flags(multiple_cache_per_job: false) - root.compose! - end - - describe '#jobs_value' do - it 'returns jobs configuration' do - expect(root.jobs_value.keys).to eq([:rspec, :spinach, :release]) - expect(root.jobs_value[:rspec]).to eq( - { name: :rspec, - script: %w[rspec ls], - before_script: %w(ls pwd), - 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', when: 'on_success' }, - variables: { 'VAR' => 'root', 'VAR2' => 'val 2' }, - job_variables: {}, - root_variables_inheritance: true, - ignore: false, - after_script: ['make clean'], - only: { refs: %w[branches tags] }, - scheduling_type: :stage } - ) - expect(root.jobs_value[:spinach]).to eq( - { name: :spinach, - before_script: [], - script: %w[spinach], - 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', when: 'on_success' }, - variables: { 'VAR' => 'root', 'VAR2' => 'val 2' }, - job_variables: {}, - root_variables_inheritance: true, - ignore: false, - after_script: ['make clean'], - only: { refs: %w[branches tags] }, - scheduling_type: :stage } - ) - expect(root.jobs_value[:release]).to eq( - { name: :release, - stage: 'release', - 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.7" }, - services: [{ name: "postgres:9.1" }, { name: "mysql:5.5" }], - cache: { key: "k", untracked: true, paths: ["public/"], policy: "pull-push", when: 'on_success' }, - only: { refs: %w(branches tags) }, - variables: { 'VAR' => 'job', 'VAR2' => 'val 2' }, - job_variables: { 'VAR' => 'job' }, - root_variables_inheritance: true, - after_script: [], - ignore: false, - scheduling_type: :stage } - ) - end - end - end end end @@ -255,56 +193,6 @@ RSpec.describe Gitlab::Ci::Config::Entry::Root do spinach: { before_script: [], variables: { VAR: 'job' }, script: 'spinach' } } end - context 'with multiple_cache_per_job FF disabled' do - context 'when composed' do - before do - stub_feature_flags(multiple_cache_per_job: false) - root.compose! - end - - describe '#errors' do - it 'has no errors' do - expect(root.errors).to be_empty - end - end - - describe '#jobs_value' do - it 'returns jobs configuration' do - expect(root.jobs_value).to eq( - rspec: { name: :rspec, - script: %w[rspec ls], - before_script: %w(ls pwd), - 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', when: 'on_success' }, - variables: { 'VAR' => 'root' }, - job_variables: {}, - root_variables_inheritance: true, - ignore: false, - after_script: ['make clean'], - only: { refs: %w[branches tags] }, - scheduling_type: :stage }, - spinach: { name: :spinach, - before_script: [], - script: %w[spinach], - 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', when: 'on_success' }, - variables: { 'VAR' => 'job' }, - job_variables: { 'VAR' => 'job' }, - root_variables_inheritance: true, - ignore: false, - after_script: ['make clean'], - only: { refs: %w[branches tags] }, - scheduling_type: :stage } - ) - end - end - end - end - context 'when composed' do before do root.compose! @@ -390,19 +278,6 @@ RSpec.describe Gitlab::Ci::Config::Entry::Root do expect(root.cache_value).to eq([key: 'a', policy: 'pull-push', when: 'on_success']) end end - - context 'with multiple_cache_per_job FF disabled' do - before do - stub_feature_flags(multiple_cache_per_job: false) - root.compose! - end - - describe '#cache_value' do - it 'returns correct cache definition' do - expect(root.cache_value).to eq(key: 'a', policy: 'pull-push', when: 'on_success') - end - end - end end context 'when variables resembles script-type job' do @@ -525,7 +400,7 @@ RSpec.describe Gitlab::Ci::Config::Entry::Root do context 'when entry exists' do it 'returns correct entry' do expect(root[:cache]) - .to be_an_instance_of Gitlab::Ci::Config::Entry::Cache + .to be_an_instance_of Gitlab::Ci::Config::Entry::Caches expect(root[:jobs][:rspec][:script].value).to eq ['ls'] end end |