Skip to content

Enhance test coverage for GraphQL queries by adding orderBy clause to… - #3753

Merged
Arpit Gupta (ar-guptaar) merged 2 commits into
mainfrom
dev/guptaar/improve-test-coverage
Aug 6, 2026
Merged

Enhance test coverage for GraphQL queries by adding orderBy clause to…#3753
Arpit Gupta (ar-guptaar) merged 2 commits into
mainfrom
dev/guptaar/improve-test-coverage

Conversation

@ar-guptaar

Copy link
Copy Markdown
Contributor

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?

  • Integration Tests
  • Unit Tests

@ar-guptaar

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 6 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 orderBy to existing MS SQL gQLmappings groupBy GraphQL test queries to ensure deterministic group ordering.
  • Adds two new DWSQL end-to-end regression tests covering groupBy with 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.

@ar-guptaar
Arpit Gupta (ar-guptaar) enabled auto-merge (squash) August 5, 2026 15:10
@ar-guptaar
Arpit Gupta (ar-guptaar) merged commit 3cfb270 into main Aug 6, 2026
14 checks passed
@ar-guptaar
Arpit Gupta (ar-guptaar) deleted the dev/guptaar/improve-test-coverage branch August 6, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants