Commit 7718377a authored by Douwe Maan's avatar Douwe Maan

Merge branch '2757-fix-elasticsearch-check' into 'master'

Fix GitLab check: Problem with Elastic Search

Closes #2757

See merge request !2278
parents 39fa7478 97db97f1
---
title: 'Fix GitLab check: Problem with Elastic Search'
merge_request: 2278
author:
......@@ -18,7 +18,13 @@ module SystemCheck
end
def check?
current_version.major == 5 && (1..3).cover?(version.minor)
self.class.current_version.major == 5 && (1..3).cover?(self.class.current_version.minor)
end
def show_error
for_more_information(
'doc/integration/elasticsearch.md'
)
end
end
end
......
......@@ -75,6 +75,8 @@ module SystemCheck
check.show_error
end
rescue StandardError => e
$stdout.puts "Exception: #{e.message}".color(:red)
end
private
......
......@@ -75,6 +75,24 @@ describe SystemCheck::SimpleExecutor, lib: true do
end
end
class BugousCheck < SystemCheck::BaseCheck
CustomError = Class.new(StandardError)
set_name 'my bugous check'
def check?
raise CustomError, 'omg'
end
end
before do
@rainbow = Rainbow.enabled
Rainbow.enabled = false
end
after do
Rainbow.enabled = @rainbow
end
describe '#component' do
it 'returns stored component name' do
expect(subject.component).to eq('Test')
......@@ -219,5 +237,11 @@ describe SystemCheck::SimpleExecutor, lib: true do
end
end
end
context 'when there is an exception' do
it 'rescues the exception' do
expect{ subject.run_check(BugousCheck) }.not_to raise_exception
end
end
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