From 53ba5074ff5cec24e614cd6410b6f188c4358ae4 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 12 Sep 2023 07:12:24 +0000 Subject: Add latest changes from gitlab-org/gitlab@16-3-stable-ee --- .../ci/pipeline/chain/validate/abilities_spec.rb | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'spec') diff --git a/spec/lib/gitlab/ci/pipeline/chain/validate/abilities_spec.rb b/spec/lib/gitlab/ci/pipeline/chain/validate/abilities_spec.rb index df18e1e4f48..c3516c467d4 100644 --- a/spec/lib/gitlab/ci/pipeline/chain/validate/abilities_spec.rb +++ b/spec/lib/gitlab/ci/pipeline/chain/validate/abilities_spec.rb @@ -82,6 +82,39 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Validate::Abilities, feature_categor specify { expect(step.perform!).to contain_exactly('Project is deleted!') } end + + context 'with project imports in progress' do + let(:project) { create(:project, :import_started, import_type: 'gitlab_project') } + + before do + step.perform! + end + + it 'adds an error about imports' do + expect(pipeline.errors.to_a) + .to include /Import in progress/ + end + + it 'breaks the pipeline builder chain' do + expect(step.break?).to eq true + end + end + + context 'with completed project imports' do + let(:project) { create(:project, :import_finished, import_type: 'gitlab_project') } + + before do + step.perform! + end + + it 'does not invalidate the pipeline' do + expect(pipeline).to be_valid + end + + it 'does not break the chain' do + expect(step.break?).to eq false + end + end end describe '#allowed_to_write_ref?' do -- cgit v1.2.3