Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/ci/build_dependencies_spec.rb')
-rw-r--r--spec/models/ci/build_dependencies_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/models/ci/build_dependencies_spec.rb b/spec/models/ci/build_dependencies_spec.rb
index c5f56dbe5bc..e343ec0e698 100644
--- a/spec/models/ci/build_dependencies_spec.rb
+++ b/spec/models/ci/build_dependencies_spec.rb
@@ -18,6 +18,10 @@ RSpec.describe Ci::BuildDependencies do
let!(:rubocop_test) { create(:ci_build, pipeline: pipeline, name: 'rubocop', stage_idx: 1, stage: 'test') }
let!(:staging) { create(:ci_build, pipeline: pipeline, name: 'staging', stage_idx: 2, stage: 'deploy') }
+ before do
+ stub_feature_flags(ci_validate_build_dependencies_override: false)
+ end
+
describe '#local' do
subject { described_class.new(job).local }
@@ -360,4 +364,28 @@ RSpec.describe Ci::BuildDependencies do
expect(subject).to contain_exactly(1, 2, 3, 4)
end
end
+
+ describe '#valid?' do
+ subject { described_class.new(job).valid? }
+
+ let(:job) { rspec_test }
+
+ it { is_expected.to eq(true) }
+
+ context 'when a local dependency is invalid' do
+ before do
+ build.update_column(:erased_at, Time.current)
+ end
+
+ it { is_expected.to eq(false) }
+
+ context 'when ci_validate_build_dependencies_override feature flag is enabled' do
+ before do
+ stub_feature_flags(ci_validate_build_dependencies_override: job.project)
+ end
+
+ it { is_expected.to eq(true) }
+ end
+ end
+ end
end