-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Interception tests don't normalize SQL #16701
Comments
@roji What's the functional impact of this? (I intentionally wrote the tests with what I thought would be universally acceptable SQL to reduce the need for provider-specific validation in the tests.) |
PostgreSQL as the peculiar feature of folding unquoted identifiers to lowercase. So running these tests fails because a table with the name We've encountered this several times over the years :) From the PostgreSQL point of view, universally acceptable SQL would contain only all-lowercase identifiers - but that may be a ugly. On the other hand the FromSql tests already utilize a normalization thing the turns square brackets to whatever the provider needs, so if you write |
@roji Specifically which tests are failing? (I think we might be talking cross-purposes.) |
Here are the failing tests (all from CommandInterceptionTestBase): [ConditionalTheory(Skip = "https://github.com/aspnet/EntityFrameworkCore/issues/16701")]
public override Task Intercept_non_query_one_app_and_one_injected_interceptor(bool async) => null;
[ConditionalTheory(Skip = "https://github.com/aspnet/EntityFrameworkCore/issues/16701")]
public override Task Intercept_non_query_passively(bool async, bool inject) => null;
[ConditionalTheory(Skip = "https://github.com/aspnet/EntityFrameworkCore/issues/16701")]
public override Task Intercept_non_query_to_mutate_command(bool async, bool inject) => null;
[ConditionalTheory(Skip = "https://github.com/aspnet/EntityFrameworkCore/issues/16701")]
public override Task Intercept_non_query_to_replace_execution(bool async, bool inject) => null;
[ConditionalTheory(Skip = "https://github.com/aspnet/EntityFrameworkCore/issues/16701")]
public override Task Intercept_non_query_to_replaceresult(bool async, bool inject) => null;
[ConditionalTheory(Skip = "https://github.com/aspnet/EntityFrameworkCore/issues/16701")]
public override Task Intercept_non_query_with_explicitly_composed_app_interceptor(bool async) => null;
[ConditionalTheory(Skip = "https://github.com/aspnet/EntityFrameworkCore/issues/16701")]
public override Task Intercept_non_query_with_two_injected_interceptors(bool async) => null; All fail because of SQL with an unquoted Singularity table name. This should all be easy to fix, just wanted to scope it out for now. BTW these tests seem like they have less value as spec tests, as there's nothing providers need to actually do for them to work. In other words, they're exercising a core feature, but they need to exercise it on some provider, which is why they're in the spec tests. Obviously no big deal, but if we wanted to we could have a separate test project for this kind of thing, to keep the spec test burden on providers lower. |
Nope - ok to close, am tracking this on my side too. |
* Convention change from EFCore 3574cfbddfdf485548b9e217f8e01a5ffeaf8562 * Unskipped command interception tests (dotnet/efcore#16701) * Un-overridden test (dotnet/efcore#19855)
* Convention change from EFCore 3574cfbddfdf485548b9e217f8e01a5ffeaf8562 * Unskipped command interception tests (dotnet/efcore#16701) * Un-overridden test (dotnet/efcore#19855)
The new interception tests send un-normalized SQL to the database, so identifiers get cast to lowercase in PostgreSQL. Pass through RelationalTestStore.NormalizeDelimetersInRawString.
/cc @ajcvickers
The text was updated successfully, but these errors were encountered: