aspnet / MusicStore

[Archived] MusicStore test application that uses ASP.NET/EF Core. Project moved to https://github.com/aspnet/AspNetCore
1.3k stars 878 forks source link

Fix EF warnings #768

Closed kichalla closed 7 years ago

kichalla commented 7 years ago

When E2E tests are run, there are bunch of warnings related to EF. Fix them:

[xUnit.net 00:01:28.1812638]         | Information: warn: Microsoft.EntityFrameworkCore.Infrastructure.IModelValidator[1]
[xUnit.net 00:01:28.1813102]         | Information:       No type was specified for the decimal column 'Price' on entity type 'Album'. This will cause values to be silently truncated if they do not fit in the default precision and scale. Explicitly specify the SQL server column type that can accomadate all the values using 'ForSqlServerHasColumnType()'. To configure this warning use the DbContextOptionsBuilder.ConfigureWarnings API (event id 'SqlServerEventId.DefaultDecimalTypeWarning'). ConfigureWarnings can be used when overriding the DbContext.OnConfiguring method or using AddDbContext on the application service provider.
[xUnit.net 00:01:28.1814721]         | Information: warn: Microsoft.EntityFrameworkCore.Infrastructure.IModelValidator[1]
[xUnit.net 00:01:28.1815205]         | Information:       No type was specified for the decimal column 'Total' on entity type 'Order'. This will cause values to be silently truncated if they do not fit in the default precision and scale. Explicitly specify the SQL server column type that can accomadate all the values using 'ForSqlServerHasColumnType()'. To configure this warning use the DbContextOptionsBuilder.ConfigureWarnings API (event id 'SqlServerEventId.DefaultDecimalTypeWarning'). ConfigureWarnings can be used when overriding the DbContext.OnConfiguring method or using AddDbContext on the application service provider.
[xUnit.net 00:01:28.1817035]         | Information: warn: Microsoft.EntityFrameworkCore.Infrastructure.IModelValidator[1]
[xUnit.net 00:01:28.1817567]         | Information:       No type was specified for the decimal column 'UnitPrice' on entity type 'OrderDetail'. This will cause values to be silently truncated if they do not fit in the default precision and scale. Explicitly specify the SQL server column type that can accomadate all the values using 'ForSqlServerHasColumnType()'. To configure this warning use the DbContextOptionsBuilder.ConfigureWarnings API (event id 'SqlServerEventId.DefaultDecimalTypeWarning'). ConfigureWarnings can be used when overriding the DbContext.OnConfiguring method or using AddDbContext on the application service provider.
[xUnit.net 00:01:28.1819264]         | Warning: Failed to complete the request : An error occurred while sending the request..
[xUnit.net 00:01:28.1819730]         | Warning: Retry count 2..
[xUnit.net 00:01:28.1820145]         | Information: Hosting environment: OpenIdConnectTesting
[xUnit.net 00:01:28.1820593]         | Information: Content root path: C:\Users\appveyor\AppData\Local\Temp\1\a3fc069d-5edb-4d78-833a-589ec6a98ccd
[xUnit.net 00:01:28.1821009]         | Information: Now listening on: http://localhost:5041
[xUnit.net 00:01:28.1821424]         | Information: Application started. Press Ctrl+C to shut down.
[xUnit.net 00:01:28.1821864]         | Information: warn: Microsoft.EntityFrameworkCore.Query.IQueryCompilationContextFactory[2]
[xUnit.net 00:01:28.1822319]         | Information:       Query: '(from Genre g in DbSet<Genre> select g.Name).Take(__p_0)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. To configure this warning use the DbContextOptionsBuilder.ConfigureWarnings API (event id 'CoreEventId.CompilingQueryModel'). ConfigureWarnings can be used when overriding the DbContext.OnConfiguring method or using AddDbContext on the application service provider.
[xUnit.net 00:01:28.1823707]         | Information: Application initialization successful.
[xUnit.net 00:01:28.1824171]         | Information: Application runtime information
[xUnit.net 00:01:28.1824577]         | Information: GET Account/Login
[xUnit.net 00:01:28.1825025]         | Information: Request headers: 
[xUnit.net 00:01:28.1825415]         | Information: Response headers: Cache-Control=no-cache
[xUnit.net 00:01:28.1825875]         |              Date=Wed, 29 Mar 2017 23:34:55 GMT
[xUnit.net 00:01:28.1826354]         |              Pragma=no-cache
[xUnit.net 00:01:28.1826846]         |              Transfer-Encoding=chunked
[xUnit.net 00:01:28.1827247]         |              Server=Kestrel
[xUnit.net 00:01:28.1827702]         |              Set-Cookie=.AspNetCore.Antiforgery.3fUK3SD-_Lg=CfDJ8AGxTE6vechNgE0jO75ILpz-6-jkZlE8uq_DYq_NLyflxqqI49_XhbJMK95J1iMtmgROkd-_kvDF5qEQZdcXFCPWQJMKHTXXGiX1_6K-DKCy6ZeB2snAONQFvHeKkKVwaBY4fXpKLNixN2eU93Vi15k; path=/; httponly,.AspNetCore.Session=CfDJ8AGxTE6vechNgE0jO75ILpxi7g%2BKHCZuY6z4AbZ5m%2FD6vsHeODjnQqFjucxgAfWP6IiP%2F2d5vO8Q%2B7LoCsYQyO%2FSlEEAcR3FNsi5OIuFa5YQKXPAHyBwsByP29bl%2BNL7meeqF7Huij2k4xc4JYuyFl6e1oDNI17%2BDdFpgO7QUFMK; path=/; httponly
[xUnit.net 00:01:28.1829112]         |              X-Frame-Options=SAMEORIGIN
[xUnit.net 00:01:28.1829574]         | Information: Signing in with OpenIdConnect account
[xUnit.net 00:01:28.1829986]         | Information: POST Account/ExternalLogin
[xUnit.net 00:01:28.1830432]         | Information: Request headers: 
[xUnit.net 00:01:28.1830885]         | Information: Response headers: Date=Wed, 29 Mar 201
Eilon commented 7 years ago

@ajcvickers - can someone on your team take a look at this?

Eilon commented 7 years ago

@ajcvickers anything to do here for preview1? Or should we move to preview2?

ajcvickers commented 7 years ago

@Eilon Sent a PR for this 12 days ago. Hasn't been looked at yet. There is no functional change, just a change to be more explicit in configuration so that the warning that configuration is not explicit is not shown. The app will function the same way with or without the warning. So, as far as I am aware, there is no need to do this for any particular release, but also no reason not to do it.

Eilon commented 7 years ago

Ah ok let's just fix in 'dev' then, now that we've branched.

ajcvickers commented 7 years ago

@Eilon What's the process for getting a review on the PR? Does anybody own MusicStore?

Eilon commented 7 years ago

@kichalla signed off on the PR yesterday. He is Mr. Music Store.

ajcvickers commented 7 years ago

@Eilon Oops. Sorry. Missed that he signed off on it. Thanks!