Skip to content

Commit 1d1d664

Browse files
committed
Merge branch 'release/2.2' into master
- no-ops except for - Update PatchConfig.props (2835f85) - Add some additional logging to ErrorPageMiddlewareWebSite (dotnet#8049) (aka 1ca6202) - Put MVC's functional tests in a separate test group (dotnet#8118) (aka db3795b) - ignore the build queue (4f2a0ed) change because we're not hitting Linux resource issues in `master` branch - ignore baseline test changes (5661c41 and d2a4435) because they're not applicable in `master`
2 parents f303a55 + 909d951 commit 1d1d664

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

eng/PatchConfig.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Later on, this will be checked using this condition:
3535
</PropertyGroup>
3636
<PropertyGroup Condition=" '$(VersionPrefix)' == '2.2.4' ">
3737
<PackagesInPatch>
38+
@aspnet/signalr;
3839
</PackagesInPatch>
3940
</PropertyGroup>
4041
</Project>

src/Mvc/test/Mvc.FunctionalTests/ErrorPageTests.cs

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,44 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4+
using System;
5+
using System.Linq;
46
using System.Net;
57
using System.Net.Http;
68
using System.Net.Http.Headers;
79
using System.Text.Encodings.Web;
810
using System.Threading.Tasks;
11+
using Microsoft.AspNetCore.Hosting;
12+
using Microsoft.Extensions.DependencyInjection;
13+
using Microsoft.Extensions.Logging;
14+
using Microsoft.Extensions.Logging.Testing;
915
using Xunit;
16+
using Xunit.Abstractions;
1017

1118
namespace Microsoft.AspNetCore.Mvc.FunctionalTests
1219
{
1320
/// <summary>
1421
/// Functional test to verify the error reporting of Razor compilation by diagnostic middleware.
1522
/// </summary>
16-
public class ErrorPageTests : IClassFixture<MvcTestFixture<ErrorPageMiddlewareWebSite.Startup>>
23+
public class ErrorPageTests : IClassFixture<MvcTestFixture<ErrorPageMiddlewareWebSite.Startup>>, IDisposable
1724
{
1825
private static readonly string PreserveCompilationContextMessage = HtmlEncoder.Default.Encode(
1926
"One or more compilation references may be missing. " +
2027
"If you're seeing this in a published application, set 'CopyRefAssembliesToPublishDirectory' to true in your project file to ensure files in the refs directory are published.");
21-
public ErrorPageTests(MvcTestFixture<ErrorPageMiddlewareWebSite.Startup> fixture)
28+
private readonly AssemblyTestLog _assemblyTestLog;
29+
30+
public ErrorPageTests(
31+
MvcTestFixture<ErrorPageMiddlewareWebSite.Startup> fixture,
32+
ITestOutputHelper testOutputHelper)
2233
{
23-
Client = fixture.CreateDefaultClient();
34+
_assemblyTestLog = AssemblyTestLog.ForAssembly(GetType().Assembly);
35+
36+
var loggerProvider = _assemblyTestLog.CreateLoggerFactory(testOutputHelper, GetType().Name);
37+
38+
var factory = fixture.Factories.FirstOrDefault() ?? fixture.WithWebHostBuilder(b => b.UseStartup<ErrorPageMiddlewareWebSite.Startup>());
39+
Client = factory
40+
.WithWebHostBuilder(builder => builder.ConfigureLogging(l => l.Services.AddSingleton<ILoggerFactory>(loggerProvider)))
41+
.CreateDefaultClient();
2442
}
2543

2644
public HttpClient Client { get; }
@@ -143,5 +161,10 @@ public async Task AggregateException_FlattensInnerExceptions()
143161
Assert.Contains(nullReferenceException, content);
144162
Assert.Contains(indexOutOfRangeException, content);
145163
}
164+
165+
public void Dispose()
166+
{
167+
_assemblyTestLog.Dispose();
168+
}
146169
}
147170
}

src/Mvc/test/Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="$(MvcTestingTargets)" Condition="'$(MvcTestingTargets)' != ''" />
33

44
<PropertyGroup>
55
<TargetFramework>netcoreapp3.0</TargetFramework>
66

77
<DefineConstants Condition="'$(GenerateBaselines)'=='true'">$(DefineConstants);GENERATE_BASELINES</DefineConstants>
88
<DefineConstants>$(DefineConstants);__RemoveThisBitTo__GENERATE_BASELINES</DefineConstants>
9+
<TestGroupName>Mvc.FunctionalTests</TestGroupName>
910
<!-- The test asset projects this depends on are not strong-named. -->
1011
<SignAssembly>false</SignAssembly>
1112
<!-- https://github.com/aspnet/AspNetCore/issues/6549 -->

0 commit comments

Comments
 (0)