summaryrefslogtreecommitdiff
path: root/spec/workers/ci/archive_traces_cron_worker_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/workers/ci/archive_traces_cron_worker_spec.rb')
-rw-r--r--spec/workers/ci/archive_traces_cron_worker_spec.rb20
1 files changed, 17 insertions, 3 deletions
diff --git a/spec/workers/ci/archive_traces_cron_worker_spec.rb b/spec/workers/ci/archive_traces_cron_worker_spec.rb
index 14abe819587..0c1010960a1 100644
--- a/spec/workers/ci/archive_traces_cron_worker_spec.rb
+++ b/spec/workers/ci/archive_traces_cron_worker_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Ci::ArchiveTracesCronWorker do
+RSpec.describe Ci::ArchiveTracesCronWorker, feature_category: :continuous_integration do
subject { described_class.new.perform }
let(:finished_at) { 1.day.ago }
@@ -34,14 +34,28 @@ RSpec.describe Ci::ArchiveTracesCronWorker do
it_behaves_like 'archives trace'
- it 'executes service' do
+ it 'batch_execute service' do
expect_next_instance_of(Ci::ArchiveTraceService) do |instance|
- expect(instance).to receive(:execute).with(build, anything)
+ expect(instance).to receive(:batch_execute).with(worker_name: "Ci::ArchiveTracesCronWorker")
end
subject
end
+ context "with FF deduplicate_archive_traces_cron_worker false" do
+ before do
+ stub_feature_flags(deduplicate_archive_traces_cron_worker: false)
+ end
+
+ it 'calls execute service' do
+ expect_next_instance_of(Ci::ArchiveTraceService) do |instance|
+ expect(instance).to receive(:execute).with(build, worker_name: "Ci::ArchiveTracesCronWorker")
+ end
+
+ subject
+ end
+ end
+
context 'when the job finished recently' do
let(:finished_at) { 1.hour.ago }