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:
authorYorick Peterse <yorickpeterse@gmail.com>2018-05-11 17:17:03 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2018-05-17 14:53:00 +0300
commit878ca2e69b371e6c12acee6bddd32b4406c651d7 (patch)
tree7f829cdf6d9020cf106b32b8ae63d7d9e96a629e /spec/serializers
parent19428e800895ba20eacb3357285acef8d69f6d8c (diff)
Exclude coverage data from the pipelines page
When displaying a project's pipelines (Projects::PipelinesController#index) we now exclude the coverage data. This data was not used by the frontend, yet getting it would require one SQL query per pipeline. These queries in turn could be quite expensive on GitLab.com.
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/pipeline_entity_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/serializers/pipeline_entity_spec.rb b/spec/serializers/pipeline_entity_spec.rb
index 2473c561f4b..e67d12b7a89 100644
--- a/spec/serializers/pipeline_entity_spec.rb
+++ b/spec/serializers/pipeline_entity_spec.rb
@@ -26,6 +26,13 @@ describe PipelineEntity do
expect(subject).to include :updated_at, :created_at
end
+ it 'excludes coverage data when disabled' do
+ entity = described_class
+ .represent(pipeline, request: request, disable_coverage: true)
+
+ expect(entity.as_json).not_to include(:coverage)
+ end
+
it 'contains details' do
expect(subject).to include :details
expect(subject[:details])