-
Notifications
You must be signed in to change notification settings - Fork 279
Fix MySQL test execution time + Fix DateTime GraphQL input handling #2265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…w. This caused HUGE test execution times.
…change engine code.
…results can be correctly compared to db results.
…re readable . also add comments to describe how mysql datetime data type has certain restrictions and accommodate how GraphQL (Hotchocolate) resolves user supplied datetimeoffset and sends to database and how dab then processes and returns the database response.
…lte .33 because expected value query isn't parameterized and doesn't capture the proper data type. real data type must be used as real '0.33'. to get expected value.
/azp run |
…s. Removed commented out resetDbStateAsync(). fixed test input to include UTC offset because SqlClient assumes input without offset specifier is current timezone and not UTC. Tracking via bug #2265, but offset specified so that tests pass locally for Redmond devs.
…ate pg differences with 'real' conversion.
src/Service.Tests/SqlTests/GraphQLSupportedTypesTests/GraphQLSupportedTypesTestsBase.cs
Show resolved
Hide resolved
src/Service.Tests/SqlTests/GraphQLSupportedTypesTests/GraphQLSupportedTypesTestsBase.cs
Show resolved
Hide resolved
src/Service.Tests/SqlTests/GraphQLSupportedTypesTests/MySqlGQLSupportedTypesTests.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat! LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments so far
src/Service.Tests/SqlTests/GraphQLSupportedTypesTests/DabField.cs
Outdated
Show resolved
Hide resolved
src/Service.Tests/SqlTests/GraphQLSupportedTypesTests/GraphQLSupportedTypesTestsBase.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Aniruddh Munde <anmunde@microsoft.com>
…upportedTypesTestsBase.cs Co-authored-by: Aniruddh Munde <anmunde@microsoft.com>
/azp run |
/azp run |
src/Service.Tests/SqlTests/GraphQLSupportedTypesTests/GraphQLSupportedTypesTestsBase.cs
Outdated
Show resolved
Hide resolved
src/Service.Tests/SqlTests/GraphQLSupportedTypesTests/PostgreSqlGQLSupportedTypesTests.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left few questions. But approved otherwise.
/azp run |
/azp run |
/azp run |
Why make this change?
I discovered another bug while working on this change #2268, which will be addressed separately.
What is this change?
Fixes a bug where GraphQL DateTime input with Timezone (TZ) offset was not honored.
12-31-2024T12:00:00+03:00
was stored as12-31-2024T12:00:00
in the backend database instead of12-31-2024T09:00:00
9999-12-31 23:59:59.9999999
was run for MySql where that value is an invalid date (max decimal is .499999).Fixes false negative (passing) test cases in GraphQLSupportedTypesTests by adding more comprehensive asserts, updating DataRow test input, and ensuring tests specific to a database type are correctly executed.
ResetDbStateAsync()
.)A bug in the test
This test shows as green in main branch. However, looking at the log of the test, I saw this error:
There are two layers of changes here:
\"23:59:59.9999999\"
in results in the error:why keep data row as "TIME_TYPE"? well, our test code resolves that type name not only as the GraphQL type but also as a way to determine which column in the data source to select which is named time_types. So we'd need to decouple the GraphQL Data Type value from being used to determine the SQL table column name.
How was this tested?