Commit 3b328475 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'sh-test-runner-es' into 'master'

Fix failing EE builds due to blacklisted Web connections

Closes #2507

See merge request !1995
parents 2c87211a d89a0220
require 'webmock' require 'webmock'
require 'webmock/rspec' require 'webmock/rspec'
allowed = %w[elasticsearch registry.gitlab.com-gitlab-org-test-elastic-image] def webmock_setup_defaults
allowed = %w[elasticsearch registry.gitlab.com-gitlab-org-test-elastic-image]
if ENV.has_key?('ELASTIC_URL') if ENV.has_key?('ELASTIC_URL')
url = URI.parse(ENV['ELASTIC_URL']) url = URI.parse(ENV['ELASTIC_URL'])
allowed << url.host allowed << url.host
allowed.uniq! allowed.uniq!
end
WebMock.disable_net_connect!(allow_localhost: true, allow: allowed)
end end
WebMock.disable_net_connect!(allow_localhost: true, allow: allowed) webmock_setup_defaults
...@@ -62,7 +62,7 @@ describe 'Unicorn' do ...@@ -62,7 +62,7 @@ describe 'Unicorn' do
end end
after(:all) do after(:all) do
WebMock.disable_net_connect!(allow_localhost: true) webmock_setup_defaults
Process.kill('TERM', @unicorn_master_pid) Process.kill('TERM', @unicorn_master_pid)
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