diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-03 03:12:53 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-03 03:12:53 +0300 |
commit | a77c9fccd057514a8b78a10642779f54a22f3f76 (patch) | |
tree | 5746326ff4e1e25f01af2062454f90bdc3f57d35 /spec/tooling | |
parent | a88ffaad9f9f321a71657ac0aca4d947f5bc6a5b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/tooling')
-rw-r--r-- | spec/tooling/danger/stable_branch_spec.rb | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/spec/tooling/danger/stable_branch_spec.rb b/spec/tooling/danger/stable_branch_spec.rb index a0c628b0add..1bfa62b2379 100644 --- a/spec/tooling/danger/stable_branch_spec.rb +++ b/spec/tooling/danger/stable_branch_spec.rb @@ -92,11 +92,19 @@ RSpec.describe Tooling::Danger::StableBranch, feature_category: :delivery do let(:pipeline_bridges_response) do [ - { 'name' => 'e2e:package-and-test', - 'status' => 'success' } + { + 'name' => 'e2e:package-and-test', + 'status' => 'success', + 'downstream_pipeline' => { + 'id' => '123', + 'status' => package_and_qa_state + } + } ] end + let(:package_and_qa_state) { 'success' } + let(:parsed_response) do [ { 'version' => '15.1.1' }, @@ -176,31 +184,26 @@ RSpec.describe Tooling::Danger::StableBranch, feature_category: :delivery do end context 'when package-and-test job is in manual state' do - described_class::FAILING_PACKAGE_AND_TEST_STATUSES.each do |status| - let(:pipeline_bridges_response) do - [ - { 'name' => 'e2e:package-and-test', - 'status' => status } - ] - end + let(:package_and_qa_state) { 'manual' } - it_behaves_like 'with a failure', described_class::NEEDS_PACKAGE_AND_TEST_MESSAGE - it_behaves_like 'bypassing when flaky test or docs only' - end + it_behaves_like 'with a failure', described_class::NEEDS_PACKAGE_AND_TEST_MESSAGE + it_behaves_like 'bypassing when flaky test or docs only' end context 'when package-and-test job is in a non-successful state' do - let(:pipeline_bridges_response) do - [ - { 'name' => 'e2e:package-and-test', - 'status' => 'running' } - ] - end + let(:package_and_qa_state) { 'running' } it_behaves_like 'with a warning', described_class::WARN_PACKAGE_AND_TEST_MESSAGE it_behaves_like 'bypassing when flaky test or docs only' end + context 'when package-and-test job is canceled' do + let(:package_and_qa_state) { 'canceled' } + + it_behaves_like 'with a failure', described_class::NEEDS_PACKAGE_AND_TEST_MESSAGE + it_behaves_like 'bypassing when flaky test or docs only' + end + context 'when no pipeline is found' do before do allow(gitlab_gem_client).to receive(:mr_json).and_return({}) |