| ... | @@ -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
|
| ... | |
... | |
| ... | | ... | |