diff options
Diffstat (limited to 'spec/scripts/create_pipeline_failure_incident_spec.rb')
-rw-r--r-- | spec/scripts/create_pipeline_failure_incident_spec.rb | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/spec/scripts/create_pipeline_failure_incident_spec.rb b/spec/scripts/create_pipeline_failure_incident_spec.rb index 8549cec1b12..efbd22ccb32 100644 --- a/spec/scripts/create_pipeline_failure_incident_spec.rb +++ b/spec/scripts/create_pipeline_failure_incident_spec.rb @@ -15,7 +15,7 @@ RSpec.describe CreatePipelineFailureIncident, feature_category: :tooling do let(:options) do { - project: 1234, + project: 'gitlab-org/gitlab-test-project', api_token: 'asdf1234' } end @@ -104,7 +104,6 @@ RSpec.describe CreatePipelineFailureIncident, feature_category: :tooling do end context 'when other branch' do - let(:incident_labels) { ['Engineering Productivity', 'master-broken::undetermined', 'master:broken'] } let(:title) { /broken `master`/ } let(:description) { /Follow the \[Broken `master` handbook guide\]/ } @@ -114,6 +113,49 @@ RSpec.describe CreatePipelineFailureIncident, feature_category: :tooling do ) end + context 'when GitLab FOSS' do + let(:incident_labels) { ['master:foss-broken', 'Engineering Productivity', 'master-broken::undetermined'] } + + before do + stub_env( + 'CI_PROJECT_NAME' => 'gitlab-foss' + ) + end + + it_behaves_like 'creating an issue' + end + + context 'when GitLab EE' do + let(:incident_labels) { ['master:broken', 'Engineering Productivity', 'master-broken::undetermined'] } + + before do + stub_env( + 'CI_PROJECT_NAME' => 'gitlab' + ) + end + + it_behaves_like 'creating an issue' + end + end + + context 'when review-apps' do + let(:options) do + { + project: 'gitlab-org/quality/engineering-productivity/review-apps-broken-incidents', + api_token: 'asdf1234' + } + end + + let(:incident_labels) { ["review-apps-broken", "Engineering Productivity", "ep::review-apps"] } + let(:title) { /broken `my-branch`/ } + let(:description) { /Please refer to \[the review-apps triaging process\]/ } + + before do + stub_env( + 'CI_COMMIT_REF_NAME' => 'my-branch' + ) + end + it_behaves_like 'creating an issue' end end |