Skip to content

Commit d00a228

Browse files
author
msftbot[bot]
authored
Merge pull request #26682 from dotnet-maestro-bot/merge/release/5.0-to-master
[automated] Merge branch 'release/5.0' => 'master'
2 parents 3fdbc2e + e675d67 commit d00a228

24 files changed

+364
-464
lines changed

eng/Versions.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@
221221
<CommandLineParserPackageVersion>2.3.0</CommandLineParserPackageVersion>
222222
<FSharpCorePackageVersion>4.2.1</FSharpCorePackageVersion>
223223
<GoogleProtobufPackageVersion>3.13.0</GoogleProtobufPackageVersion>
224-
<GrpcAspNetCorePackageVersion>2.32.0-pre1</GrpcAspNetCorePackageVersion>
225-
<GrpcAuthPackageVersion>2.32.0-pre1</GrpcAuthPackageVersion>
226-
<GrpcNetClientPackageVersion>2.32.0-pre1</GrpcNetClientPackageVersion>
227-
<GrpcToolsPackageVersion>2.32.0-pre1</GrpcToolsPackageVersion>
224+
<GrpcAspNetCorePackageVersion>2.32.0</GrpcAspNetCorePackageVersion>
225+
<GrpcAuthPackageVersion>2.32.0</GrpcAuthPackageVersion>
226+
<GrpcNetClientPackageVersion>2.32.0</GrpcNetClientPackageVersion>
227+
<GrpcToolsPackageVersion>2.32.0</GrpcToolsPackageVersion>
228228
<IdentityServer4AspNetIdentityPackageVersion>4.1.0</IdentityServer4AspNetIdentityPackageVersion>
229229
<IdentityServer4EntityFrameworkPackageVersion>4.1.0</IdentityServer4EntityFrameworkPackageVersion>
230230
<IdentityServer4PackageVersion>4.1.0</IdentityServer4PackageVersion>

src/Components/test/E2ETest/Infrastructure/AssemblyInfo.AssemblyFixtures.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using Microsoft.AspNetCore.E2ETesting;
5+
using Microsoft.AspNetCore.Testing;
56
using Xunit;
67

7-
[assembly: TestFramework("Microsoft.AspNetCore.E2ETesting.XunitTestFrameworkWithAssemblyFixture", "Microsoft.AspNetCore.Components.E2ETests")]
88
[assembly: AssemblyFixture(typeof(SeleniumStandaloneServer))]
99
[assembly: AssemblyFixture(typeof(SauceConnectServer))]

src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
<OutputPath />
2121

22-
<GenerateLoggingTestingAssemblyAttributes>false</GenerateLoggingTestingAssemblyAttributes>
23-
2422
<!-- This project references the shared framework transitively. Prevent restore errors by setting this flag. -->
2523
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
2624
</PropertyGroup>

src/ProjectTemplates/BlazorTemplates.Tests/AssemblyInfo.AssemblyFixtures.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using Microsoft.AspNetCore.E2ETesting;
5+
using Microsoft.AspNetCore.Testing;
56
using Templates.Test.Helpers;
6-
using Xunit;
77

8-
[assembly: TestFramework("Microsoft.AspNetCore.E2ETesting.XunitTestFrameworkWithAssemblyFixture", "BlazorTemplates.Tests")]
9-
10-
[assembly: Microsoft.AspNetCore.E2ETesting.AssemblyFixture(typeof(ProjectFactoryFixture))]
11-
[assembly: Microsoft.AspNetCore.E2ETesting.AssemblyFixture(typeof(SeleniumStandaloneServer))]
8+
[assembly: AssemblyFixture(typeof(ProjectFactoryFixture))]
9+
[assembly: AssemblyFixture(typeof(SeleniumStandaloneServer))]
1210

