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:
authorStan Hu <stanhu@gmail.com>2019-09-04 09:34:52 +0300
committerStan Hu <stanhu@gmail.com>2019-09-06 07:42:14 +0300
commitc34240d26fdcf447ee86172a81c0fc56fcaf9cbc (patch)
treef1d74946d5725d2df09c5845f76debc5851adc36 /spec/services
parent13227500f29d8a74c77cba23b7dfdb4169222821 (diff)
Log errors for failed pipeline creation in PostReceive
When a pipeline fails to create in `PostReceive`, the error is silently discarded, making it difficult to understand why a pipeline was not created. We now add a Sidekiq warning message for this. Adding a Sentry exception when this happens would generate a lot of noise for invalid CI files. Relates to https://gitlab.com/gitlab-org/gitlab-ee/issues/14720
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/git/branch_push_service_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/services/git/branch_push_service_spec.rb b/spec/services/git/branch_push_service_spec.rb
index d9e607cd251..c3a4f3dbe3f 100644
--- a/spec/services/git/branch_push_service_spec.rb
+++ b/spec/services/git/branch_push_service_spec.rb
@@ -99,6 +99,20 @@ describe Git::BranchPushService, services: true do
expect(pipeline).to be_push
expect(Gitlab::Git::BRANCH_REF_PREFIX + pipeline.ref).to eq(ref)
end
+
+ context 'when pipeline has errors' do
+ before do
+ config = YAML.dump({ test: { script: 'ls', only: ['feature'] } })
+ stub_ci_pipeline_yaml_file(config)
+ end
+
+ it 'reports an error' do
+ allow(Sidekiq).to receive(:server?).and_return(true)
+ expect(Sidekiq.logger).to receive(:warn)
+
+ expect { subject }.not_to change { Ci::Pipeline.count }
+ end
+ end
end
describe "Updates merge requests" do