Enhance test coverage for GraphQL queries by adding orderBy clause to… - #3753
Merged
Merged
Conversation
… gQLmappings in multiple test cases
Arpit Gupta (ar-guptaar)
requested review from
Alekhya-Polavarapu,
Aniruddh Munde (Aniruddh25),
Jerry Nixon (JerryNixon),
RubenCerna2079,
aaronburtle,
Anusha Kolan (anushakolan),
rusamant,
Sourabh Jain (sourabh1007),
Souvik Ghosh (souvikghosh04),
Stuart Padley (stuartpa) and
vadeveka
as code owners
August 5, 2026 07:49
Contributor
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 6 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR strengthens GraphQL integration test reliability and coverage for groupBy scenarios involving mapped (aliased) columns by making result ordering deterministic and adding DWSQL-specific regression coverage.
Changes:
- Adds
orderByto existing MS SQLgQLmappingsgroupByGraphQL test queries to ensure deterministic group ordering. - Adds two new DWSQL end-to-end regression tests covering
groupBywith mapped columns (fields-only, and fields + aggregations + HAVING + ordering). - Normalizes formatting in several DWSQL expected SQL query strings (whitespace-only adjustments).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Service.Tests/SqlTests/GraphQLQueryTests/MsSqlGraphQLQueryTests.cs | Adds explicit orderBy to mapped-column groupBy GraphQL queries to make returned group order deterministic for assertions. |
| src/Service.Tests/SqlTests/GraphQLQueryTests/DwSqlGraphQLQueryTests.cs | Adds DWSQL regression coverage for mapped-column groupBy scenarios and applies minor SQL string formatting cleanups. |
Arpit Gupta (ar-guptaar)
enabled auto-merge (squash)
August 5, 2026 15:10
naxing123
approved these changes
Aug 5, 2026
Aniruddh Munde (Aniruddh25)
approved these changes
Aug 6, 2026
naxing123
pushed a commit
that referenced
this pull request
Aug 12, 2026
#3753) ## Why make this change? In a previously merged PR, there were comments about some gaps in testing scenarios, which is addressed as part of this change. ## What is this change? This pull request adds comprehensive regression tests for groupBy queries involving mapped (aliased) columns in both MS SQL and DWSQL environments, and ensures deterministic query results by explicitly specifying `orderBy` in all relevant test GraphQL queries. **Test Coverage Improvements:** * Added two new end-to-end regression tests to `DwSqlGraphQLQueryTests.cs`: * One test verifies that grouping and projecting only a mapped column works as expected, ensuring the backing column is used for grouping and the alias is used in the response. * Another test covers grouping, selecting, aggregating, applying HAVING filters, and ordering on a mapped column, confirming consistent use of the backing column in all SQL clauses while projecting the mapped names in the response. ## How was this tested? - [X] Integration Tests - [X] Unit Tests Co-authored-by: ARPIT GUPTA <guptaar@microsoft.com> (cherry picked from commit 3cfb270)
naxing123
added a commit
that referenced
this pull request
Aug 12, 2026
…ease/2.0 (#3767) Ports the PostgreSQL GraphQL groupby/aggregation and related feature commits from `main` (released in v2.1.0-rc) to `release/2.0` via cherry-pick. ## Commits ported (chronological) | PR | Title | |----|-------| | #3450 | Fix GraphQL aggregation features disabled when runtime.graphql config section is absent | | #3694 | Database policy support for PUT/PATCH operations - PostgreSQL | | #3728 | Add support for DateTime filters in PostgreSQL | | #3750 | Fix column mapping in GroupBy and aggregation queries | | #3741 | Add groupby/aggregation support for PostgreSQL in GraphQL | | #3753 | Enhance test coverage for GraphQL queries by adding orderBy clause | ## Notes - All six cherry-picks applied cleanly. - One manual adjustment in `SqlMutationEngine.cs` (part of #3694 port): the original referenced `effectiveOperationType` (a local introduced by the unrelated refactor #3287, which is not in `release/2.0`). Substituted `context.OperationType`, which is functionally equivalent in that non-upsert branch and matches the `release/2.0` convention. Folded into the #3694 commit. - Solution builds clean (0 warnings, 0 errors). - Integration tests (PostgreSql/MsSql) require live databases and were not run locally. --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Aniruddh25 <3513779+Aniruddh25@users.noreply.github.com> Co-authored-by: Aniruddh Munde <anmunde@microsoft.com> Co-authored-by: Souvik Ghosh <souvikofficial04@gmail.com> Co-authored-by: Arjun Narendra <arjunnarendra1@gmail.com> Co-authored-by: RubenCerna2079 <32799214+RubenCerna2079@users.noreply.github.com> Co-authored-by: Arpit Gupta <106474712+ar-guptaar@users.noreply.github.com> Co-authored-by: ARPIT GUPTA <guptaar@microsoft.com> Co-authored-by: Anusha Kolan <anushakolan10@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why make this change?
In a previously merged PR, there were comments about some gaps in testing scenarios, which is addressed as part of this change.
What is this change?
This pull request adds comprehensive regression tests for groupBy queries involving mapped (aliased) columns in both MS SQL and DWSQL environments, and ensures deterministic query results by explicitly specifying
orderByin all relevant test GraphQL queries.Test Coverage Improvements:
DwSqlGraphQLQueryTests.cs:How was this tested?