src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<!-- Shared testing infrastructure for running E2E tests using selenium -->
44
<Import Project="$(SharedSourceRoot)E2ETesting\E2ETesting.props" />
@@ -22,7 +22,6 @@
2222
<TestTemplateCreationFolder>TestTemplates\</TestTemplateCreationFolder>
2323
<TestPackageRestorePath>$([MSBuild]::EnsureTrailingSlash('$(RepoRoot)'))obj\template-restore\</TestPackageRestorePath>
2424
<TestTemplateTestsProps>TemplateTests.props</TestTemplateTestsProps>
25-
<GenerateLoggingTestingAssemblyAttributes>false</GenerateLoggingTestingAssemblyAttributes>
2625
<TestDependsOnAspNetRuntime>true</TestDependsOnAspNetRuntime>
2726
</PropertyGroup>
2827

@@ -43,11 +42,6 @@
4342
<Reference Include="Microsoft.NET.Sdk.Razor" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" />
4443
</ItemGroup>
4544

46-
<PropertyGroup>
47-
<PreserveExistingLogsInOutput Condition="'$(PreserveExistingLogsInOutput)' == '' AND '$(ContinuousIntegrationBuild)' == 'true'">true</PreserveExistingLogsInOutput>
48-
<PreserveExistingLogsInOutput Condition="'$(PreserveExistingLogsInOutput)' == ''">false</PreserveExistingLogsInOutput>
49-
</PropertyGroup>
50-
5145
<ItemGroup>
5246
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
5347
<_Parameter1>DotNetEfFullPath</_Parameter1>
@@ -65,11 +59,6 @@
6559
<_Parameter1>ContinuousIntegrationBuild</_Parameter1>
6660
<_Parameter2>true</_Parameter2>
6761
</AssemblyAttribute>
68-
<AssemblyAttribute Include="Microsoft.AspNetCore.Testing.TestFrameworkFileLoggerAttribute">
69-
<_Parameter1>$(PreserveExistingLogsInOutput)</_Parameter1>
70-
<_Parameter2>$(TargetFramework)</_Parameter2>
71-
<_Parameter3></_Parameter3>
72-
</AssemblyAttribute>
7362
</ItemGroup>
7463

7564
<Target Name="PrepareForTest" BeforeTargets="GetAssemblyAttributes" Condition="$(DesignTimeBuild) != true">

src/ProjectTemplates/Shared/ProjectFactoryFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public async Task<Project> GetOrCreateProject(string projectKey, ITestOutputHelp
5555
}
5656

