diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 18:18:33 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 18:18:33 +0000 |
commit | f64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch) | |
tree | a2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /spec/serializers/pipeline_serializer_spec.rb | |
parent | bfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff) | |
download | gitlab-ce-f64a639bcfa1fc2bc89ca7db268f594306edfd7c.tar.gz |
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'spec/serializers/pipeline_serializer_spec.rb')
-rw-r--r-- | spec/serializers/pipeline_serializer_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/serializers/pipeline_serializer_spec.rb b/spec/serializers/pipeline_serializer_spec.rb index e0f6ab68034..bcaaa61eb04 100644 --- a/spec/serializers/pipeline_serializer_spec.rb +++ b/spec/serializers/pipeline_serializer_spec.rb @@ -209,6 +209,22 @@ RSpec.describe PipelineSerializer do end end + context 'with scheduled and manual builds' do + let(:ref) { 'feature' } + + before do + create(:ci_build, :scheduled, pipeline: resource.first) + create(:ci_build, :scheduled, pipeline: resource.second) + create(:ci_build, :manual, pipeline: resource.first) + create(:ci_build, :manual, pipeline: resource.second) + end + + it 'sends at most one metadata query for each type of build', :request_store do + # 1 for the existing failed builds and 2 for the added scheduled and manual builds + expect { subject }.not_to exceed_query_limit(1 + 2).for_query /SELECT "ci_builds_metadata".*/ + end + end + def create_pipeline(status) create(:ci_empty_pipeline, project: project, |