summaryrefslogtreecommitdiff
path: root/spec/models/project_services
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-07-05 21:05:24 +0000
committerMayra Cabrera <mcabrera@gitlab.com>2019-07-05 21:05:24 +0000
commit357f9898d586a0310a1111c0c5763c8707c4fb02 (patch)
tree4c68a22798b5d863d849e44e679e09cf32b1e9ef /spec/models/project_services
parent0cb361fe8f4bd06d9f42e3e7f797631acb4f8d60 (diff)
downloadgitlab-ce-357f9898d586a0310a1111c0c5763c8707c4fb02.tar.gz
Add OpenSSL::OpenSSLError to HTTP_ERRORS
Some services can raise OpenSSL::X509::CertificateError due to an invalid SSL certificates, with OpenSSL::OpenSSLError we can handle these errors.
Diffstat (limited to 'spec/models/project_services')
-rw-r--r--spec/models/project_services/drone_ci_service_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/models/project_services/drone_ci_service_spec.rb b/spec/models/project_services/drone_ci_service_spec.rb
index 22df19d943f..a771d1bf27f 100644
--- a/spec/models/project_services/drone_ci_service_spec.rb
+++ b/spec/models/project_services/drone_ci_service_spec.rb
@@ -101,6 +101,15 @@ describe DroneCiService, :use_clean_rails_memory_store_caching do
is_expected.to eq(:error)
end
+ Gitlab::HTTP::HTTP_ERRORS.each do |http_error|
+ it "sets commit status to :error with a #{http_error.name} error" do
+ WebMock.stub_request(:get, commit_status_path)
+ .to_raise(http_error)
+
+ is_expected.to eq(:error)
+ end
+ end
+
{
"killed" => :canceled,
"failure" => :failed,