5757
private static string GetTemplateFolderBasePath(Assembly assembly) =>
58-
(string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DIR")))
58+
(string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DIR")))
5959
? assembly.GetCustomAttributes<AssemblyMetadataAttribute>()
6060
.Single(a => a.Key == "TestTemplateCreationFolder")
6161
.Value
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using Microsoft.Extensions.Logging;
5+
using Xunit.Abstractions;
6+
7+
namespace Templates.Test.Helpers
8+
{
9+
internal class TestOutputLogger : ITestOutputHelper
10+
{
11+
private readonly ILogger _logger;
12+
13+
public TestOutputLogger(ILogger logger)
14+
{
15+
_logger = logger;
16+
}
17+
18+
public void WriteLine(string message)
19+
{
20+
_logger.LogInformation(message);
21+
}
22+
23+
public void WriteLine(string format, params object[] args)
24+
{
25+
_logger.LogInformation(string.Format(format, args));
26+
}
27+
}
28+
}

src/ProjectTemplates/test/AssemblyInfo.AssemblyFixtures.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
using Microsoft.AspNetCore.E2ETesting;
55
using Microsoft.AspNetCore.Testing;
66
using Templates.Test.Helpers;
7-
using Xunit;
87

9-
[assembly: TestFramework("Microsoft.AspNetCore.E2ETesting.XunitTestFrameworkWithAssemblyFixture", "ProjectTemplates.Tests")]
10-
11-
[assembly: Microsoft.AspNetCore.E2ETesting.AssemblyFixture(typeof(ProjectFactoryFixture))]
12-
[assembly: Microsoft.AspNetCore.E2ETesting.AssemblyFixture(typeof(SeleniumStandaloneServer))]
8+
[assembly: AssemblyFixture(typeof(ProjectFactoryFixture))]
9+
[assembly: AssemblyFixture(typeof(SeleniumStandaloneServer))]

src/ProjectTemplates/test/BaselineTest.cs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
namespace Templates.Test
1717
{
18-
public class BaselineTest
18+
public class BaselineTest : LoggedTest
1919
{
2020
private static readonly Regex TemplateNameRegex = new Regex(
2121
"new (?<template>[a-zA-Z]+)",
@@ -32,10 +32,9 @@ public class BaselineTest
3232
RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.Singleline,
3333
TimeSpan.FromSeconds(1));
3434

35-
public BaselineTest(ProjectFactoryFixture projectFactory, ITestOutputHelper output)
35+
public BaselineTest(ProjectFactoryFixture projectFactory)
3636
{
3737
ProjectFactory = projectFactory;
38-
Output = output;
3938
}
4039

4140
public Project Project { get; set; }
@@ -67,7 +66,18 @@ public static TheoryData<string, string[]> TemplateBaselines
6766
}
6867

6968
public ProjectFactoryFixture ProjectFactory { get; }
70-
public ITestOutputHelper Output { get; }
69+
private ITestOutputHelper _output;
70+
public ITestOutputHelper Output
71+
{
72+
get
73+
{
74+
if (_output == null)
75+
{
76+
_output = new TestOutputLogger(Logger);
77+
}
78+
return _output;
79+
}
80+
}
7181

7282
[Theory]
7383
[MemberData(nameof(TemplateBaselines))]

src/ProjectTemplates/test/ByteOrderMarkTest.cs

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,30 @@
55
using System.IO;
66
using System.Linq;
77
using System.Text;
8+
using Microsoft.AspNetCore.Testing;
9+
using Templates.Test.Helpers;
810
using Xunit;
911
using Xunit.Abstractions;
1012

1113
namespace Templates.Test
1214
{
13-
public class ByteOrderMarkTest
15+
public class ByteOrderMarkTest : LoggedTest
1416
{
15-
private readonly ITestOutputHelper _output;
17+
private ITestOutputHelper _output;
18+
public ITestOutputHelper Output
19+
{
20+
get
21+
{
22+
if (_output == null)
23+
{
24+
_output = new TestOutputLogger(Logger);
25+
}
26+
return _output;
27+
}
28+
}
1629

17-
public ByteOrderMarkTest(ITestOutputHelper output)
30+
public ByteOrderMarkTest()
1831
{
19-
_output = output;
2032
}
2133

2234
[Theory]
@@ -43,13 +55,13 @@ public void JSAndJSONInAllTemplates_ShouldNotContainBOM(string projectName)
4355
// Check for UTF8 BOM 0xEF,0xBB,0xBF
4456
if (bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF)
4557
{
46-
_output.WriteLine($"File {filePath} has UTF-8 BOM characters.");
58+
Output.WriteLine($"File {filePath} has UTF-8 BOM characters.");
4759
filesWithBOMCharactersPresent = true;
4860
}
4961
// Check for UTF16 BOM 0xFF, 0xFE
5062
if (bytes[0] == 0xFF && bytes[1] == 0xFE)
5163
{
52-
_output.WriteLine($"File {filePath} has UTF-16 BOM characters.");
64+
Output.WriteLine($"File {filePath} has UTF-16 BOM characters.");
5365
filesWithBOMCharactersPresent = true;
5466
}
5567
}
@@ -83,7 +95,7 @@ public void RazorFilesInWebProjects_ShouldContainBOM(string projectName)
8395
var expectedBytes = Encoding.UTF8.GetPreamble();
8496
if (bytes[0] != expectedBytes[0] || bytes[1] != expectedBytes[1] || bytes[2] != expectedBytes[2])
8597
{
86-
_output.WriteLine($"File {filePath} does not have UTF-8 BOM characters.");
98+
Output.WriteLine($"File {filePath} does not have UTF-8 BOM characters.");
8799
nonBOMFilesPresent = true;
88100
}
89101
}

0 commit comments

Comments
 (0)