diff --git a/src/Components/test/E2ETest/Infrastructure/AssemblyInfo.AssemblyFixtures.cs b/src/Components/test/E2ETest/Infrastructure/AssemblyInfo.AssemblyFixtures.cs index 4f2868269a6b..d7e5921fef32 100644 --- a/src/Components/test/E2ETest/Infrastructure/AssemblyInfo.AssemblyFixtures.cs +++ b/src/Components/test/E2ETest/Infrastructure/AssemblyInfo.AssemblyFixtures.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.E2ETesting; +using Microsoft.AspNetCore.Testing; using Xunit; -[assembly: TestFramework("Microsoft.AspNetCore.E2ETesting.XunitTestFrameworkWithAssemblyFixture", "Microsoft.AspNetCore.Components.E2ETests")] [assembly: AssemblyFixture(typeof(SeleniumStandaloneServer))] [assembly: AssemblyFixture(typeof(SauceConnectServer))] diff --git a/src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj b/src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj index 266bd5d4fc7d..c727765672fa 100644 --- a/src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj +++ b/src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj @@ -19,8 +19,6 @@ - false - false diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/AssemblyInfo.AssemblyFixtures.cs b/src/ProjectTemplates/BlazorTemplates.Tests/AssemblyInfo.AssemblyFixtures.cs index 57f163b513fd..b60a694a12d7 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/AssemblyInfo.AssemblyFixtures.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/AssemblyInfo.AssemblyFixtures.cs @@ -2,11 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.E2ETesting; +using Microsoft.AspNetCore.Testing; using Templates.Test.Helpers; -using Xunit; -[assembly: TestFramework("Microsoft.AspNetCore.E2ETesting.XunitTestFrameworkWithAssemblyFixture", "BlazorTemplates.Tests")] - -[assembly: Microsoft.AspNetCore.E2ETesting.AssemblyFixture(typeof(ProjectFactoryFixture))] -[assembly: Microsoft.AspNetCore.E2ETesting.AssemblyFixture(typeof(SeleniumStandaloneServer))] +[assembly: AssemblyFixture(typeof(ProjectFactoryFixture))] +[assembly: AssemblyFixture(typeof(SeleniumStandaloneServer))] diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj index 2da0e11666ef..ba179c77d004 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj @@ -1,4 +1,4 @@ - + @@ -22,7 +22,6 @@ TestTemplates\ $([MSBuild]::EnsureTrailingSlash('$(RepoRoot)'))obj\template-restore\ TemplateTests.props - false true @@ -43,11 +42,6 @@ - - true - false - - <_Parameter1>DotNetEfFullPath @@ -65,11 +59,6 @@ <_Parameter1>ContinuousIntegrationBuild <_Parameter2>true - - <_Parameter1>$(PreserveExistingLogsInOutput) - <_Parameter2>$(TargetFramework) - <_Parameter3> - diff --git a/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs b/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs index d268ce874247..46763a3b96b8 100644 --- a/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs +++ b/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs @@ -55,7 +55,7 @@ public async Task GetOrCreateProject(string projectKey, ITestOutputHelp } private static string GetTemplateFolderBasePath(Assembly assembly) => - (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DIR"))) + (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DIR"))) ? assembly.GetCustomAttributes() .Single(a => a.Key == "TestTemplateCreationFolder") .Value diff --git a/src/ProjectTemplates/Shared/TestOutputLogger.cs b/src/ProjectTemplates/Shared/TestOutputLogger.cs new file mode 100644 index 000000000000..b01edf2e7bd8 --- /dev/null +++ b/src/ProjectTemplates/Shared/TestOutputLogger.cs @@ -0,0 +1,28 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using Microsoft.Extensions.Logging; +using Xunit.Abstractions; + +namespace Templates.Test.Helpers +{ + internal class TestOutputLogger : ITestOutputHelper + { + private readonly ILogger _logger; + + public TestOutputLogger(ILogger logger) + { + _logger = logger; + } + + public void WriteLine(string message) + { + _logger.LogInformation(message); + } + + public void WriteLine(string format, params object[] args) + { + _logger.LogInformation(string.Format(format, args)); + } + } +} diff --git a/src/ProjectTemplates/test/AssemblyInfo.AssemblyFixtures.cs b/src/ProjectTemplates/test/AssemblyInfo.AssemblyFixtures.cs index 9e4d5d6b3448..dded12fce8e1 100644 --- a/src/ProjectTemplates/test/AssemblyInfo.AssemblyFixtures.cs +++ b/src/ProjectTemplates/test/AssemblyInfo.AssemblyFixtures.cs @@ -4,9 +4,6 @@ using Microsoft.AspNetCore.E2ETesting; using Microsoft.AspNetCore.Testing; using Templates.Test.Helpers; -using Xunit; -[assembly: TestFramework("Microsoft.AspNetCore.E2ETesting.XunitTestFrameworkWithAssemblyFixture", "ProjectTemplates.Tests")] - -[assembly: Microsoft.AspNetCore.E2ETesting.AssemblyFixture(typeof(ProjectFactoryFixture))] -[assembly: Microsoft.AspNetCore.E2ETesting.AssemblyFixture(typeof(SeleniumStandaloneServer))] +[assembly: AssemblyFixture(typeof(ProjectFactoryFixture))] +[assembly: AssemblyFixture(typeof(SeleniumStandaloneServer))] diff --git a/src/ProjectTemplates/test/BaselineTest.cs b/src/ProjectTemplates/test/BaselineTest.cs index eabacc336d35..23e9320ec7ff 100644 --- a/src/ProjectTemplates/test/BaselineTest.cs +++ b/src/ProjectTemplates/test/BaselineTest.cs @@ -15,7 +15,7 @@ namespace Templates.Test { - public class BaselineTest + public class BaselineTest : LoggedTest { private static readonly Regex TemplateNameRegex = new Regex( "new (?