Re-enable x86 test variants

This commit is contained in:
Chris Ross (ASP.NET) 2018-05-22 09:42:03 -07:00
parent 76354f7b9b
commit bb6657f3f6
9 changed files with 33 additions and 8 deletions

View File

@ -19,7 +19,7 @@
<MicrosoftAspNetCoreMvcRazorViewCompilationPackageVersion>2.2.0-preview1-34255</MicrosoftAspNetCoreMvcRazorViewCompilationPackageVersion> <MicrosoftAspNetCoreMvcRazorViewCompilationPackageVersion>2.2.0-preview1-34255</MicrosoftAspNetCoreMvcRazorViewCompilationPackageVersion>
<MicrosoftAspNetCorePackageVersion>2.2.0-preview1-34255</MicrosoftAspNetCorePackageVersion> <MicrosoftAspNetCorePackageVersion>2.2.0-preview1-34255</MicrosoftAspNetCorePackageVersion>
<MicrosoftAspNetCoreServerHttpSysPackageVersion>2.2.0-preview1-34255</MicrosoftAspNetCoreServerHttpSysPackageVersion> <MicrosoftAspNetCoreServerHttpSysPackageVersion>2.2.0-preview1-34255</MicrosoftAspNetCoreServerHttpSysPackageVersion>
<MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>0.6.0-preview1-34255</MicrosoftAspNetCoreServerIntegrationTestingPackageVersion> <MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>0.6.0-a-preview1-tratcher-x86-17041</MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>
<MicrosoftAspNetCoreSessionPackageVersion>2.2.0-preview1-34255</MicrosoftAspNetCoreSessionPackageVersion> <MicrosoftAspNetCoreSessionPackageVersion>2.2.0-preview1-34255</MicrosoftAspNetCoreSessionPackageVersion>
<MicrosoftAspNetCoreStaticFilesPackageVersion>2.2.0-preview1-34255</MicrosoftAspNetCoreStaticFilesPackageVersion> <MicrosoftAspNetCoreStaticFilesPackageVersion>2.2.0-preview1-34255</MicrosoftAspNetCoreStaticFilesPackageVersion>
<MicrosoftAspNetCoreWebUtilitiesPackageVersion>2.2.0-preview1-34255</MicrosoftAspNetCoreWebUtilitiesPackageVersion> <MicrosoftAspNetCoreWebUtilitiesPackageVersion>2.2.0-preview1-34255</MicrosoftAspNetCoreWebUtilitiesPackageVersion>

View File

@ -11,5 +11,8 @@
<DotNetCoreRuntime Include="$(MicrosoftNETCoreApp20PackageVersion)" /> <DotNetCoreRuntime Include="$(MicrosoftNETCoreApp20PackageVersion)" />
<DotNetCoreRuntime Include="$(MicrosoftNETCoreApp21PackageVersion)" /> <DotNetCoreRuntime Include="$(MicrosoftNETCoreApp21PackageVersion)" />
<DotNetCoreRuntime Include="$(MicrosoftNETCoreApp22PackageVersion)" /> <DotNetCoreRuntime Include="$(MicrosoftNETCoreApp22PackageVersion)" />
<DotNetCoreRuntime Condition="'$(OS)' == 'Windows_NT'" Include="$(MicrosoftNETCoreApp20PackageVersion)" Arch="x86" />
<DotNetCoreRuntime Condition="'$(OS)' == 'Windows_NT'" Include="$(MicrosoftNETCoreApp21PackageVersion)" Arch="x86" />
<DotNetCoreRuntime Condition="'$(OS)' == 'Windows_NT'" Include="$(MicrosoftNETCoreApp22PackageVersion)" Arch="x86" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -17,7 +17,6 @@ namespace MusicStore
.Build(); .Build();
var builder = new WebHostBuilder() var builder = new WebHostBuilder()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseConfiguration(config) .UseConfiguration(config)
.UseIISIntegration() .UseIISIntegration()
.UseStartup("MusicStore") .UseStartup("MusicStore")

View File

@ -1,4 +1,5 @@
using System.Globalization; using System.Globalization;
using System.Runtime.InteropServices;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
@ -182,6 +183,12 @@ namespace MusicStore
SupportedUICultures = supportedCultures SupportedUICultures = supportedCultures
}); });
app.Use((context, next) =>
{
context.Response.Headers["Arch"] = RuntimeInformation.ProcessArchitecture.ToString();
return next();
});
// Configure Session. // Configure Session.
app.UseSession(); app.UseSession();

View File

