-
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
FromSqlRaw_queryable_simple_projection_composed references ignored properties #18111
Comments
EF model in test if subset of what northwind data is. Make sure you have full data of northwind rather than relying on test model.
Make sure to use correct way to load all the data. Partial data is test issue in MySQL. |
If that is the case, then there needs to be at least a test to ensure, that the full Northwind data set is being used for testing.
The only point in over 13,000 tests, where it is suddenly a problem not to have preloaded the entire Northwind data set, seems to be the
If it should be tested that a raw sql query's filter can use a column that is ignored in the model, this should be made explicit and should be it's own separate test. |
@lauxjpn - Northwind database is preloaded dataset and currently we only use subset of it. If you deviate from that thing, then yes some tests may fail. As a provider writer you have 2 choices, either correct the data in your northwind or just skip/override the test. Yes, we can change this one test but I would also insist on having a test which verify that the raw sql can be disconnected from mapped model & that new separate test would fail for you. At the end of day, it is a test assembly we publish to help provider writers and not a source code. Not everything would make sense for all providers. So providers need to figure out if some tests they do not want run. I believe in the absence of proper data in Northwind, this is case for you. |
@smitpatel If you would consider a PR that ...
... I can provide one. This will make not a lot of difference for us anymore, but will be one less pitfall for upcoming provider developers. |
@lauxjpn - We discussed this in team and we decided to keep existing behavior. As a provider if you are utilizing specification tests you will need full dataset for Northwind. |
Adding a compliance test to check the availability (of a couple of not mapped columns) of the full Northwind data set (using simple raw SQL) is probably to way to go here then. |
@lauxjpn - That is the thing, we don't think value of adding a compliance test outweighs it's value. We will mention it in our docs for provider writers. |
The properties/columns
UnitsOnOrder
andReorderLevel
are referenced here inside the query:https://github.com/aspnet/EntityFrameworkCore/blob/fb2a8ed9381941bfe41744a80e90f9cd0ea05c83/test/EFCore.Relational.Specification.Tests/Query/FromSqlQueryTestBase.cs#L682-L699
They are being explicitly ignored in the model though:
https://github.com/aspnet/EntityFrameworkCore/blob/fb2a8ed9381941bfe41744a80e90f9cd0ea05c83/test/EFCore.Specification.Tests/TestModels/Northwind/NorthwindContext.cs#L55
This does not make the
SqlServer
andSqlite
tests fail, because they bootstrap their tests with a SQL dump/db file for the Northwind database, which contains the ignored column.In Pomelo.MySql, we don't load a dump for the tests (yet) and hit an exception, due to unknown columns in the query.
We use the following code in our
NorthwindQueryMySqlFixture.OnModelCreating
as a workaround for now:There exists another issue regarding this test: #16079
The text was updated successfully, but these errors were encountered: