Use in memory store for non-windows tests and disable tests until new cli is available

This commit is contained in:
= 2016-05-04 16:30:15 -07:00 committed by John Luo
parent a3975422ec
commit 6af8da4713
7 changed files with 15 additions and 19 deletions

View File

@ -42,11 +42,8 @@ namespace MusicStore
{
services.Configure<AppSettings>(Configuration.GetSection("AppSettings"));
//Sql client not available on mono
var useInMemoryStore = _platform.IsRunningOnMono;
// Add EF services to the services container
if (useInMemoryStore)
if (_platform.UseInMemoryStore)
{
services.AddDbContext<MusicStoreContext>(options =>
options.UseInMemoryDatabase());

View File

@ -47,13 +47,8 @@ namespace MusicStore
{
services.Configure<AppSettings>(Configuration.GetSection("AppSettings"));
//Sql client not available on mono
var useInMemoryStore = !_platform.IsRunningOnWindows
|| _platform.IsRunningOnMono
|| _platform.IsRunningOnNanoServer;
// Add EF services to the services container
if (useInMemoryStore)
if (_platform.UseInMemoryStore)
{
services.AddDbContext<MusicStoreContext>(options =>
options.UseInMemoryDatabase());

View File

@ -86,5 +86,14 @@ namespace MusicStore
return _isNano.Value;
}
}
// Sql client not available on mono, non-windows, or nano
public bool UseInMemoryStore
{
get
{
return !IsRunningOnWindows || IsRunningOnMono || IsRunningOnNanoServer;
}
}
}
}

View File

@ -36,12 +36,9 @@ namespace MusicStore
public void ConfigureServices(IServiceCollection services)
{
services.Configure<AppSettings>(Configuration.GetSection("AppSettings"));
var useInMemoryStore = !_platform.IsRunningOnWindows
|| _platform.IsRunningOnMono
|| _platform.IsRunningOnNanoServer;
// Add EF services to the services container
if (useInMemoryStore)
if (_platform.UseInMemoryStore)
{
services.AddDbContext<MusicStoreContext>(options =>
options.UseInMemoryDatabase());

View File

@ -53,10 +53,8 @@ namespace MusicStore
{
services.Configure<AppSettings>(Configuration.GetSection("AppSettings"));
var useInMemoryStore = _platform.IsRunningOnMono || _platform.IsRunningOnNanoServer;
// Add EF services to the services container
if (useInMemoryStore)
if (_platform.UseInMemoryStore)
{
services.AddDbContext<MusicStoreContext>(options =>
options.UseInMemoryDatabase());

View File

@ -38,7 +38,7 @@ namespace E2ETests
await OpenIdConnectTestSuite(serverType, runtimeFlavor, architecture, applicationType, applicationBaseUrl);
}
[ConditionalTheory, Trait("E2Etests", "E2Etests")]
[ConditionalTheory(Skip = "Need to wait for a new cli with rc3 packages"), Trait("E2Etests", "E2Etests")]
[OSSkipCondition(OperatingSystems.Windows)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable, "http://localhost:5043/")]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone, "http://localhost:5044/")]

View File

@ -100,7 +100,7 @@ namespace E2ETests
await smokeTestRunner.SmokeTestSuite(serverType, runtimeFlavor, architecture, applicationType, applicationBaseUrl);
}
[ConditionalTheory, Trait("E2Etests", "Smoke")]
[ConditionalTheory(Skip = "Need to wait for a new cli with rc3 packages"), Trait("E2Etests", "Smoke")]
[OSSkipCondition(OperatingSystems.Windows)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable, "http://localhost:5020/")]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone, "http://localhost:5021/")]