diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-13 21:10:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-13 21:10:04 +0300 |
commit | 04befb368f4b170ce19bb2c7c8739baa08b04a0a (patch) | |
tree | c3e7466f95c9757fe2a21ebc1ed6e91ea80d5369 /spec/workers | |
parent | aadb3204eaf8b5912e262cd19fed34fc70789e95 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/ci/archive_traces_cron_worker_spec.rb | 20 |
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 } |