summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/services/base_helm_service_shared_examples.rb
blob: c2252c8314014e7cfd90433c3d9e89d526d46bf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 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