diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-05 00:07:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-05 00:07:37 +0300 |
commit | 808b8561f4e75b2db7c7e94a6c7651efb546048b (patch) | |
tree | 2cb7546939b56fef3a73a52dd8790de55f0fc0e4 /spec/graphql | |
parent | cc514c362bcd4b657bf6a6d1d37f5305952df363 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/graphql')
4 files changed, 8 insertions, 8 deletions
diff --git a/spec/graphql/resolvers/design_management/versions_resolver_spec.rb b/spec/graphql/resolvers/design_management/versions_resolver_spec.rb index eb39e5bafc5..744e7f35891 100644 --- a/spec/graphql/resolvers/design_management/versions_resolver_spec.rb +++ b/spec/graphql/resolvers/design_management/versions_resolver_spec.rb @@ -43,15 +43,15 @@ RSpec.describe Resolvers::DesignManagement::VersionsResolver do context 'loading associations' do it 'prevents N+1 queries when loading author' do - control_count = ActiveRecord::QueryRecorder.new(skip_cached: false) do + control = ActiveRecord::QueryRecorder.new(skip_cached: false) do resolve_versions(object).items.map(&:author) - end.count + end create_list(:design_version, 3, issue: issue) expect do resolve_versions(object).items.map(&:author) - end.not_to exceed_all_query_limit(control_count) + end.not_to exceed_all_query_limit(control) end end end diff --git a/spec/graphql/resolvers/group_labels_resolver_spec.rb b/spec/graphql/resolvers/group_labels_resolver_spec.rb index 08e17cedfcc..2e583a1703d 100644 --- a/spec/graphql/resolvers/group_labels_resolver_spec.rb +++ b/spec/graphql/resolvers/group_labels_resolver_spec.rb @@ -78,7 +78,7 @@ RSpec.describe Resolvers::GroupLabelsResolver do Gitlab::SafeRequestStore.ensure_request_store do resolve_labels(group, params).to_a end - end.not_to exceed_query_limit(control.count) + end.not_to exceed_query_limit(control) end end diff --git a/spec/graphql/resolvers/labels_resolver_spec.rb b/spec/graphql/resolvers/labels_resolver_spec.rb index 16cf2e73736..fd55c3131b4 100644 --- a/spec/graphql/resolvers/labels_resolver_spec.rb +++ b/spec/graphql/resolvers/labels_resolver_spec.rb @@ -78,7 +78,7 @@ RSpec.describe Resolvers::LabelsResolver do Gitlab::SafeRequestStore.ensure_request_store do resolve_labels(project, params).to_a end - end.not_to exceed_query_limit(control.count) + end.not_to exceed_query_limit(control) end end diff --git a/spec/graphql/types/current_user_todos_type_spec.rb b/spec/graphql/types/current_user_todos_type_spec.rb index febbe868f33..2b33a705ae2 100644 --- a/spec/graphql/types/current_user_todos_type_spec.rb +++ b/spec/graphql/types/current_user_todos_type_spec.rb @@ -159,17 +159,17 @@ RSpec.describe GitlabSchema.types['CurrentUserTodos'] do # AND ("todos"."state" IN ('done','pending')) # AND "todos"."target_id" = merge_request # AND "todos"."target_type" = 'MergeRequest' ORDER BY "todos"."id" DESC - baseline = ActiveRecord::QueryRecorder.new do + control = ActiveRecord::QueryRecorder.new do execute_query(query_type, graphql: base_query) end expect do execute_query(query_type, graphql: query_without_state_arguments) - end.not_to exceed_query_limit(baseline) # at present this is 3 + end.not_to exceed_query_limit(control) # at present this is 3 expect do execute_query(query_type, graphql: with_state_arguments) - end.not_to exceed_query_limit(baseline.count + 1) + end.not_to exceed_query_limit(control).with_threshold(1) end it 'returns correct data' do |