diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-11 21:09:14 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-11 21:09:14 +0000 |
commit | 0f079aa28d93f40ad7fda398fb2280c3e358098d (patch) | |
tree | bc67abda12fd05a9712cd0bd97f82e33eb6c927f /spec/lib/gitlab/ci/pipeline | |
parent | 603ee53dbdbd3adaced752e1a119eb40d64e9979 (diff) | |
download | gitlab-ce-0f079aa28d93f40ad7fda398fb2280c3e358098d.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/ci/pipeline')
-rw-r--r-- | spec/lib/gitlab/ci/pipeline/chain/validate/external_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/pipeline/chain/validate/external_spec.rb b/spec/lib/gitlab/ci/pipeline/chain/validate/external_spec.rb index c19756c4783..fb1a360a4b7 100644 --- a/spec/lib/gitlab/ci/pipeline/chain/validate/external_spec.rb +++ b/spec/lib/gitlab/ci/pipeline/chain/validate/external_spec.rb @@ -148,6 +148,8 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Validate::External do expect(::Gitlab::HTTP).to receive(:post) do |_url, params| payload = Gitlab::Json.parse(params[:body]) + expect(payload['total_builds_count']).to eq(0) + builds = payload['builds'] expect(builds.count).to eq(2) expect(builds[0]['services']).to be_nil @@ -160,6 +162,23 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Validate::External do perform! end + + context "with existing jobs from other project's alive pipelines" do + before do + create(:ci_pipeline, :with_job, user: user) + create(:ci_pipeline, :with_job) + end + + it 'returns the expected total_builds_count' do + expect(::Gitlab::HTTP).to receive(:post) do |_url, params| + payload = Gitlab::Json.parse(params[:body]) + + expect(payload['total_builds_count']).to eq(1) + end + + perform! + end + end end context 'when EXTERNAL_VALIDATION_SERVICE_TOKEN is set' do |