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-04-01 21:13:56 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-04-01 21:13:56 +0300
commit1769b59b9fd05325e3016b1a53a82ae6cf56adb5 (patch)
treea7e81e0c94fce5cc033e802d53d0c08d833fc87d /spec/serializers/pipeline_serializer_spec.rb
parent05003789d95f2f5d28a2f018d9e1b51ad7ab983c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers/pipeline_serializer_spec.rb')
-rw-r--r--spec/serializers/pipeline_serializer_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/serializers/pipeline_serializer_spec.rb b/spec/serializers/pipeline_serializer_spec.rb
index 7784f8f53ff..6028da301f3 100644
--- a/spec/serializers/pipeline_serializer_spec.rb
+++ b/spec/serializers/pipeline_serializer_spec.rb
@@ -209,6 +209,25 @@ RSpec.describe PipelineSerializer do
end
end
+ context 'with build environments' do
+ let(:ref) { 'feature' }
+
+ it 'verifies number of queries', :request_store do
+ stub_licensed_features(protected_environments: true)
+
+ env = create(:environment, project: project)
+ create(:ci_build, :scheduled, project: project, environment: env.name)
+ create(:ci_build, :scheduled, project: project, environment: env.name)
+ create(:ci_build, :scheduled, project: project, environment: env.name)
+
+ recorded = ActiveRecord::QueryRecorder.new { subject }
+ expected_queries = Gitlab.ee? ? 61 : 57
+
+ expect(recorded.count).to be_within(1).of(expected_queries)
+ expect(recorded.cached_count).to eq(0)
+ end
+ end
+
context 'with scheduled and manual builds' do
let(:ref) { 'feature' }