Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-26 15:10:57 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-26 15:10:57 +0300
commitf2cdd73a23b94c5f6eb2f38b22a6e5bef9c52d10 (patch)
tree67237bfad2f60f0912d37f7025260853afd70655 /spec/serializers
parent59719941e70040d2e28a4317400dd7b8103c1fdb (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/pipeline_serializer_spec.rb16
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,