diff options
Diffstat (limited to 'spec/controllers/projects/pipelines_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/pipelines_controller_spec.rb | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb index 3d1d28945f7..4e0c098ad81 100644 --- a/spec/controllers/projects/pipelines_controller_spec.rb +++ b/spec/controllers/projects/pipelines_controller_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Projects::PipelinesController do +RSpec.describe Projects::PipelinesController, feature_category: :continuous_integration do include ApiHelpers let_it_be(:user) { create(:user) } @@ -52,21 +52,6 @@ RSpec.describe Projects::PipelinesController do expect(stages.count).to eq 3 end end - - it 'does not execute N+1 queries', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/345470' do - get_pipelines_index_json - - control_count = ActiveRecord::QueryRecorder.new do - get_pipelines_index_json - end.count - - create_all_pipeline_types - - # There appears to be one extra query for Pipelines#has_warnings? for some reason - expect { get_pipelines_index_json }.not_to exceed_query_limit(control_count + 1) - expect(response).to have_gitlab_http_status(:ok) - expect(json_response['pipelines'].count).to eq 12 - end end it 'does not include coverage data for the pipelines' do @@ -83,14 +68,7 @@ RSpec.describe Projects::PipelinesController do check_pipeline_response(returned: 2, all: 6) end - context 'when performing gitaly calls', :request_store do - before do - # To prevent double writes / fallback read due to MultiStore which is failing the `Gitlab::GitalyClient - # .get_request_count` expectation. - stub_feature_flags(use_primary_store_as_default_for_repository_cache: false) - stub_feature_flags(use_primary_and_secondary_stores_for_repository_cache: false) - end - + context 'when performing gitaly calls', :request_store, :use_null_store_as_repository_cache do it 'limits the Gitaly requests' do # Isolate from test preparation (Repository#exists? is also cached in RequestStore) RequestStore.end! @@ -1355,8 +1333,8 @@ RSpec.describe Projects::PipelinesController do .and_return(service) end - context 'when sending a valid sha' do - let(:sha) { 'master' } + context 'when sending a valid ref' do + let(:ref) { 'master' } let(:ci_config) do { variables: { @@ -1381,8 +1359,8 @@ RSpec.describe Projects::PipelinesController do end end - context 'when sending an invalid sha' do - let(:sha) { 'invalid-sha' } + context 'when sending an invalid ref' do + let(:ref) { 'invalid-ref' } before do synchronous_reactive_cache(service) @@ -1397,7 +1375,7 @@ RSpec.describe Projects::PipelinesController do end context 'when sending an invalid config' do - let(:sha) { 'master' } + let(:ref) { 'master' } let(:ci_config) do { variables: { @@ -1423,7 +1401,7 @@ RSpec.describe Projects::PipelinesController do end context 'when the cache is empty' do - let(:sha) { 'master' } + let(:ref) { 'master' } let(:ci_config) do { variables: { @@ -1446,7 +1424,7 @@ RSpec.describe Projects::PipelinesController do context 'when project uses external project ci config' do let(:other_project) { create(:project, :custom_repo, files: other_project_files) } let(:other_project_files) { { '.gitlab-ci.yml' => YAML.dump(other_project_ci_config) } } - let(:sha) { 'master' } + let(:ref) { 'master' } let(:other_project_ci_config) do { @@ -1479,7 +1457,7 @@ RSpec.describe Projects::PipelinesController do def get_config_variables get :config_variables, params: { namespace_id: project.namespace, project_id: project, - sha: sha }, + sha: ref }, format: :json end end |