diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-06 12:12:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-06 12:12:47 +0300 |
commit | 08608c8e9e9821858dd2f452a3c9ebfb945ab69f (patch) | |
tree | c3450c88bef3c68d70c4f814858913aafce5a59f /spec/graphql | |
parent | 50b6f6a78828c6a455887b1ba2bdc049b1b1eff2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/graphql')
-rw-r--r-- | spec/graphql/mutations/design_management/delete_spec.rb | 69 | ||||
-rw-r--r-- | spec/graphql/resolvers/group_resolver_spec.rb | 2 | ||||
-rw-r--r-- | spec/graphql/resolvers/project_resolver_spec.rb | 2 |
3 files changed, 37 insertions, 36 deletions
diff --git a/spec/graphql/mutations/design_management/delete_spec.rb b/spec/graphql/mutations/design_management/delete_spec.rb index 1b78529fbc7..7f499301543 100644 --- a/spec/graphql/mutations/design_management/delete_spec.rb +++ b/spec/graphql/mutations/design_management/delete_spec.rb @@ -86,46 +86,47 @@ RSpec.describe Mutations::DesignManagement::Delete do end end - it 'runs no more than 31 queries' do + it 'runs no more than 34 queries' do allow(Gitlab::Tracking).to receive(:event) # rubocop:disable RSpec/ExpectGitlabTracking filenames.each(&:present?) # ignore setup - # Queries: as of 2022-09-08 + # Queries: as of 2022-12-01 # ------------- - # 01. routing query - # 02. policy query: find namespace by type and id - # 03. policy query: find namespace by id - # 04. policy query: project.project_feature - # 05,06. project.authorizations for user (same query twice) - # 07. find issue by iid - # 08. find project by id - # 09. find namespace by id - # 10. find group namespace by id - # 11. policy query: find namespace by id (same query as 3) - # 12. project.authorizations for user (same query as 5) - # 13. find user by id - # 14. project.project_features (same query as 3) - # 15. project.authorizations for user (same query as 5) - # 16. current designs by filename and issue - # 17, 18 project.authorizations for user (same query as 5) - # 19. find design_management_repository for project - # 20. find route by id and source_type + # 01. for routes to find routes.source_id of projects matching paths + # 02. Find projects with the above source id. + # 03. preload routes of the above projects + # 04. policy query: find namespace by type and id + # 05. policy query: namespace_bans + # 06. policy query: project.project_feature + # 07,08. project.authorizations for user (same query twice) + # 09. find issue by iid + # 10. find project by id + # 11. find namespace by id + # 12. policy query: find namespace by type and id (same query as 4) + # 13. project.authorizations for user (same query as 7) + # 14. find user by id + # 15. project.project_features (same query as 6) + # 16. project.authorizations for user (same query as 7) + # 17. current designs by filename and issue + # 18, 19 project.authorizations for user (same query as 7) + # 20. find design_management_repository for project + # 21. find route by source_id and source_type # ------------- our queries are below: - # 21. start transaction - # 22. create version with sha and issue - # 23. create design-version links - # 24. validate version.actions.present? - # 25. validate version.sha is unique - # 26. validate version.issue.present? - # 27. leave transaction - # 28. find project by id (same query as 8) - # 29. find namespace by id (same query as 9) - # 30. find project by id (same query as 8) - # 31. find project by id (same query as 8) - # 32. create event - # 33. find plan for standard context + # 22. start transaction + # 23. create version with sha and issue + # 24. create design-version links + # 25. validate version.actions.present? + # 26. validate version.sha is unique + # 27. validate version.issue.present? + # 28. leave transaction + # 29. find project by id (same query as 10) + # 30. find namespace by id (same query as 11) + # 31. find project by id (same query as 10) + # 32. find project by id (same query as 10) + # 33. create event + # 34. find plan for standard context # - expect { run_mutation }.not_to exceed_query_limit(33) + expect { run_mutation }.not_to exceed_query_limit(34) end end diff --git a/spec/graphql/resolvers/group_resolver_spec.rb b/spec/graphql/resolvers/group_resolver_spec.rb index ed406d14772..c04961b4804 100644 --- a/spec/graphql/resolvers/group_resolver_spec.rb +++ b/spec/graphql/resolvers/group_resolver_spec.rb @@ -12,7 +12,7 @@ RSpec.describe Resolvers::GroupResolver do it 'batch-resolves groups by full path' do paths = [group1.full_path, group2.full_path] - result = batch_sync(max_queries: 1) do + result = batch_sync(max_queries: 3) do paths.map { |path| resolve_group(path) } end diff --git a/spec/graphql/resolvers/project_resolver_spec.rb b/spec/graphql/resolvers/project_resolver_spec.rb index dec9d4701e1..03febc75d3f 100644 --- a/spec/graphql/resolvers/project_resolver_spec.rb +++ b/spec/graphql/resolvers/project_resolver_spec.rb @@ -13,7 +13,7 @@ RSpec.describe Resolvers::ProjectResolver do it 'batch-resolves projects by full path' do paths = [project1.full_path, project2.full_path] - result = batch_sync(max_queries: 1) do + result = batch_sync(max_queries: 3) do paths.map { |path| resolve_project(path) } end |