efcore
efcore copied to clipboard
RevEng: Add end to end tests which checks from database script to generated code
(#29105)
Every time I work in scaffolding area, I miss this so much!
@ajcvickers @bricelam @smitpatel Wonder if I could help here?
Could a SQL Server Database project => generated code path add value?
I think best way to handle this with the current pattern/infra we have is to have a class which is combination of https://github.com/dotnet/efcore/blob/release/7.0/test/EFCore.SqlServer.FunctionalTests/Scaffolding/SqlServerDatabaseModelFactoryTest.cs https://github.com/dotnet/efcore/blob/release/7.0/test/EFCore.Design.Tests/Scaffolding/Internal/RelationalScaffoldingModelFactoryTest.cs https://github.com/dotnet/efcore/blob/release/7.0/test/EFCore.Design.Tests/Scaffolding/Internal/CSharpEntityTypeGeneratorTest.cs
So we can test e2e from database script to generate code. It may require some refactoring to account for provider specific tests. I think one of the main reason I had filed this issue because the model we generate to verify generated code is not going to be same as model scaffolder would generate from facets perspective (like no hierarchy or shadow property or value converter etc)
@smitpatel Got it
Yeah... We should definitely avoid SQL Server-specific mechanisms here, since we'd want these e2e tests to work on other databases.