From 3448b6a74e1d57ba085543527971bb51a48c272e Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Fri, 2 Jun 2017 16:20:34 -0700 Subject: [PATCH] Re-enable net461 functional tests. aspnet/Coherence-Signed#540 --- .../ErrorPageTests.cs | 8 +++++++- .../Microsoft.AspNetCore.Mvc.FunctionalTests.csproj | 10 +++++++++- .../WebApiCompatShimBasicTest.cs | 5 +++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/ErrorPageTests.cs b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/ErrorPageTests.cs index 39c37876bc..7918e35ba7 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/ErrorPageTests.cs +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/ErrorPageTests.cs @@ -7,6 +7,7 @@ using System.Net.Http.Headers; using System.Text.Encodings.Web; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Razor.Internal; +using Microsoft.AspNetCore.Testing.xunit; using Xunit; namespace Microsoft.AspNetCore.Mvc.FunctionalTests @@ -91,7 +92,12 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests Assert.Contains(expectedCompilationContent, content); } - [Fact] + [ConditionalFact] + // MVC Generates portable PDBs when compiling Razor views. NET461 does not understand portable PDBs + // so line and file information cannot be determined. This is blocked until one of these issues are fixed: + // https://github.com/aspnet/Common/issues/235 + // https://github.com/aspnet/Mvc/issues/6356 + [FrameworkSkipCondition(RuntimeFrameworks.CLR)] public async Task RuntimeErrorAreListedByErrorPageMiddleware() { // Arrange diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj index bc6a40d855..e82788695f 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj @@ -2,13 +2,21 @@ - netcoreapp2.0 + netcoreapp2.0;net461 netcoreapp2.0 $(PackageTargetFallback);portable-net451+win8 $(DefineConstants);GENERATE_BASELINES $(DefineConstants);__RemoveThisBitTo__GENERATE_BASELINES $(DefineConstants);FUNCTIONAL_TESTS + + + true diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/WebApiCompatShimBasicTest.cs b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/WebApiCompatShimBasicTest.cs index 4d9cb8aae9..e18aa4c966 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/WebApiCompatShimBasicTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/WebApiCompatShimBasicTest.cs @@ -62,6 +62,11 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests { typeof(JsonMediaTypeFormatter).FullName, typeof(XmlMediaTypeFormatter).FullName, + +#if NET461 + // We call into WebAPI and ask it to add all of its formatters. On net461 it adds this additional formatter. + typeof(FormUrlEncodedMediaTypeFormatter).FullName +#endif }; // Act