Converted samples and test projects to run on netcoreapp2.0

This commit is contained in:
Kiran Challa 2017-04-03 16:42:24 -07:00
parent 794508fbf2
commit c42617e057
10 changed files with 39 additions and 32 deletions

View File

@ -6,6 +6,7 @@
<DotNetPlatformAbstractionsVersion>1.1.0</DotNetPlatformAbstractionsVersion>
<CoreFxVersion>4.3.0</CoreFxVersion>
<NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
<RuntimeFrameworkVersion>2.0.0-*</RuntimeFrameworkVersion>
<TestSdkVersion>15.0.0</TestSdkVersion>
<XunitVersion>2.2.0</XunitVersion>
</PropertyGroup>

View File

@ -12,13 +12,7 @@ namespace MusicStore.Mocks.OpenIdConnect
{
var response = new HttpResponseMessage();
var basePath = Path.GetFullPath(Path.Combine(
#if NET451
AppDomain.CurrentDomain.BaseDirectory,
#else
AppContext.BaseDirectory,
#endif
"ForTesting", "Mocks", "OpenIdConnect"));
var basePath = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "ForTesting", "Mocks", "OpenIdConnect"));
if (request.RequestUri.AbsoluteUri == "https://login.windows.net/[tenantName].onmicrosoft.com/.well-known/openid-configuration")
{

View File

@ -4,10 +4,9 @@
<PropertyGroup>
<Description>Music store application on ASP.NET Core</Description>
<TargetFrameworks>net46;netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
<DefineConstants>$(DefineConstants);DEMO</DefineConstants>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<RuntimeIdentifiers>win7-x64;win7-x86;win81-x64;win81-x86;win10-x64;win10-x86;osx.10.10-x64;osx.10.11-x64;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.15.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>

View File

@ -3,11 +3,10 @@
<Import Project="..\..\build\dependencies.props" />
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<TargetFramework>netcoreapp2.0</TargetFramework>
<UserSecretsId>MusicStore.E2ETests</UserSecretsId>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<ServerGarbageCollection>true</ServerGarbageCollection>
<RuntimeIdentifiers>win7-x86;win7-x64;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.14.10-x64;ubuntu.15.04-x64;ubuntu.16.04-x64;centos.7-x64;debian.8-x64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>

View File

@ -27,9 +27,11 @@ namespace E2ETests
[OSSkipCondition(OperatingSystems.Linux)]
[OSSkipCondition(OperatingSystems.MacOSX)]
[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)]
[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone)]
[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone,
Skip = "https://github.com/aspnet/MusicStore/issues/761")]
[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)]
[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone)]
[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone,
Skip = "https://github.com/aspnet/MusicStore/issues/761")]
public async Task NtlmAuthenticationTest(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType)
{
try
@ -44,7 +46,7 @@ namespace E2ETests
{
PublishApplicationBeforeDeployment = true,
PreservePublishedApplicationForDebugging = Helpers.PreservePublishedApplicationForDebugging,
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net451" : "netcoreapp1.1",
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net46" : "netcoreapp2.0",
Configuration = Helpers.GetCurrentBuildConfiguration(),
ApplicationType = applicationType,
EnvironmentName = "NtlmAuthentication", //Will pick the Start class named 'StartupNtlmAuthentication'

View File

@ -27,7 +27,8 @@ namespace E2ETests
[OSSkipCondition(OperatingSystems.MacOSX)]
//[InlineData(ServerType.Kestrel, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone,
Skip = "https://github.com/aspnet/MusicStore/issues/761")]
public async Task OpenIdConnect_OnWindowsOS(
ServerType serverType,
RuntimeFlavor runtimeFlavor,
@ -40,7 +41,8 @@ namespace E2ETests
[ConditionalTheory, Trait("E2Etests", "E2Etests")]
[OSSkipCondition(OperatingSystems.Windows)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone, Skip = "https://github.com/aspnet/MusicStore/issues/761")]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone,
Skip = "https://github.com/aspnet/MusicStore/issues/761")]
public async Task OpenIdConnect_OnNonWindows(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType)
{
await OpenIdConnectTestSuite(serverType, runtimeFlavor, architecture, applicationType);
@ -70,7 +72,7 @@ namespace E2ETests
{
PublishApplicationBeforeDeployment = true,
PreservePublishedApplicationForDebugging = Helpers.PreservePublishedApplicationForDebugging,
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net451" : "netcoreapp1.1",
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net46" : "netcoreapp2.0",
Configuration = Helpers.GetCurrentBuildConfiguration(),
ApplicationType = applicationType,
EnvironmentName = "OpenIdConnectTesting",

View File

@ -27,10 +27,12 @@ namespace E2ETests
[OSSkipCondition(OperatingSystems.MacOSX)]
//[InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable, false)]
[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable, false)]
[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone, false)]
[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone, false,
Skip = "https://github.com/aspnet/MusicStore/issues/761")]
// [InlineData(ServerType.Kestrel, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable, false)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable, false)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone, false)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone, false,
Skip = "https://github.com/aspnet/MusicStore/issues/761")]
public async Task WindowsOS(
ServerType serverType,
RuntimeFlavor runtimeFlavor,
@ -46,7 +48,8 @@ namespace E2ETests
[ConditionalTheory, Trait("E2Etests", "PublishAndRun")]
[OSSkipCondition(OperatingSystems.Windows)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable, false)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone, false, Skip = "https://github.com/aspnet/MusicStore/issues/761")]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone, false,
Skip = "https://github.com/aspnet/MusicStore/issues/761")]
public async Task NonWindowsOS(
ServerType serverType,
RuntimeFlavor runtimeFlavor,
@ -149,7 +152,7 @@ namespace E2ETests
{
PublishApplicationBeforeDeployment = true,
PreservePublishedApplicationForDebugging = Helpers.PreservePublishedApplicationForDebugging,
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net451" : "netcoreapp1.1",
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net46" : "netcoreapp2.0",
Configuration = Helpers.GetCurrentBuildConfiguration(),
ApplicationType = applicationType,
UserAdditionalCleanup = parameters =>

View File

@ -79,13 +79,16 @@ namespace E2ETests
[OSSkipCondition(OperatingSystems.MacOSX)]
[InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)]
[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)]
[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone)]
[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone,
Skip = "https://github.com/aspnet/MusicStore/issues/761")]
[InlineData(ServerType.Kestrel, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone,
Skip = "https://github.com/aspnet/MusicStore/issues/761")]
[InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)]
[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)]
[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone)]
[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone,
Skip = "https://github.com/aspnet/MusicStore/issues/761")]
public async Task WindowsOS(
ServerType serverType,
RuntimeFlavor runtimeFlavor,
@ -99,7 +102,8 @@ namespace E2ETests
[ConditionalTheory, Trait("E2Etests", "Smoke")]
[OSSkipCondition(OperatingSystems.Windows)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone, Skip = "https://github.com/aspnet/MusicStore/issues/761")]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone,
Skip = "https://github.com/aspnet/MusicStore/issues/761")]
public async Task NonWindowsOS(
ServerType serverType,
RuntimeFlavor runtimeFlavor,
@ -183,7 +187,7 @@ namespace E2ETests
SiteName = "MusicStoreTestSite",
PublishApplicationBeforeDeployment = true,
PreservePublishedApplicationForDebugging = Helpers.PreservePublishedApplicationForDebugging,
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net46" : "netcoreapp1.1",
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net46" : "netcoreapp2.0",
Configuration = Helpers.GetCurrentBuildConfiguration(),
ApplicationType = applicationType,
UserAdditionalCleanup = parameters =>

View File

@ -32,9 +32,12 @@ namespace E2ETests
[OSSkipCondition(OperatingSystems.Linux)]
[OSSkipCondition(OperatingSystems.MacOSX)]
[SkipIfEnvironmentVariableNotEnabled("RUN_TESTS_ON_NANO")]
[InlineData(ServerType.Kestrel, 5000, ApplicationType.Standalone)]
[InlineData(ServerType.WebListener, 5000, ApplicationType.Standalone)]
[InlineData(ServerType.IIS, 8080, ApplicationType.Standalone)]
[InlineData(ServerType.Kestrel, 5000, ApplicationType.Standalone,
Skip = "https://github.com/aspnet/MusicStore/issues/761")]
[InlineData(ServerType.WebListener, 5000, ApplicationType.Standalone,
Skip = "https://github.com/aspnet/MusicStore/issues/761")]
[InlineData(ServerType.IIS, 8080, ApplicationType.Standalone,
Skip = "https://github.com/aspnet/MusicStore/issues/761")]
public async Task Test(ServerType serverType, int portToListen, ApplicationType applicationType)
{
var applicationBaseUrl = $"http://{_remoteDeploymentConfig.ServerName}:{portToListen}/";
@ -267,7 +270,7 @@ namespace E2ETests
_remoteDeploymentConfig.AccountName,
_remoteDeploymentConfig.AccountPassword)
{
TargetFramework = "netcoreapp1.1",
TargetFramework = "netcoreapp2.0",
ApplicationBaseUriHint = applicationBaseUrl,
ApplicationType = applicationType
};

View File

@ -3,8 +3,8 @@
<Import Project="..\..\build\dependencies.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net46</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netcoreapp2.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>