diff options
Diffstat (limited to 'spec/services/ci/archive_trace_service_spec.rb')
-rw-r--r-- | spec/services/ci/archive_trace_service_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/services/ci/archive_trace_service_spec.rb b/spec/services/ci/archive_trace_service_spec.rb index b08ba6fd5e5..bf2e5302d2e 100644 --- a/spec/services/ci/archive_trace_service_spec.rb +++ b/spec/services/ci/archive_trace_service_spec.rb @@ -15,6 +15,25 @@ RSpec.describe Ci::ArchiveTraceService, '#execute' do expect(job.trace_metadata.trace_artifact).to eq(job.job_artifacts_trace) end + context 'integration hooks' do + it do + stub_feature_flags(datadog_integration_logs_collection: [job.project]) + + expect(job.project).to receive(:execute_integrations) do |data, hook_type| + expect(data).to eq Gitlab::DataBuilder::ArchiveTrace.build(job) + expect(hook_type).to eq :archive_trace_hooks + end + expect { subject }.not_to raise_error + end + + it 'with feature flag disabled' do + stub_feature_flags(datadog_integration_logs_collection: false) + + expect(job.project).not_to receive(:execute_integrations) + expect { subject }.not_to raise_error + end + end + context 'when trace is already archived' do let!(:job) { create(:ci_build, :success, :trace_artifact) } |