diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
commit | 0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch) | |
tree | 7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /spec/workers/ci/archive_trace_worker_spec.rb | |
parent | 72123183a20411a36d607d70b12d57c484394c8e (diff) |
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'spec/workers/ci/archive_trace_worker_spec.rb')
-rw-r--r-- | spec/workers/ci/archive_trace_worker_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/workers/ci/archive_trace_worker_spec.rb b/spec/workers/ci/archive_trace_worker_spec.rb index 889e0c92042..52723ff5823 100644 --- a/spec/workers/ci/archive_trace_worker_spec.rb +++ b/spec/workers/ci/archive_trace_worker_spec.rb @@ -16,6 +16,34 @@ RSpec.describe Ci::ArchiveTraceWorker do subject end + + it 'has preloaded the arguments for archiving' do + allow_next_instance_of(Ci::ArchiveTraceService) do |instance| + allow(instance).to receive(:execute) do |job| + expect(job.association(:project)).to be_loaded + expect(job.association(:pending_state)).to be_loaded + end + end + + subject + end + + context 'when sticky_ci_archive_trace_worker is disabled' do + before do + stub_feature_flags(sticky_ci_archive_trace_worker: false) + end + + it 'does not preload associations' do + allow_next_instance_of(Ci::ArchiveTraceService) do |instance| + allow(instance).to receive(:execute) do |job| + expect(job.association(:project)).not_to be_loaded + expect(job.association(:pending_state)).not_to be_loaded + end + end + + subject + end + end end context 'when job is not found' do |