@ -1,5 +1,6 @@
using System; using System;
using System.Globalization; using System.Globalization;
using System.Runtime.InteropServices;
using System.Security.Claims; using System.Security.Claims;
using System.Security.Principal; using System.Security.Principal;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
@ -115,6 +116,12 @@ namespace MusicStore
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
app.UseDatabaseErrorPage(); app.UseDatabaseErrorPage();
app.Use((context, next) =>
{
context.Response.Headers["Arch"] = RuntimeInformation.ProcessArchitecture.ToString();
return next();
});
app.Use(async (context, next) => app.Use(async (context, next) =>
{ {
// Who will get admin access? For demo sake I'm listing the currently logged on user as the application // Who will get admin access? For demo sake I'm listing the currently logged on user as the application

View File

@ -17,7 +17,6 @@ namespace E2ETests
{ {
public static TestMatrix TestVariants public static TestMatrix TestVariants
=> TestMatrix.ForServers(ServerType.Kestrel) => TestMatrix.ForServers(ServerType.Kestrel)
.WithAllApplicationTypes()
.WithTfms(Tfm.NetCoreApp22, Tfm.NetCoreApp21, Tfm.NetCoreApp20, Tfm.Net461); .WithTfms(Tfm.NetCoreApp22, Tfm.NetCoreApp21, Tfm.NetCoreApp20, Tfm.Net461);
[ConditionalTheory] [ConditionalTheory]

View File

@ -119,6 +119,12 @@ namespace E2ETests
Assert.Contains("MusicStore.Views, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", responseContent); Assert.Contains("MusicStore.Views, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", responseContent);
} }
public void VerifyArchitecture(HttpResponseMessage response, RuntimeArchitecture arch)
{
Assert.True(response.Headers.TryGetValues("Arch", out var values), "Missing Arch header");
Assert.Equal(arch.ToString(), values.First(), ignoreCase: true);
}
public async Task VerifyNtlmHomePage(HttpResponseMessage response) public async Task VerifyNtlmHomePage(HttpResponseMessage response)
{ {
await VerifyHomePage(response, useNtlmAuthentication: true); await VerifyHomePage(response, useNtlmAuthentication: true);

View File

@ -18,7 +18,8 @@ namespace E2ETests
public static TestMatrix TestVariants public static TestMatrix TestVariants
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.HttpSys) => TestMatrix.ForServers(ServerType.IISExpress, ServerType.HttpSys)
.WithTfms(Tfm.NetCoreApp22, Tfm.NetCoreApp21, Tfm.NetCoreApp20, Tfm.Net461) .WithTfms(Tfm.NetCoreApp22, Tfm.NetCoreApp21, Tfm.NetCoreApp20, Tfm.Net461)
.WithAllApplicationTypes(); .WithAllApplicationTypes()
.WithAllArchitectures();
[ConditionalTheory] [ConditionalTheory]
[MemberData(nameof(TestVariants))] [MemberData(nameof(TestVariants))]
@ -70,6 +71,9 @@ namespace E2ETests
logger.LogInformation("Verifying home page"); logger.LogInformation("Verifying home page");
await validator.VerifyNtlmHomePage(response); await validator.VerifyNtlmHomePage(response);
logger.LogInformation("Verifying architecture");
validator.VerifyArchitecture(response, deploymentResult.DeploymentParameters.RuntimeArchitecture);
logger.LogInformation("Verifying access to store with permissions"); logger.LogInformation("Verifying access to store with permissions");
await validator.AccessStoreWithPermissions(); await validator.AccessStoreWithPermissions();

View File

@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Testing.xunit;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Testing; using Microsoft.Extensions.Logging.Testing;
using Xunit; using Xunit;
using Xunit.Abstractions;
namespace E2ETests namespace E2ETests
{ {
@ -19,9 +18,7 @@ namespace E2ETests
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.HttpSys) => TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.HttpSys)
.WithTfms(Tfm.NetCoreApp22, Tfm.NetCoreApp21, Tfm.NetCoreApp20, Tfm.Net461) .WithTfms(Tfm.NetCoreApp22, Tfm.NetCoreApp21, Tfm.NetCoreApp20, Tfm.Net461)
.WithAllApplicationTypes() .WithAllApplicationTypes()
.WithAllArchitectures() .WithAllArchitectures();
.Skip("https://github.com/aspnet/Hosting/issues/601",
v => v.Tfm != Tfm.Net461 && v.Architecture == RuntimeArchitecture.x86);
[ConditionalTheory] [ConditionalTheory]
[MemberData(nameof(TestVariants))] [MemberData(nameof(TestVariants))]
@ -71,6 +68,9 @@ namespace E2ETests
logger.LogInformation("Verifying home page"); logger.LogInformation("Verifying home page");
await validator.VerifyHomePage(response); await validator.VerifyHomePage(response);
logger.LogInformation("Verifying architecture");
validator.VerifyArchitecture(response, deploymentResult.DeploymentParameters.RuntimeArchitecture);
logger.LogInformation("Verifying static files are served from static file middleware"); logger.LogInformation("Verifying static files are served from static file middleware");
await validator.VerifyStaticContentServed(); await validator.VerifyStaticContentServed();