debian-mirror-gitlab/spec/support/shared_examples/services/base_helm_service_shared_examples.rb
2020-03-13 15:44:24 +05:30

23 lines
487 B
Ruby

# frozen_string_literal: true
RSpec.shared_examples 'logs kubernetes errors' do
let(:error_hash) do
{
service: service.class.name,
app_id: application.id,
project_ids: application.cluster.project_ids,
group_ids: [],
error_code: error_code
}
end
it 'logs into kubernetes.log and Sentry' do
expect(Gitlab::ErrorTracking).to receive(:track_exception).with(
error,
hash_including(error_hash)
)
service.execute
end
end