Commit 2b155818 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 35d4810f 8ede9d18
...@@ -83,13 +83,15 @@ stages: ...@@ -83,13 +83,15 @@ stages:
.use-pg: &use-pg .use-pg: &use-pg
services: services:
- postgres:9.6 - name: postgres:9.6
- redis:alpine command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:alpine
.use-pg-10: &use-pg-10 .use-pg-10: &use-pg-10
services: services:
- postgres:10.0 - name: postgres:10.0
- redis:alpine command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:alpine
.use-mysql: &use-mysql .use-mysql: &use-mysql
services: services:
......
...@@ -11,9 +11,11 @@ module Ci ...@@ -11,9 +11,11 @@ module Ci
def execute def execute
prerequisites.each(&:complete!) prerequisites.each(&:complete!)
unless build.enqueue build.enqueue!
build.drop!(:unmet_prerequisites) rescue => e
end Gitlab::Sentry.track_acceptable_exception(e, extra: { build_id: build.id })
build.drop(:unmet_prerequisites)
end end
private private
......
...@@ -38,7 +38,21 @@ describe Ci::PrepareBuildService do ...@@ -38,7 +38,21 @@ describe Ci::PrepareBuildService do
end end
it 'drops the build' do it 'drops the build' do
expect(build).to receive(:drop!).with(:unmet_prerequisites).once expect(build).to receive(:drop).with(:unmet_prerequisites).once
subject
end
end
context 'prerequisites raise an error' do
before do
allow(prerequisite).to receive(:complete!).and_raise Kubeclient::HttpError.new(401, 'unauthorized', nil)
end
it 'drops the build and notifies Sentry' do
expect(build).to receive(:drop).with(:unmet_prerequisites).once
expect(Gitlab::Sentry).to receive(:track_acceptable_exception)
.with(instance_of(Kubeclient::HttpError), hash_including(extra: { build_id: build.id }))
subject subject
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment