diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/serializers/pipeline_details_entity_spec.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/serializers/pipeline_details_entity_spec.rb')
-rw-r--r-- | spec/serializers/pipeline_details_entity_spec.rb | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/spec/serializers/pipeline_details_entity_spec.rb b/spec/serializers/pipeline_details_entity_spec.rb index a154bcac635..849dab102c2 100644 --- a/spec/serializers/pipeline_details_entity_spec.rb +++ b/spec/serializers/pipeline_details_entity_spec.rb @@ -173,44 +173,5 @@ describe PipelineDetailsEntity do expect(subject[:triggered].first[:project]).not_to be_nil end end - - context 'when pipeline has expiring archive artifacts' do - let(:pipeline) { create(:ci_empty_pipeline) } - let!(:build_1) { create(:ci_build, :artifacts, pipeline: pipeline, artifacts_expire_at: 2.days.from_now, name: 'build_1') } - let!(:build_2) { create(:ci_build, :artifacts, pipeline: pipeline, artifacts_expire_at: 2.days.from_now, name: 'build_2') } - let!(:build_3) { create(:ci_build, :artifacts, pipeline: pipeline, artifacts_expire_at: 2.days.from_now, name: 'build_3') } - - let(:names) { subject[:details][:artifacts].map { |a| a[:name] } } - - context 'and preload_job_artifacts_archive is not defined in the options' do - it 'defaults to true and eager loads the job_artifacts_archive' do - recorder = ActiveRecord::QueryRecorder.new do - expect(names).to match_array(%w[build_1 build_2 build_3]) - end - - expected_queries = Gitlab.ee? ? 42 : 29 - - # This makes only one query to fetch all job artifacts - expect(recorder.count).to eq(expected_queries) - end - end - - context 'and preload_job_artifacts_archive is set to false' do - let(:entity) do - described_class.represent(pipeline, request: request, preload_job_artifacts_archive: false) - end - - it 'does not eager load the job_artifacts_archive' do - recorder = ActiveRecord::QueryRecorder.new do - expect(names).to match_array(%w[build_1 build_2 build_3]) - end - - expected_queries = Gitlab.ee? ? 44 : 31 - - # This makes one query for each job artifact - expect(recorder.count).to eq(expected_queries) - end - end - end end end |