From 6185e38444110980923a40e678be732e18ac165d Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 11 Feb 2021 11:18:12 -0800 Subject: [PATCH 01/90] Update BlazorTemplates.Tests.csproj --- .../BlazorTemplates.Tests/BlazorTemplates.Tests.csproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj index f932b3471666..177235c9bff0 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj @@ -6,8 +6,6 @@ true true - - false true From d31fe140533e5bbfc00cb0481f015304ffc47416 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 11 Feb 2021 12:54:58 -0800 Subject: [PATCH 02/90] Try setting playwrite browsers path --- eng/helix/content/RunTests/TestRunner.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eng/helix/content/RunTests/TestRunner.cs b/eng/helix/content/RunTests/TestRunner.cs index 2aeb1c5abca7..1f7f4b09c191 100644 --- a/eng/helix/content/RunTests/TestRunner.cs +++ b/eng/helix/content/RunTests/TestRunner.cs @@ -40,6 +40,12 @@ public bool SetupEnvironment() Console.WriteLine($"Set DotNetEfFullPath: {dotnetEFFullPath}"); EnvironmentVariables.Add("DotNetEfFullPath", dotnetEFFullPath); + // Playwright will download and look for browsers to this directory + var playwrightBrowsers = Path.Combine(helixDir, "playwrightBrowsers"); + EnvironmentVariables.Add("PLAYWRIGHT_BROWSERS_PATH", playwrightBrowsers); + Console.WriteLine($"Creating playwright browsers directory: {playwrightBrowsers}"); + Directory.CreateDirectory(playwrightBrowsers); + Console.WriteLine($"Creating nuget restore directory: {nugetRestore}"); Directory.CreateDirectory(nugetRestore); From 2dee06673fc635b73eaa652ced1af21f6207ecee Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 11 Feb 2021 15:49:25 -0800 Subject: [PATCH 03/90] Publish browsers from install path --- eng/helix/content/RunTests/TestRunner.cs | 5 ++--- .../BlazorTemplates.Tests/BlazorTemplates.Tests.csproj | 8 ++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/eng/helix/content/RunTests/TestRunner.cs b/eng/helix/content/RunTests/TestRunner.cs index 1f7f4b09c191..2217a0e7092f 100644 --- a/eng/helix/content/RunTests/TestRunner.cs +++ b/eng/helix/content/RunTests/TestRunner.cs @@ -41,10 +41,9 @@ public bool SetupEnvironment() EnvironmentVariables.Add("DotNetEfFullPath", dotnetEFFullPath); // Playwright will download and look for browsers to this directory - var playwrightBrowsers = Path.Combine(helixDir, "playwrightBrowsers"); + var playwrightBrowsers = Path.Combine(helixDir, "ms-playwright"); + Console.WriteLine($"Setting PLAYWRIGHT_BROWSERS_PATH: {playwrightBrowsers}"); EnvironmentVariables.Add("PLAYWRIGHT_BROWSERS_PATH", playwrightBrowsers); - Console.WriteLine($"Creating playwright browsers directory: {playwrightBrowsers}"); - Directory.CreateDirectory(playwrightBrowsers); Console.WriteLine($"Creating nuget restore directory: {nugetRestore}"); Directory.CreateDirectory(nugetRestore); diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj index 177235c9bff0..c92f5c8c3a15 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj @@ -55,4 +55,12 @@ + + + + <_browsers Include="$(USERPROFILE)\AppData\Local\ms-playwright\**\*.*" /> + + + + From 45e712d02b24e46ce2b597358409d85c2129277c Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 11 Feb 2021 17:06:44 -0800 Subject: [PATCH 04/90] Try to Install-WindowsFeature Server-Media-Foundation --- eng/helix/content/runtests.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index a6a7da67eede..83f98f1a1d62 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -79,6 +79,9 @@ if ([string]::IsNullOrEmpty($FeedCred)) { InstallDotnetSDKAndRuntime "https://dotnetclimsrc.blob.core.windows.net/dotnet" $FeedCred } +Write-Host "Install-WindowsFeature Server-Media-Foundation (For Playwright)" +Install-WindowsFeature Server-Media-Foundation + Write-Host "Restore: dotnet restore RunTests\RunTests.csproj --ignore-failed-sources" dotnet restore RunTests\RunTests.csproj --ignore-failed-sources From 3b270850861a441e903c70dc8ea3449b4a55d0eb Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 11 Feb 2021 17:14:01 -0800 Subject: [PATCH 05/90] Update BlazorServerTemplateTest.cs --- .../BlazorServerTemplateTest.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs index de27f48c4cb6..21f70475cd10 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs @@ -32,7 +32,9 @@ public BlazorServerTemplateTest(ProjectFactoryFixture projectFactory, Playwright public Project Project { get; private set; } - [Theory] + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux)] + [OSSkipCondition(OperatingSystems.MacOSX)] [InlineData(BrowserKind.Chromium)] public async Task BlazorServerTemplateWorks_NoAuth(BrowserKind browserKind) { @@ -103,7 +105,9 @@ await Fixture.BrowserManager.GetBrowserInstance(browserKind, BrowserContextInfo) public static IEnumerable BlazorServerTemplateWorks_IndividualAuthData => BrowserManager.WithBrowsers(new[] { BrowserKind.Chromium }, true, false); - [Theory] + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux)] + [OSSkipCondition(OperatingSystems.MacOSX)] [MemberData(nameof(BlazorServerTemplateWorks_IndividualAuthData))] public async Task BlazorServerTemplateWorks_IndividualAuth(BrowserKind browserKind, bool useLocalDB) { @@ -207,7 +211,9 @@ private async Task TestBasicNavigation(IPage page) Assert.Equal(5, (await page.QuerySelectorAllAsync("p+table>tbody>tr")).Count()); } - [Theory] + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux)] + [OSSkipCondition(OperatingSystems.MacOSX)] [InlineData("IndividualB2C", null)] [InlineData("IndividualB2C", new string[] { "--called-api-url \"https://graph.microsoft.com\"", "--called-api-scopes user.readwrite" })] [InlineData("SingleOrg", null)] From feb658a110ac0d4ca84460c5d0b0ef8503592d41 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 11 Feb 2021 17:16:20 -0800 Subject: [PATCH 06/90] Update BlazorWasmTemplateTest.cs --- .../BlazorWasmTemplateTest.cs | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs index 2f52d3e2aa30..296b8253043c 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs @@ -40,7 +40,8 @@ public BlazorWasmTemplateTest(ProjectFactoryFixture projectFactory, PlaywrightFi public ContextInformation BrowserContextInfo { get; } - [Theory] + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] [InlineData(BrowserKind.Chromium)] public async Task BlazorWasmStandaloneTemplate_Works(BrowserKind browserKind) { @@ -88,7 +89,8 @@ private async Task NavigateToPage(IBrowserContext browser, string listeni return page; } - [Theory] + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] [InlineData(BrowserKind.Chromium)] public async Task BlazorWasmHostedTemplate_Works(BrowserKind browserKind) { @@ -147,7 +149,8 @@ private static async Task AssertCompressionFormat(AspNetProcess aspNetProcess, s Assert.Equal(expectedEncoding, response.Content.Headers.ContentEncoding.Single()); } - [Theory] + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] [InlineData(BrowserKind.Chromium)] public async Task BlazorWasmStandalonePwaTemplate_Works(BrowserKind browserKind) { @@ -194,7 +197,8 @@ public async Task BlazorWasmStandalonePwaTemplate_Works(BrowserKind browserKind) } } - [Theory] + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] [InlineData(BrowserKind.Chromium)] public async Task BlazorWasmHostedPwaTemplate_Works(BrowserKind browserKind) { @@ -285,7 +289,8 @@ public Task BlazorWasmHostedTemplate_IndividualAuth_Works_WithLocalDB(BrowserKin return BlazorWasmHostedTemplate_IndividualAuth_Works(browserKind, true); } - [Theory] + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] [InlineData(BrowserKind.Chromium)] public Task BlazorWasmHostedTemplate_IndividualAuth_Works_WithOutLocalDB(BrowserKind browserKind) { @@ -363,7 +368,8 @@ private async Task BlazorWasmHostedTemplate_IndividualAuth_Works(BrowserKind bro } } - [Theory] + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] [InlineData(BrowserKind.Chromium, Skip = "https://github.com/dotnet/aspnetcore/issues/28596")] public async Task BlazorWasmStandaloneTemplate_IndividualAuth_Works(BrowserKind browserKind) { @@ -479,7 +485,8 @@ public TemplateInstance(string name, params string[] arguments) public string[] Arguments { get; } } - [Theory] + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] [MemberData(nameof(TemplateData))] public async Task BlazorWasmHostedTemplate_AzureActiveDirectoryTemplate_Works(TemplateInstance instance) { From 197ef2ec2f4f1f97ddd43818ae7bebf0f5df305d Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 11 Feb 2021 17:17:22 -0800 Subject: [PATCH 07/90] Update BlazorServerTemplateTest.cs --- .../BlazorTemplates.Tests/BlazorServerTemplateTest.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs index 21f70475cd10..72a540f04911 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs @@ -33,8 +33,7 @@ public BlazorServerTemplateTest(ProjectFactoryFixture projectFactory, Playwright [ConditionalTheory] - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] [InlineData(BrowserKind.Chromium)] public async Task BlazorServerTemplateWorks_NoAuth(BrowserKind browserKind) { @@ -106,8 +105,7 @@ await Fixture.BrowserManager.GetBrowserInstance(browserKind, BrowserContextInfo) BrowserManager.WithBrowsers(new[] { BrowserKind.Chromium }, true, false); [ConditionalTheory] - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] [MemberData(nameof(BlazorServerTemplateWorks_IndividualAuthData))] public async Task BlazorServerTemplateWorks_IndividualAuth(BrowserKind browserKind, bool useLocalDB) { @@ -212,8 +210,7 @@ private async Task TestBasicNavigation(IPage page) } [ConditionalTheory] - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] [InlineData("IndividualB2C", null)] [InlineData("IndividualB2C", new string[] { "--called-api-url \"https://graph.microsoft.com\"", "--called-api-scopes user.readwrite" })] [InlineData("SingleOrg", null)] From 91fd2da716c7f364882d073f0dd3495891928073 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 11 Feb 2021 17:46:31 -0800 Subject: [PATCH 08/90] Update BlazorServerTemplateTest.cs --- .../BlazorTemplates.Tests/BlazorServerTemplateTest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs index 72a540f04911..4b223880964a 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs @@ -8,6 +8,7 @@ using System.Runtime.InteropServices; using System.Threading.Tasks; using Microsoft.AspNetCore.BrowserTesting; +using Microsoft.AspNetCore.Testing; using PlaywrightSharp; using ProjectTemplates.Tests.Infrastructure; using Templates.Test.Helpers; From 6d9bc8cbcd6a1c131fb95c3f1a2eabd077e8153c Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 11 Feb 2021 19:59:54 -0800 Subject: [PATCH 09/90] Update runtests.ps1 --- eng/helix/content/runtests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index 83f98f1a1d62..c9b20ce1aa1e 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -79,8 +79,8 @@ if ([string]::IsNullOrEmpty($FeedCred)) { InstallDotnetSDKAndRuntime "https://dotnetclimsrc.blob.core.windows.net/dotnet" $FeedCred } -Write-Host "Install-WindowsFeature Server-Media-Foundation (For Playwright)" -Install-WindowsFeature Server-Media-Foundation +Write-Host "Enable-WindowsOptionalFeature Server-Media-Foundation (For Playwright)" +Enable-WindowsOptionalFeature Server-Media-Foundation Write-Host "Restore: dotnet restore RunTests\RunTests.csproj --ignore-failed-sources" dotnet restore RunTests\RunTests.csproj --ignore-failed-sources From 99bb62f95fd18462e011182d9a7b1a5e9d8e5c31 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 11 Feb 2021 21:15:31 -0800 Subject: [PATCH 10/90] Update runtests.ps1 --- eng/helix/content/runtests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index c9b20ce1aa1e..bf4d6846f3c8 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -80,7 +80,7 @@ if ([string]::IsNullOrEmpty($FeedCred)) { } Write-Host "Enable-WindowsOptionalFeature Server-Media-Foundation (For Playwright)" -Enable-WindowsOptionalFeature Server-Media-Foundation +Enable-WindowsOptionalFeature -FeatureName ServerMediaFoundation Write-Host "Restore: dotnet restore RunTests\RunTests.csproj --ignore-failed-sources" dotnet restore RunTests\RunTests.csproj --ignore-failed-sources From c75bea64ae81bc9a7d5e1d193f7593b3870398bb Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 11 Feb 2021 21:19:50 -0800 Subject: [PATCH 11/90] Update BlazorTemplates.Tests.csproj --- .../BlazorTemplates.Tests/BlazorTemplates.Tests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj index c92f5c8c3a15..2863b1975e74 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj @@ -6,6 +6,7 @@ true true + false true From 278edd86ba3f1675e9b205b8d7147c5a62ff7488 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 11 Feb 2021 22:41:53 -0800 Subject: [PATCH 12/90] Update runtests.ps1 --- eng/helix/content/runtests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index bf4d6846f3c8..0de12ac334f2 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -79,8 +79,8 @@ if ([string]::IsNullOrEmpty($FeedCred)) { InstallDotnetSDKAndRuntime "https://dotnetclimsrc.blob.core.windows.net/dotnet" $FeedCred } -Write-Host "Enable-WindowsOptionalFeature Server-Media-Foundation (For Playwright)" -Enable-WindowsOptionalFeature -FeatureName ServerMediaFoundation +Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation (For Playwright)" +Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation Write-Host "Restore: dotnet restore RunTests\RunTests.csproj --ignore-failed-sources" dotnet restore RunTests\RunTests.csproj --ignore-failed-sources From 01c7d5169da2b10c47510b5af71c6b255c6d131e Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 00:29:10 -0800 Subject: [PATCH 13/90] Update runtests.ps1 --- eng/helix/content/runtests.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index 0de12ac334f2..338ca8e668c6 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -80,7 +80,11 @@ if ([string]::IsNullOrEmpty($FeedCred)) { } Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation (For Playwright)" -Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation +try { + Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation +} catch { + Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation threw an exception: $PSItem.Exception.Message" +} Write-Host "Restore: dotnet restore RunTests\RunTests.csproj --ignore-failed-sources" dotnet restore RunTests\RunTests.csproj --ignore-failed-sources From 990836959357fcc4dd9d9c535dddfdc7fb91106e Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 02:21:58 -0800 Subject: [PATCH 14/90] Create installPlaywrightReqs.psq --- eng/helix/content/installPlaywrightReqs.psq | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 eng/helix/content/installPlaywrightReqs.psq diff --git a/eng/helix/content/installPlaywrightReqs.psq b/eng/helix/content/installPlaywrightReqs.psq new file mode 100644 index 000000000000..fc02550d71ca --- /dev/null +++ b/eng/helix/content/installPlaywrightReqs.psq @@ -0,0 +1,6 @@ +Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation (For Playwright)" +try { + Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation +} catch { + Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation threw an exception: $PSItem.Exception.Message" +} From 82b0c528b47ffb502730dcc1a31af647d41b353b Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 02:22:20 -0800 Subject: [PATCH 15/90] Update runtests.ps1 --- eng/helix/content/runtests.ps1 | 7 ------- 1 file changed, 7 deletions(-) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index 338ca8e668c6..a6a7da67eede 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -79,13 +79,6 @@ if ([string]::IsNullOrEmpty($FeedCred)) { InstallDotnetSDKAndRuntime "https://dotnetclimsrc.blob.core.windows.net/dotnet" $FeedCred } -Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation (For Playwright)" -try { - Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation -} catch { - Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation threw an exception: $PSItem.Exception.Message" -} - Write-Host "Restore: dotnet restore RunTests\RunTests.csproj --ignore-failed-sources" dotnet restore RunTests\RunTests.csproj --ignore-failed-sources From 480b56f6b93848300dacf27cf780959e91dbd837 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 02:22:31 -0800 Subject: [PATCH 16/90] Update Helix.Common.props --- eng/targets/Helix.Common.props | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/targets/Helix.Common.props b/eng/targets/Helix.Common.props index 451a4d93834b..dd4c15685750 100644 --- a/eng/targets/Helix.Common.props +++ b/eng/targets/Helix.Common.props @@ -14,6 +14,7 @@ + From 6598dce6411e26a8992b3ca12813883b0366d537 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 02:23:49 -0800 Subject: [PATCH 17/90] Update BlazorTemplates.Tests.csproj --- .../BlazorTemplates.Tests/BlazorTemplates.Tests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj index 2863b1975e74..b911e68ffc9e 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj @@ -7,6 +7,7 @@ true true false + true true From 71c4f98874b1e6444e707d16d3918ced82b604f5 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 09:20:23 -0800 Subject: [PATCH 18/90] Rename installPlaywrightReqs.psq to installPlaywrightReqs.ps1 --- .../{installPlaywrightReqs.psq => installPlaywrightReqs.ps1} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename eng/helix/content/{installPlaywrightReqs.psq => installPlaywrightReqs.ps1} (100%) diff --git a/eng/helix/content/installPlaywrightReqs.psq b/eng/helix/content/installPlaywrightReqs.ps1 similarity index 100% rename from eng/helix/content/installPlaywrightReqs.psq rename to eng/helix/content/installPlaywrightReqs.ps1 From 9f0749753e4c50a888f77fbd7d044971f49e4cd0 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 11:09:12 -0800 Subject: [PATCH 19/90] Cleanup --- .../BlazorServerTemplateTest.cs | 9 +++----- .../BlazorTemplates.Tests.csproj | 1 - .../BlazorWasmTemplateTest.cs | 21 +++++++------------ 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs index 4b223880964a..0fc61a174167 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs @@ -33,8 +33,7 @@ public BlazorServerTemplateTest(ProjectFactoryFixture projectFactory, Playwright public Project Project { get; private set; } - [ConditionalTheory] - [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] + [Theory] [InlineData(BrowserKind.Chromium)] public async Task BlazorServerTemplateWorks_NoAuth(BrowserKind browserKind) { @@ -105,8 +104,7 @@ await Fixture.BrowserManager.GetBrowserInstance(browserKind, BrowserContextInfo) public static IEnumerable BlazorServerTemplateWorks_IndividualAuthData => BrowserManager.WithBrowsers(new[] { BrowserKind.Chromium }, true, false); - [ConditionalTheory] - [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] + [Theory] [MemberData(nameof(BlazorServerTemplateWorks_IndividualAuthData))] public async Task BlazorServerTemplateWorks_IndividualAuth(BrowserKind browserKind, bool useLocalDB) { @@ -210,8 +208,7 @@ private async Task TestBasicNavigation(IPage page) Assert.Equal(5, (await page.QuerySelectorAllAsync("p+table>tbody>tr")).Count()); } - [ConditionalTheory] - [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] + [Theory] [InlineData("IndividualB2C", null)] [InlineData("IndividualB2C", new string[] { "--called-api-url \"https://graph.microsoft.com\"", "--called-api-scopes user.readwrite" })] [InlineData("SingleOrg", null)] diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj index b911e68ffc9e..64d65b5d77ae 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj @@ -6,7 +6,6 @@ true true - false true true diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs index 296b8253043c..2f52d3e2aa30 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs @@ -40,8 +40,7 @@ public BlazorWasmTemplateTest(ProjectFactoryFixture projectFactory, PlaywrightFi public ContextInformation BrowserContextInfo { get; } - [ConditionalTheory] - [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] + [Theory] [InlineData(BrowserKind.Chromium)] public async Task BlazorWasmStandaloneTemplate_Works(BrowserKind browserKind) { @@ -89,8 +88,7 @@ private async Task NavigateToPage(IBrowserContext browser, string listeni return page; } - [ConditionalTheory] - [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] + [Theory] [InlineData(BrowserKind.Chromium)] public async Task BlazorWasmHostedTemplate_Works(BrowserKind browserKind) { @@ -149,8 +147,7 @@ private static async Task AssertCompressionFormat(AspNetProcess aspNetProcess, s Assert.Equal(expectedEncoding, response.Content.Headers.ContentEncoding.Single()); } - [ConditionalTheory] - [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] + [Theory] [InlineData(BrowserKind.Chromium)] public async Task BlazorWasmStandalonePwaTemplate_Works(BrowserKind browserKind) { @@ -197,8 +194,7 @@ public async Task BlazorWasmStandalonePwaTemplate_Works(BrowserKind browserKind) } } - [ConditionalTheory] - [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] + [Theory] [InlineData(BrowserKind.Chromium)] public async Task BlazorWasmHostedPwaTemplate_Works(BrowserKind browserKind) { @@ -289,8 +285,7 @@ public Task BlazorWasmHostedTemplate_IndividualAuth_Works_WithLocalDB(BrowserKin return BlazorWasmHostedTemplate_IndividualAuth_Works(browserKind, true); } - [ConditionalTheory] - [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] + [Theory] [InlineData(BrowserKind.Chromium)] public Task BlazorWasmHostedTemplate_IndividualAuth_Works_WithOutLocalDB(BrowserKind browserKind) { @@ -368,8 +363,7 @@ private async Task BlazorWasmHostedTemplate_IndividualAuth_Works(BrowserKind bro } } - [ConditionalTheory] - [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] + [Theory] [InlineData(BrowserKind.Chromium, Skip = "https://github.com/dotnet/aspnetcore/issues/28596")] public async Task BlazorWasmStandaloneTemplate_IndividualAuth_Works(BrowserKind browserKind) { @@ -485,8 +479,7 @@ public TemplateInstance(string name, params string[] arguments) public string[] Arguments { get; } } - [ConditionalTheory] - [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] + [Theory] [MemberData(nameof(TemplateData))] public async Task BlazorWasmHostedTemplate_AzureActiveDirectoryTemplate_Works(TemplateInstance instance) { From 1fa29046275b8959c5c8af89b82416f612cdba15 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 16:07:51 -0800 Subject: [PATCH 20/90] Fix dotnet-ef update to work on helix --- src/ProjectTemplates/Shared/Project.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ProjectTemplates/Shared/Project.cs b/src/ProjectTemplates/Shared/Project.cs index 68af9da053a1..bf2d1082587b 100644 --- a/src/ProjectTemplates/Shared/Project.cs +++ b/src/ProjectTemplates/Shared/Project.cs @@ -231,11 +231,7 @@ internal async Task RunDotNetEfUpdateDatabaseAsync() { var assembly = typeof(ProjectFactoryFixture).Assembly; - var dotNetEfFullPath = assembly.GetCustomAttributes() - .First(attribute => attribute.Key == "DotNetEfFullPath") - .Value; - - var args = $"\"{dotNetEfFullPath}\" --verbose --no-build database update"; + var args = "--verbose --no-build database update"; // Only run one instance of 'dotnet new' at once, as a workaround for // https://github.com/aspnet/templating/issues/63 @@ -243,7 +239,17 @@ internal async Task RunDotNetEfUpdateDatabaseAsync() try { Output.WriteLine("Acquired DotNetNewLock"); - using var result = ProcessEx.Run(Output, TemplateOutputDir, DotNetMuxer.MuxerPathOrDefault(), args); + var command = DotNetMuxer.MuxerPathOrDefault(); + if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath"))) + { + args = $"\"{DotNetEfFullPath}\" " + args; + } + else + { + command = "dotnet-ef"; + } + + using var result = ProcessEx.Run(Output, TemplateOutputDir, command, args); await result.Exited; return new ProcessResult(result); } From 5c352586d5b3e358fe39667726d36c6f25dceb95 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 16:12:01 -0800 Subject: [PATCH 21/90] Install dotnet serve as part of templates tests payloads --- eng/helix/content/RunTests/TestRunner.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eng/helix/content/RunTests/TestRunner.cs b/eng/helix/content/RunTests/TestRunner.cs index 2217a0e7092f..393ff5337415 100644 --- a/eng/helix/content/RunTests/TestRunner.cs +++ b/eng/helix/content/RunTests/TestRunner.cs @@ -141,6 +141,14 @@ await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet", throwOnError: false, cancellationToken: new CancellationTokenSource(TimeSpan.FromMinutes(2)).Token); + await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet", + $"tool install dotnet-serve --tool-path {Options.HELIX_WORKITEM_ROOT}", + environmentVariables: EnvironmentVariables, + outputDataReceived: Console.WriteLine, + errorDataReceived: Console.Error.WriteLine, + throwOnError: false, + cancellationToken: new CancellationTokenSource(TimeSpan.FromMinutes(2)).Token); + // ';' is the path separator on Windows, and ':' on Unix Options.Path += OperatingSystem.IsWindows() ? ";" : ":"; Options.Path += $"{Environment.GetEnvironmentVariable("DOTNET_CLI_HOME")}/.dotnet/tools"; From ac5d56e6fa0a90b5f59f1199f002a775c9d45437 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 19:41:10 -0800 Subject: [PATCH 22/90] Require localdb --- .../BlazorTemplates.Tests/BlazorTemplates.Tests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj index 64d65b5d77ae..19841a311a6f 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj @@ -17,6 +17,7 @@ TestTemplates\ $([MSBuild]::EnsureTrailingSlash('$(RepoRoot)'))obj\template-restore\ true + true From 44097b03942b0c09dc2741e00c8799a52605d94a Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 19:47:59 -0800 Subject: [PATCH 23/90] Update Helix.Common.props --- eng/targets/Helix.Common.props | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/targets/Helix.Common.props b/eng/targets/Helix.Common.props index dd4c15685750..451a4d93834b 100644 --- a/eng/targets/Helix.Common.props +++ b/eng/targets/Helix.Common.props @@ -14,7 +14,6 @@ - From 7b3d5d7de56d961052926667b06bc31bdbe592c5 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 19:48:02 -0800 Subject: [PATCH 24/90] Update Helix.targets --- eng/targets/Helix.targets | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eng/targets/Helix.targets b/eng/targets/Helix.targets index 955e68fd4add..4ab3881c6ea7 100644 --- a/eng/targets/Helix.targets +++ b/eng/targets/Helix.targets @@ -8,6 +8,10 @@ + + + + From e27ebd24bbcacab2c2d707f2ea17e7509a33bc2a Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 19:48:48 -0800 Subject: [PATCH 25/90] Update BlazorTemplates.Tests.csproj --- .../BlazorTemplates.Tests/BlazorTemplates.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj index 19841a311a6f..bac905e573bd 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj @@ -8,7 +8,6 @@ true true true - @@ -18,6 +17,7 @@ $([MSBuild]::EnsureTrailingSlash('$(RepoRoot)'))obj\template-restore\ true true + true From f7a0d358303ed1b5f8f9150640af38b3b61b8a91 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 19:51:05 -0800 Subject: [PATCH 26/90] Update Helix.Common.props --- eng/targets/Helix.Common.props | 8 -------- 1 file changed, 8 deletions(-) diff --git a/eng/targets/Helix.Common.props b/eng/targets/Helix.Common.props index 451a4d93834b..c3fe23fb1241 100644 --- a/eng/targets/Helix.Common.props +++ b/eng/targets/Helix.Common.props @@ -8,14 +8,6 @@ - - - - - - - - From e8f7feffafcd1258c5a255b24f387c327fb38794 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 19:51:47 -0800 Subject: [PATCH 27/90] Update Directory.Build.props --- src/Servers/HttpSys/test/Directory.Build.props | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Servers/HttpSys/test/Directory.Build.props b/src/Servers/HttpSys/test/Directory.Build.props index 0468ef26a670..7fd21a288774 100644 --- a/src/Servers/HttpSys/test/Directory.Build.props +++ b/src/Servers/HttpSys/test/Directory.Build.props @@ -4,6 +4,7 @@ true + true From 841d2397e9a1170c95be2027a7b1df855a342c2f Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 19:52:23 -0800 Subject: [PATCH 28/90] Update Directory.Build.props --- src/Servers/IIS/IIS/test/Directory.Build.props | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Servers/IIS/IIS/test/Directory.Build.props b/src/Servers/IIS/IIS/test/Directory.Build.props index 6f6f92116853..8b196e74ad18 100644 --- a/src/Servers/IIS/IIS/test/Directory.Build.props +++ b/src/Servers/IIS/IIS/test/Directory.Build.props @@ -8,6 +8,7 @@ true + true From 7c2597bc39bcc6d852393e73d83e35aad33eb3c2 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 19:52:39 -0800 Subject: [PATCH 29/90] Update Directory.Build.props --- src/Servers/HttpSys/test/Directory.Build.props | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Servers/HttpSys/test/Directory.Build.props b/src/Servers/HttpSys/test/Directory.Build.props index 7fd21a288774..0468ef26a670 100644 --- a/src/Servers/HttpSys/test/Directory.Build.props +++ b/src/Servers/HttpSys/test/Directory.Build.props @@ -4,7 +4,6 @@ true - true From eafc070db8022068eacf4120c7fc9dbe41c3ab80 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 12 Feb 2021 19:53:13 -0800 Subject: [PATCH 30/90] Move iis schema updates to TestDependsOnIIS --- eng/targets/Helix.targets | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/eng/targets/Helix.targets b/eng/targets/Helix.targets index 4ab3881c6ea7..040d4cae435e 100644 --- a/eng/targets/Helix.targets +++ b/eng/targets/Helix.targets @@ -12,6 +12,16 @@ + + + + + + + + + + From f77e3d11bf5f6a33b1e42830ed51e79e5ff80b9c Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Sat, 13 Feb 2021 00:53:30 -0800 Subject: [PATCH 31/90] Update Helix.targets --- eng/targets/Helix.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/targets/Helix.targets b/eng/targets/Helix.targets index 040d4cae435e..b4eaa8d2b0a7 100644 --- a/eng/targets/Helix.targets +++ b/eng/targets/Helix.targets @@ -12,7 +12,7 @@ - + From c4f576eaaf2f476437b57fdec249e7ab6863a278 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Sat, 13 Feb 2021 03:25:44 -0800 Subject: [PATCH 32/90] Fix up serve helix execution --- .../BlazorTemplates.Tests/BlazorWasmTemplateTest.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs index 2f52d3e2aa30..93ef6294c9c4 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs @@ -654,7 +654,18 @@ private void UpdatePublishedSettings(Project serverProject) Output.WriteLine("Running dotnet serve on published output..."); var developmentCertificate = DevelopmentCertificate.Create(project.TemplateOutputDir); - var serveProcess = ProcessEx.Run(Output, publishDir, DotNetMuxer.MuxerPathOrDefault(), $"serve -S --pfx \"{developmentCertificate.CertificatePath}\" --pfx-pwd \"{developmentCertificate.CertificatePassword}\" --port 0"); + var args = $"-S --pfx \"{developmentCertificate.CertificatePath}\" --pfx-pwd \"{developmentCertificate.CertificatePassword}\" --port 0"; + var command = DotNetMuxer.MuxerPathOrDefault(); + if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DIR"))) + { + args = $"serve " + args; + } + else + { + command = "dotnet-serve"; + } + + var serveProcess = ProcessEx.Run(Output, publishDir, command, args); var listeningUri = ResolveListeningUrl(serveProcess); return (serveProcess, listeningUri); } From 77d30a08b103595944cb1e7934b94e42344f0181 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 15 Feb 2021 14:07:32 -0800 Subject: [PATCH 33/90] Pass in playwright option --- eng/helix/content/runtests.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index a6a7da67eede..e050592b1cc7 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -8,6 +8,7 @@ param( [string]$Quarantined, [string]$EF, [string]$HelixTimeout, + [string]$InstallPlaywright, [string]$FeedCred ) @@ -87,7 +88,7 @@ if ($LastExitCode -ne 0) { } Write-Host "Running tests: dotnet run --no-restore --project RunTests\RunTests.csproj -- --target $Target --runtime $AspRuntimeVersion --queue $Queue --arch $Arch --quarantined $Quarantined --ef $EF --helixTimeout $HelixTimeout" -dotnet run --no-restore --project RunTests\RunTests.csproj -- --target $Target --runtime $AspRuntimeVersion --queue $Queue --arch $Arch --quarantined $Quarantined --ef $EF --helixTimeout $HelixTimeout +dotnet run --no-restore --project RunTests\RunTests.csproj -- --target $Target --runtime $AspRuntimeVersion --queue $Queue --arch $Arch --quarantined $Quarantined --ef $EF --helixTimeout $HelixTimeout --playwright $InstallPlaywright Write-Host "Finished running tests: exit_code=$LastExitCode" exit $LastExitCode From 5310eda6fc4aeaa5d17f5f620764c9285ce6f12e Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 15 Feb 2021 14:07:36 -0800 Subject: [PATCH 34/90] Update RunTestsOptions.cs --- eng/helix/content/RunTests/RunTestsOptions.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eng/helix/content/RunTests/RunTestsOptions.cs b/eng/helix/content/RunTests/RunTestsOptions.cs index 031326ba8a14..e9546b31b114 100644 --- a/eng/helix/content/RunTests/RunTestsOptions.cs +++ b/eng/helix/content/RunTests/RunTestsOptions.cs @@ -55,6 +55,12 @@ public static RunTestsOptions Parse(string[] args) aliases: new string[] { "--source" }, description: "The restore sources to use during testing") { Argument = new Argument() { Arity = ArgumentArity.ZeroOrMore }, Required = true } + + new Option( + aliases: new string[] { "--playwright" }, + description: "Whether to install playwright") + { Argument = new Argument(), Required = true }, + }; var parseResult = command.Parse(args); @@ -68,6 +74,7 @@ public static RunTestsOptions Parse(string[] args) RuntimeVersion = sharedFxVersion, Target = parseResult.ValueForOption("--target"), Timeout = TimeSpan.Parse(parseResult.ValueForOption("--helixTimeout")), + Playwright = parseResult.ValueForOption("--playwright"), // When targeting pack builds, it has exactly the same version as the shared framework. AspNetRef = $"Microsoft.AspNetCore.App.Ref.{sharedFxVersion}.nupkg", @@ -88,6 +95,7 @@ public static RunTestsOptions Parse(string[] args) public string RuntimeVersion { get; private set; } public string Target { get; private set; } public TimeSpan Timeout { get; private set; } + public bool Playwright { get; private set; } public string AspNetRef { get; private set; } public string AspNetRuntime { get; private set; } From 2b0b897d2e9c71b24f7be77f4ff29df9bd6253fc Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 15 Feb 2021 14:08:26 -0800 Subject: [PATCH 35/90] Update runtests.sh --- eng/helix/content/runtests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/helix/content/runtests.sh b/eng/helix/content/runtests.sh index 30697a488fe5..e7920dc8d923 100644 --- a/eng/helix/content/runtests.sh +++ b/eng/helix/content/runtests.sh @@ -81,7 +81,7 @@ echo "Restore: $DOTNET_ROOT/dotnet restore RunTests/RunTests.csproj --ignore-fai $DOTNET_ROOT/dotnet restore RunTests/RunTests.csproj --ignore-failed-sources echo "Running tests: $DOTNET_ROOT/dotnet run --no-restore --project RunTests/RunTests.csproj -- --target $1 --runtime $4 --queue $5 --arch $6 --quarantined $7 --ef $8 --helixTimeout $9" -$DOTNET_ROOT/dotnet run --no-restore --project RunTests/RunTests.csproj -- --target $1 --runtime $4 --queue $5 --arch $6 --quarantined $7 --ef $8 --helixTimeout $9 +$DOTNET_ROOT/dotnet run --no-restore --project RunTests/RunTests.csproj -- --target $1 --runtime $4 --queue $5 --arch $6 --quarantined $7 --ef $8 --helixTimeout $9 --playwright $10 exit_code=$? echo "Finished tests...exit_code=$exit_code" From d0355b72633c36fa81ad063e10c5fa4435716913 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 15 Feb 2021 14:10:06 -0800 Subject: [PATCH 36/90] Update runtests.sh --- eng/helix/content/runtests.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/helix/content/runtests.sh b/eng/helix/content/runtests.sh index e7920dc8d923..04af53634e33 100644 --- a/eng/helix/content/runtests.sh +++ b/eng/helix/content/runtests.sh @@ -49,7 +49,7 @@ if [[ -z "${10:-}" ]]; then } else echo "InstallDotNet $DOTNET_ROOT $dotnet_sdk_version '' '' true https://dotnetclimsrc.blob.core.windows.net/dotnet ..." - InstallDotNet $DOTNET_ROOT $dotnet_sdk_version "" "" true https://dotnetclimsrc.blob.core.windows.net/dotnet ${10} || { + InstallDotNet $DOTNET_ROOT $dotnet_sdk_version "" "" true https://dotnetclimsrc.blob.core.windows.net/dotnet ${11} || { exit_code=$? Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "dotnet-install.sh failed (exit code '$exit_code')." >&2 ExitWithExitCode $exit_code @@ -57,7 +57,7 @@ else echo echo "InstallDotNet $DOTNET_ROOT $dotnet_runtime_version '' dotnet true https://dotnetclimsrc.blob.core.windows.net/dotnet ..." - InstallDotNet $DOTNET_ROOT $dotnet_runtime_version "" dotnet true https://dotnetclimsrc.blob.core.windows.net/dotnet ${10} || { + InstallDotNet $DOTNET_ROOT $dotnet_runtime_version "" dotnet true https://dotnetclimsrc.blob.core.windows.net/dotnet ${11} || { exit_code=$? Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "dotnet-install.sh failed (exit code '$exit_code')." >&2 ExitWithExitCode $exit_code From e472a10d1f227a0f5e918ed06bb81d593d45afee Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 15 Feb 2021 14:11:06 -0800 Subject: [PATCH 37/90] Update Helix.targets --- eng/targets/Helix.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/targets/Helix.targets b/eng/targets/Helix.targets index b4eaa8d2b0a7..5392265ea557 100644 --- a/eng/targets/Helix.targets +++ b/eng/targets/Helix.targets @@ -177,8 +177,8 @@ SharedFxVersion because that's needed even when the targeting pack isn't building. Use the BrowserDebugHost transport package as a sentinel for the non-shipping version of the NETCoreApp shared framework. --> - call runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreBrowserDebugHostTransportVersion) $(SharedFxVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfVersion) $(HelixTimeout) $(DotNetRuntimeSourceFeedKey) - ./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreBrowserDebugHostTransportVersion) $(SharedFxVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfVersion) $(HelixTimeout) $(DotNetRuntimeSourceFeedKey) + call runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreBrowserDebugHostTransportVersion) $(SharedFxVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfVersion) $(HelixTimeout) $(TestDependsOnPlaywright) $(DotNetRuntimeSourceFeedKey) + ./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreBrowserDebugHostTransportVersion) $(SharedFxVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfVersion) $(HelixTimeout) $(TestDependsOnPlaywright) $(DotNetRuntimeSourceFeedKey) $(HelixCommand) $(HelixTimeout) From 69e1a9a03b19dbe713cd2a4110a98c24736038bb Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 15 Feb 2021 14:15:07 -0800 Subject: [PATCH 38/90] Update RunTests.csproj --- eng/helix/content/RunTests/RunTests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/helix/content/RunTests/RunTests.csproj b/eng/helix/content/RunTests/RunTests.csproj index 7fc0c8c63888..8f11b57c5809 100644 --- a/eng/helix/content/RunTests/RunTests.csproj +++ b/eng/helix/content/RunTests/RunTests.csproj @@ -7,5 +7,6 @@ + From c9dbbd2ff4a16cfef9daedbffe9ad67e51b8592e Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 15 Feb 2021 14:17:40 -0800 Subject: [PATCH 39/90] Update TestRunner.cs --- eng/helix/content/RunTests/TestRunner.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/eng/helix/content/RunTests/TestRunner.cs b/eng/helix/content/RunTests/TestRunner.cs index 393ff5337415..21076056863f 100644 --- a/eng/helix/content/RunTests/TestRunner.cs +++ b/eng/helix/content/RunTests/TestRunner.cs @@ -8,6 +8,7 @@ using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; +using PlaywrightSharp; namespace RunTests { @@ -85,6 +86,18 @@ public void DisplayContents(string path = "./") } } + public async Task InstallPlaywrightIfNeededAsync() + { + try + { + await Playwright.InstallAsync(); + } + catch (Exception e) + { + Console.WriteLine($"Exception installing playwright: {e.ToString()}"); + } + } + public async Task InstallAspNetAppIfNeededAsync() { try From d42b8d0329bdc4728b7115013fa4eb9979f97557 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 15 Feb 2021 14:18:20 -0800 Subject: [PATCH 40/90] Update Program.cs --- eng/helix/content/RunTests/Program.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eng/helix/content/RunTests/Program.cs b/eng/helix/content/RunTests/Program.cs index 349ab29b8a03..c6998b831954 100644 --- a/eng/helix/content/RunTests/Program.cs +++ b/eng/helix/content/RunTests/Program.cs @@ -27,6 +27,10 @@ static async Task Main(string[] args) { keepGoing = runner.InstallAspNetRefIfNeeded(); } + if (keepGoing) + { + keepGoing = InstallPlaywrightIfNeededAsync(); + } runner.DisplayContents(); From 321d08b7f54ce83f5616ed96d895bb04591f4e25 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 15 Feb 2021 14:19:05 -0800 Subject: [PATCH 41/90] Update TestRunner.cs --- eng/helix/content/RunTests/TestRunner.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eng/helix/content/RunTests/TestRunner.cs b/eng/helix/content/RunTests/TestRunner.cs index 21076056863f..d14f89b67dab 100644 --- a/eng/helix/content/RunTests/TestRunner.cs +++ b/eng/helix/content/RunTests/TestRunner.cs @@ -90,7 +90,10 @@ public async Task InstallPlaywrightIfNeededAsync() { try { - await Playwright.InstallAsync(); + if (Options.Playwright) + { + await Playwright.InstallAsync(); + } } catch (Exception e) { From ddaba3730ca2d9d50a1ea805b95c3c14000b1c94 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 15 Feb 2021 14:20:50 -0800 Subject: [PATCH 42/90] Skip publish of browser binaries --- .../BlazorTemplates.Tests/BlazorTemplates.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj index bac905e573bd..79a1a9efa768 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj @@ -62,7 +62,7 @@ <_browsers Include="$(USERPROFILE)\AppData\Local\ms-playwright\**\*.*" /> - + From 7011b0863d327b1f4ee89e36e19105c76d10fe31 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 15 Feb 2021 14:33:26 -0800 Subject: [PATCH 43/90] Try to install sdk 5.0.103 for playwright --- eng/helix/content/runtests.ps1 | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index e050592b1cc7..c79d67d1ad28 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -43,7 +43,7 @@ function InvokeInstallDotnet([string]$command) { return $false } -function InstallDotnetSDKAndRuntime([string]$Feed, [string]$FeedCredParam) { +function InstallDotnetSDKAndRuntime([string]$sdkVersionToInstall, [string]$runtimeVersionToInstall, [string]$Feed, [string]$FeedCredParam) { foreach ($i in 1..5) { $random = Get-Random -Maximum 1024 $env:DOTNET_HOME = Join-Path $currentDirectory "sdk$random" @@ -53,18 +53,21 @@ function InstallDotnetSDKAndRuntime([string]$Feed, [string]$FeedCredParam) { Write-Host "Set PATH to: $env:PATH" - $success = InvokeInstallDotnet ". eng\common\tools.ps1; InstallDotNet $env:DOTNET_ROOT $SdkVersion $Arch `'`' `$true `'$Feed`' `'$FeedCredParam`' `$true" + $success = InvokeInstallDotnet ". eng\common\tools.ps1; InstallDotNet $env:DOTNET_ROOT $sdkVersionToInstall $Arch `'`' `$true `'$Feed`' `'$FeedCredParam`' `$true" if (!$success) { Write-Host "Retrying..." continue } - $success = InvokeInstallDotnet ". eng\common\tools.ps1; InstallDotNet $env:DOTNET_ROOT $RuntimeVersion $Arch dotnet `$true `'$Feed`' `'$FeedCredParam`' `$true" + if (-Not [string]::IsNullOrEmpty($runtimeVersionToInstall)) + { + $success = InvokeInstallDotnet ". eng\common\tools.ps1; InstallDotNet $env:DOTNET_ROOT $runtimeVersionToInstall $Arch dotnet `$true `'$Feed`' `'$FeedCredParam`' `$true" - if (!$success) { - Write-Host "Retrying..." - continue + if (!$success) { + Write-Host "Retrying..." + continue + } } return @@ -75,9 +78,13 @@ function InstallDotnetSDKAndRuntime([string]$Feed, [string]$FeedCredParam) { } if ([string]::IsNullOrEmpty($FeedCred)) { - InstallDotnetSDKAndRuntime + InstallDotnetSDKAndRuntime $SdkVersion $RuntimeVersion } else { - InstallDotnetSDKAndRuntime "https://dotnetclimsrc.blob.core.windows.net/dotnet" $FeedCred + InstallDotnetSDKAndRuntime $SdkVersion $RuntimeVersion "https://dotnetclimsrc.blob.core.windows.net/dotnet" $FeedCred +} + +if ($InstallPlaywright -eq "true") { + InstallDotnetSDKAndRuntime "5.0.103" } Write-Host "Restore: dotnet restore RunTests\RunTests.csproj --ignore-failed-sources" From 5e10cf39318cd023d068fb1b87039c52afaa4934 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 15 Feb 2021 16:36:20 -0800 Subject: [PATCH 44/90] Update RunTests.csproj --- eng/helix/content/RunTests/RunTests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/helix/content/RunTests/RunTests.csproj b/eng/helix/content/RunTests/RunTests.csproj index 8f11b57c5809..6b3b5ab6323b 100644 --- a/eng/helix/content/RunTests/RunTests.csproj +++ b/eng/helix/content/RunTests/RunTests.csproj @@ -7,6 +7,6 @@ - + From 67007ac1febab6f966e82cd1037da842a0ca0849 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 15 Feb 2021 16:36:39 -0800 Subject: [PATCH 45/90] Update RunTestsOptions.cs --- eng/helix/content/RunTests/RunTestsOptions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/helix/content/RunTests/RunTestsOptions.cs b/eng/helix/content/RunTests/RunTestsOptions.cs index e9546b31b114..bb9560af5894 100644 --- a/eng/helix/content/RunTests/RunTestsOptions.cs +++ b/eng/helix/content/RunTests/RunTestsOptions.cs @@ -54,12 +54,12 @@ public static RunTestsOptions Parse(string[] args) new Option( aliases: new string[] { "--source" }, description: "The restore sources to use during testing") - { Argument = new Argument() { Arity = ArgumentArity.ZeroOrMore }, Required = true } + { Argument = new Argument() { Arity = ArgumentArity.ZeroOrMore }, Required = true }, new Option( aliases: new string[] { "--playwright" }, description: "Whether to install playwright") - { Argument = new Argument(), Required = true }, + { Argument = new Argument(), Required = true } }; From c1e1bfb4ae7c597363742b948827466f7187e2da Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 15 Feb 2021 18:23:10 -0800 Subject: [PATCH 46/90] Update TestRunner.cs --- eng/helix/content/RunTests/TestRunner.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/helix/content/RunTests/TestRunner.cs b/eng/helix/content/RunTests/TestRunner.cs index d14f89b67dab..6f775fa94770 100644 --- a/eng/helix/content/RunTests/TestRunner.cs +++ b/eng/helix/content/RunTests/TestRunner.cs @@ -94,10 +94,12 @@ public async Task InstallPlaywrightIfNeededAsync() { await Playwright.InstallAsync(); } + return true; } catch (Exception e) { Console.WriteLine($"Exception installing playwright: {e.ToString()}"); + return false; } } From 8571207a1e7d363def520b1e96e1b4778cc4c3e1 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 15 Feb 2021 18:23:14 -0800 Subject: [PATCH 47/90] Update Program.cs --- eng/helix/content/RunTests/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/helix/content/RunTests/Program.cs b/eng/helix/content/RunTests/Program.cs index c6998b831954..4fb2c0e73f00 100644 --- a/eng/helix/content/RunTests/Program.cs +++ b/eng/helix/content/RunTests/Program.cs @@ -29,7 +29,7 @@ static async Task Main(string[] args) } if (keepGoing) { - keepGoing = InstallPlaywrightIfNeededAsync(); + keepGoing = runner.InstallPlaywrightIfNeededAsync(); } runner.DisplayContents(); From 113605f6d67351a7482d319fe8c0fa529b95d8bd Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 15 Feb 2021 23:07:27 -0800 Subject: [PATCH 48/90] Update Program.cs --- eng/helix/content/RunTests/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/helix/content/RunTests/Program.cs b/eng/helix/content/RunTests/Program.cs index 4fb2c0e73f00..10c708e01cc4 100644 --- a/eng/helix/content/RunTests/Program.cs +++ b/eng/helix/content/RunTests/Program.cs @@ -29,7 +29,7 @@ static async Task Main(string[] args) } if (keepGoing) { - keepGoing = runner.InstallPlaywrightIfNeededAsync(); + keepGoing = await runner.InstallPlaywrightIfNeededAsync(); } runner.DisplayContents(); From 313bbef02709a7858317666d20a0431ead18fd86 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 00:50:59 -0800 Subject: [PATCH 49/90] Update runtests.ps1 --- eng/helix/content/runtests.ps1 | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index c79d67d1ad28..187c4cc205a2 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -43,7 +43,7 @@ function InvokeInstallDotnet([string]$command) { return $false } -function InstallDotnetSDKAndRuntime([string]$sdkVersionToInstall, [string]$runtimeVersionToInstall, [string]$Feed, [string]$FeedCredParam) { +function InstallDotnetSDKAndRuntime([string]$Feed, [string]$FeedCredParam) { foreach ($i in 1..5) { $random = Get-Random -Maximum 1024 $env:DOTNET_HOME = Join-Path $currentDirectory "sdk$random" @@ -53,8 +53,7 @@ function InstallDotnetSDKAndRuntime([string]$sdkVersionToInstall, [string]$runti Write-Host "Set PATH to: $env:PATH" - $success = InvokeInstallDotnet ". eng\common\tools.ps1; InstallDotNet $env:DOTNET_ROOT $sdkVersionToInstall $Arch `'`' `$true `'$Feed`' `'$FeedCredParam`' `$true" - + $success = InvokeInstallDotnet ". eng\common\tools.ps1; InstallDotNet $env:DOTNET_ROOT $SdkVersion $Arch `'`' `$true `'$Feed`' `'$FeedCredParam`' `$true" if (!$success) { Write-Host "Retrying..." continue @@ -62,7 +61,7 @@ function InstallDotnetSDKAndRuntime([string]$sdkVersionToInstall, [string]$runti if (-Not [string]::IsNullOrEmpty($runtimeVersionToInstall)) { - $success = InvokeInstallDotnet ". eng\common\tools.ps1; InstallDotNet $env:DOTNET_ROOT $runtimeVersionToInstall $Arch dotnet `$true `'$Feed`' `'$FeedCredParam`' `$true" + $success = InvokeInstallDotnet ". eng\common\tools.ps1; InstallDotNet $env:DOTNET_ROOT $RuntimeVersion $Arch dotnet `$true `'$Feed`' `'$FeedCredParam`' `$true" if (!$success) { Write-Host "Retrying..." @@ -78,13 +77,23 @@ function InstallDotnetSDKAndRuntime([string]$sdkVersionToInstall, [string]$runti } if ([string]::IsNullOrEmpty($FeedCred)) { - InstallDotnetSDKAndRuntime $SdkVersion $RuntimeVersion + InstallDotnetSDKAndRuntime } else { - InstallDotnetSDKAndRuntime $SdkVersion $RuntimeVersion "https://dotnetclimsrc.blob.core.windows.net/dotnet" $FeedCred + InstallDotnetSDKAndRuntime"https://dotnetclimsrc.blob.core.windows.net/dotnet" $FeedCred } if ($InstallPlaywright -eq "true") { - InstallDotnetSDKAndRuntime "5.0.103" + foreach ($i in 1..5) { + $success = InvokeInstallDotnet ". eng\common\tools.ps1; InstallDotNet $env:DOTNET_ROOT 5.0.103 $Arch `'`' `$true `'`' `'`' `$true" + + if (!$success) { + Write-Host "Retrying..." + } + else + { + break + } + } } Write-Host "Restore: dotnet restore RunTests\RunTests.csproj --ignore-failed-sources" From ffd581f8df2a00711fa1f89d73cc16e324e0a7d4 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 01:07:41 -0800 Subject: [PATCH 50/90] Specify the playwright browsers path in install --- eng/helix/content/RunTests/TestRunner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/helix/content/RunTests/TestRunner.cs b/eng/helix/content/RunTests/TestRunner.cs index 6f775fa94770..dfed9da2aa4b 100644 --- a/eng/helix/content/RunTests/TestRunner.cs +++ b/eng/helix/content/RunTests/TestRunner.cs @@ -92,7 +92,7 @@ public async Task InstallPlaywrightIfNeededAsync() { if (Options.Playwright) { - await Playwright.InstallAsync(); + await Playwright.InstallAsync(EnvironmentVariables["PLAYWRIGHT_BROWSERS_PATH"]); } return true; } From 1b5cdae841cbbf834c6e58c8378ac88374b94ec5 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 01:09:23 -0800 Subject: [PATCH 51/90] Update runtests.sh --- eng/helix/content/runtests.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/helix/content/runtests.sh b/eng/helix/content/runtests.sh index 04af53634e33..a69edc7a2d1f 100644 --- a/eng/helix/content/runtests.sh +++ b/eng/helix/content/runtests.sh @@ -25,6 +25,9 @@ export DOTNET_CLI_HOME="$DIR/.home$RANDOM" export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +# Set playwright browser path +export PLAYWRIGHT_BROWSERS_PATH="$DIR/ms-playwright" + RESET="\033[0m" RED="\033[0;31m" YELLOW="\033[0;33m" From de31ea56702568aeb598f390930aa7a5cfa3a60b Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 01:10:59 -0800 Subject: [PATCH 52/90] Update runtests.ps1 --- eng/helix/content/runtests.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index 187c4cc205a2..13c6cc8a4c19 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -14,6 +14,7 @@ param( $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1 $env:DOTNET_MULTILEVEL_LOOKUP = 0 +$env:PLAYWRIGHT_BROWSERS_PATH = $currentDirectory\ms-playwright $currentDirectory = Get-Location $envPath = "$env:PATH;$env:HELIX_CORRELATION_PAYLOAD\node\bin" From 59e68a4ef32c842c297b7d9b33f07844ead68aee Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 01:11:32 -0800 Subject: [PATCH 53/90] Update runtests.ps1 --- eng/helix/content/runtests.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index 13c6cc8a4c19..9fe1cc75baa8 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -14,11 +14,12 @@ param( $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1 $env:DOTNET_MULTILEVEL_LOOKUP = 0 -$env:PLAYWRIGHT_BROWSERS_PATH = $currentDirectory\ms-playwright $currentDirectory = Get-Location $envPath = "$env:PATH;$env:HELIX_CORRELATION_PAYLOAD\node\bin" +$env:PLAYWRIGHT_BROWSERS_PATH = $currentDirectory\ms-playwright + function InvokeInstallDotnet([string]$command) { Write-Host "InstallDotNet $command" From e152e504aea02de492de8771e3cae76dc558de39 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 01:20:02 -0800 Subject: [PATCH 54/90] Update runtests.ps1 --- eng/helix/content/runtests.ps1 | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index 9fe1cc75baa8..6180088fdd4a 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -61,14 +61,11 @@ function InstallDotnetSDKAndRuntime([string]$Feed, [string]$FeedCredParam) { continue } - if (-Not [string]::IsNullOrEmpty($runtimeVersionToInstall)) - { - $success = InvokeInstallDotnet ". eng\common\tools.ps1; InstallDotNet $env:DOTNET_ROOT $RuntimeVersion $Arch dotnet `$true `'$Feed`' `'$FeedCredParam`' `$true" + $success = InvokeInstallDotnet ". eng\common\tools.ps1; InstallDotNet $env:DOTNET_ROOT $RuntimeVersion $Arch dotnet `$true `'$Feed`' `'$FeedCredParam`' `$true" - if (!$success) { - Write-Host "Retrying..." - continue - } + if (!$success) { + Write-Host "Retrying..." + continue } return From 791bdab37f04ac7d04948288cc11ca4c3760d8eb Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 01:20:49 -0800 Subject: [PATCH 55/90] Update runtests.ps1 --- eng/helix/content/runtests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index 6180088fdd4a..c773324d972c 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -78,7 +78,7 @@ function InstallDotnetSDKAndRuntime([string]$Feed, [string]$FeedCredParam) { if ([string]::IsNullOrEmpty($FeedCred)) { InstallDotnetSDKAndRuntime } else { - InstallDotnetSDKAndRuntime"https://dotnetclimsrc.blob.core.windows.net/dotnet" $FeedCred + InstallDotnetSDKAndRuntime "https://dotnetclimsrc.blob.core.windows.net/dotnet" $FeedCred } if ($InstallPlaywright -eq "true") { From 47012b5e5a7ee9481ea733dfcbe6ac4c990853e0 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 08:55:14 -0800 Subject: [PATCH 56/90] Update runtests.ps1 --- eng/helix/content/runtests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index c773324d972c..90601cc10655 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -18,7 +18,7 @@ $env:DOTNET_MULTILEVEL_LOOKUP = 0 $currentDirectory = Get-Location $envPath = "$env:PATH;$env:HELIX_CORRELATION_PAYLOAD\node\bin" -$env:PLAYWRIGHT_BROWSERS_PATH = $currentDirectory\ms-playwright +$env:PLAYWRIGHT_BROWSERS_PATH = "$currentDirectory\ms-playwright" function InvokeInstallDotnet([string]$command) { Write-Host "InstallDotNet $command" From 3fc8434c5cfde022b21fe649900023a8c99867bd Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 11:50:15 -0800 Subject: [PATCH 57/90] Update BlazorTemplates.Tests.csproj --- .../BlazorTemplates.Tests/BlazorTemplates.Tests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj index 79a1a9efa768..a582e7ab04c5 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj @@ -8,6 +8,7 @@ true true true + 30 From 9b29ef01e39d3e7e6721594d611bc5c7151a3f33 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 12:11:06 -0800 Subject: [PATCH 58/90] Update BlazorTemplates.Tests.csproj --- .../BlazorTemplates.Tests/BlazorTemplates.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj index a582e7ab04c5..8553183a82f5 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj @@ -8,7 +8,7 @@ true true true - 30 + 00:30:00 From e28f32c9b0648aa5af2928e46a464b63321da5a0 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 12:11:43 -0800 Subject: [PATCH 59/90] Update BlazorTemplates.Tests.csproj --- .../BlazorTemplates.Tests/BlazorTemplates.Tests.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj index 8553183a82f5..79a1a9efa768 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj @@ -8,7 +8,6 @@ true true true - 00:30:00 From 218a819271ec62433b28f18e24244a400c5670b6 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 12:12:36 -0800 Subject: [PATCH 60/90] Bump hang test timeout to 15 minutes --- eng/helix/content/RunTests/TestRunner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/helix/content/RunTests/TestRunner.cs b/eng/helix/content/RunTests/TestRunner.cs index dfed9da2aa4b..45921983441d 100644 --- a/eng/helix/content/RunTests/TestRunner.cs +++ b/eng/helix/content/RunTests/TestRunner.cs @@ -262,7 +262,7 @@ public async Task RunTestsAsync() { // Timeout test run 5 minutes before the Helix job would timeout var cts = new CancellationTokenSource(Options.Timeout.Subtract(TimeSpan.FromMinutes(5))); - var commonTestArgs = $"test {Options.Target} --logger:xunit --logger:\"console;verbosity=normal\" --blame \"CollectHangDump;TestTimeout=5m\""; + var commonTestArgs = $"test {Options.Target} --logger:xunit --logger:\"console;verbosity=normal\" --blame \"CollectHangDump;TestTimeout=15m\""; if (Options.Quarantined) { Console.WriteLine("Running quarantined tests."); From 7f4def48251dfa815b73007e26a7bf340dcc95d7 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 14:04:09 -0800 Subject: [PATCH 61/90] Only enable playwright when needed --- eng/helix/content/RunTests/RunTests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/helix/content/RunTests/RunTests.csproj b/eng/helix/content/RunTests/RunTests.csproj index 6b3b5ab6323b..7c230d4fec45 100644 --- a/eng/helix/content/RunTests/RunTests.csproj +++ b/eng/helix/content/RunTests/RunTests.csproj @@ -7,6 +7,6 @@ - + Include="PlaywrightSharp" Version="0.180.0" /> From a34938ae5cc9e4c814fbe01d4ef049d9191366fc Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 14:05:10 -0800 Subject: [PATCH 62/90] Update RunTests.csproj --- eng/helix/content/RunTests/RunTests.csproj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eng/helix/content/RunTests/RunTests.csproj b/eng/helix/content/RunTests/RunTests.csproj index 7c230d4fec45..b5c00183235b 100644 --- a/eng/helix/content/RunTests/RunTests.csproj +++ b/eng/helix/content/RunTests/RunTests.csproj @@ -3,10 +3,13 @@ Exe net6.0 + $(DefineConstants);INSTALLPLAYWRIGHT + + - Include="PlaywrightSharp" Version="0.180.0" /> + Include="PlaywrightSharp" Version="0.180.0" /> From 21601544880dc3c001975bd3a70beadeaf435bcb Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 14:06:04 -0800 Subject: [PATCH 63/90] Update RunTests.csproj --- eng/helix/content/RunTests/RunTests.csproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/eng/helix/content/RunTests/RunTests.csproj b/eng/helix/content/RunTests/RunTests.csproj index b5c00183235b..e4797db4caf1 100644 --- a/eng/helix/content/RunTests/RunTests.csproj +++ b/eng/helix/content/RunTests/RunTests.csproj @@ -6,8 +6,6 @@ $(DefineConstants);INSTALLPLAYWRIGHT - - Include="PlaywrightSharp" Version="0.180.0" /> From cd21d73e09ac23b61b70a80138e5d30a0ddf7d5f Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 14:07:27 -0800 Subject: [PATCH 64/90] Update TestRunner.cs --- eng/helix/content/RunTests/TestRunner.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/eng/helix/content/RunTests/TestRunner.cs b/eng/helix/content/RunTests/TestRunner.cs index 45921983441d..763244a72721 100644 --- a/eng/helix/content/RunTests/TestRunner.cs +++ b/eng/helix/content/RunTests/TestRunner.cs @@ -8,7 +8,9 @@ using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; +#if INSTALLPLAYWRIGHT using PlaywrightSharp; +#endif namespace RunTests { @@ -41,11 +43,13 @@ public bool SetupEnvironment() Console.WriteLine($"Set DotNetEfFullPath: {dotnetEFFullPath}"); EnvironmentVariables.Add("DotNetEfFullPath", dotnetEFFullPath); +#if INSTALLPLAYWRIGHT // Playwright will download and look for browsers to this directory var playwrightBrowsers = Path.Combine(helixDir, "ms-playwright"); Console.WriteLine($"Setting PLAYWRIGHT_BROWSERS_PATH: {playwrightBrowsers}"); EnvironmentVariables.Add("PLAYWRIGHT_BROWSERS_PATH", playwrightBrowsers); - +#endif + Console.WriteLine($"Creating nuget restore directory: {nugetRestore}"); Directory.CreateDirectory(nugetRestore); @@ -86,14 +90,12 @@ public void DisplayContents(string path = "./") } } - public async Task InstallPlaywrightIfNeededAsync() +#if INSTALLPLAYWRIGHT + public async Task InstallPlaywrightAsync() { try { - if (Options.Playwright) - { - await Playwright.InstallAsync(EnvironmentVariables["PLAYWRIGHT_BROWSERS_PATH"]); - } + await Playwright.InstallAsync(EnvironmentVariables["PLAYWRIGHT_BROWSERS_PATH"]); return true; } catch (Exception e) @@ -102,6 +104,7 @@ public async Task InstallPlaywrightIfNeededAsync() return false; } } +#endif public async Task InstallAspNetAppIfNeededAsync() { From 6620961d3e88bdea73404e065877960b9642aae1 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 14:08:17 -0800 Subject: [PATCH 65/90] Update RunTestsOptions.cs --- eng/helix/content/RunTests/RunTestsOptions.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/eng/helix/content/RunTests/RunTestsOptions.cs b/eng/helix/content/RunTests/RunTestsOptions.cs index bb9560af5894..05b2b6d9c347 100644 --- a/eng/helix/content/RunTests/RunTestsOptions.cs +++ b/eng/helix/content/RunTests/RunTestsOptions.cs @@ -54,12 +54,7 @@ public static RunTestsOptions Parse(string[] args) new Option( aliases: new string[] { "--source" }, description: "The restore sources to use during testing") - { Argument = new Argument() { Arity = ArgumentArity.ZeroOrMore }, Required = true }, - - new Option( - aliases: new string[] { "--playwright" }, - description: "Whether to install playwright") - { Argument = new Argument(), Required = true } + { Argument = new Argument() { Arity = ArgumentArity.ZeroOrMore }, Required = true } }; @@ -74,7 +69,6 @@ public static RunTestsOptions Parse(string[] args) RuntimeVersion = sharedFxVersion, Target = parseResult.ValueForOption("--target"), Timeout = TimeSpan.Parse(parseResult.ValueForOption("--helixTimeout")), - Playwright = parseResult.ValueForOption("--playwright"), // When targeting pack builds, it has exactly the same version as the shared framework. AspNetRef = $"Microsoft.AspNetCore.App.Ref.{sharedFxVersion}.nupkg", @@ -95,7 +89,6 @@ public static RunTestsOptions Parse(string[] args) public string RuntimeVersion { get; private set; } public string Target { get; private set; } public TimeSpan Timeout { get; private set; } - public bool Playwright { get; private set; } public string AspNetRef { get; private set; } public string AspNetRuntime { get; private set; } From 7848ec2523ab708b3d9f1f543a9cc20fda53534c Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 14:08:41 -0800 Subject: [PATCH 66/90] Update Program.cs --- eng/helix/content/RunTests/Program.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eng/helix/content/RunTests/Program.cs b/eng/helix/content/RunTests/Program.cs index 10c708e01cc4..4de3d6537319 100644 --- a/eng/helix/content/RunTests/Program.cs +++ b/eng/helix/content/RunTests/Program.cs @@ -27,10 +27,12 @@ static async Task Main(string[] args) { keepGoing = runner.InstallAspNetRefIfNeeded(); } +#if INSTALLPLAYWRIGHT if (keepGoing) { - keepGoing = await runner.InstallPlaywrightIfNeededAsync(); + keepGoing = await runner.InstallPlaywrightAsync(); } +#endif runner.DisplayContents(); From 79a4afcbe7de84012efc42c19ce8d7a0fd1c95d3 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 14:09:08 -0800 Subject: [PATCH 67/90] Update RunTestsOptions.cs --- eng/helix/content/RunTests/RunTestsOptions.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/helix/content/RunTests/RunTestsOptions.cs b/eng/helix/content/RunTests/RunTestsOptions.cs index 05b2b6d9c347..031326ba8a14 100644 --- a/eng/helix/content/RunTests/RunTestsOptions.cs +++ b/eng/helix/content/RunTests/RunTestsOptions.cs @@ -55,7 +55,6 @@ public static RunTestsOptions Parse(string[] args) aliases: new string[] { "--source" }, description: "The restore sources to use during testing") { Argument = new Argument() { Arity = ArgumentArity.ZeroOrMore }, Required = true } - }; var parseResult = command.Parse(args); From efe65ae156ddffd5a9b546abcc3ee0181c625ad5 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 14:17:47 -0800 Subject: [PATCH 68/90] Update runtests.ps1 --- eng/helix/content/runtests.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index 90601cc10655..e3d8835c7b0a 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -95,13 +95,18 @@ if ($InstallPlaywright -eq "true") { } } -Write-Host "Restore: dotnet restore RunTests\RunTests.csproj --ignore-failed-sources" +Write-Host "Restore: dotnet restore RunTests\RunTests.csproj --ignore-failed-sources -p:InstallPlaywright:$InstallPlaywright " dotnet restore RunTests\RunTests.csproj --ignore-failed-sources if ($LastExitCode -ne 0) { exit $LastExitCode } +if ($InstallPlaywright -eq "true") { + Write-Host "InstallPlaywright requested, building dotnet build --no-restore RunTests\RunTests.csproj -p:InstallPlaywright:true" + dotnet build --no-restore RunTests\RunTests.csproj -p:InstallPlaywright:true +} + Write-Host "Running tests: dotnet run --no-restore --project RunTests\RunTests.csproj -- --target $Target --runtime $AspRuntimeVersion --queue $Queue --arch $Arch --quarantined $Quarantined --ef $EF --helixTimeout $HelixTimeout" dotnet run --no-restore --project RunTests\RunTests.csproj -- --target $Target --runtime $AspRuntimeVersion --queue $Queue --arch $Arch --quarantined $Quarantined --ef $EF --helixTimeout $HelixTimeout --playwright $InstallPlaywright From 6ed9f24f8dbf6e1fc4a44c8853fba622c7466af7 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 14:25:54 -0800 Subject: [PATCH 69/90] conditional for pw in runtests --- eng/helix/content/RunTests/RunTests.csproj | 2 +- eng/helix/content/runtests.ps1 | 6 +++--- eng/helix/content/runtests.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/helix/content/RunTests/RunTests.csproj b/eng/helix/content/RunTests/RunTests.csproj index e4797db4caf1..948c3b72dce6 100644 --- a/eng/helix/content/RunTests/RunTests.csproj +++ b/eng/helix/content/RunTests/RunTests.csproj @@ -8,6 +8,6 @@ - Include="PlaywrightSharp" Version="0.180.0" /> + diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index e3d8835c7b0a..5e89a8a4825e 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -18,8 +18,6 @@ $env:DOTNET_MULTILEVEL_LOOKUP = 0 $currentDirectory = Get-Location $envPath = "$env:PATH;$env:HELIX_CORRELATION_PAYLOAD\node\bin" -$env:PLAYWRIGHT_BROWSERS_PATH = "$currentDirectory\ms-playwright" - function InvokeInstallDotnet([string]$command) { Write-Host "InstallDotNet $command" @@ -103,12 +101,14 @@ if ($LastExitCode -ne 0) { } if ($InstallPlaywright -eq "true") { + $env:PLAYWRIGHT_BROWSERS_PATH = "$currentDirectory\ms-playwright" + Write-Host "InstallPlaywright requested, building dotnet build --no-restore RunTests\RunTests.csproj -p:InstallPlaywright:true" dotnet build --no-restore RunTests\RunTests.csproj -p:InstallPlaywright:true } Write-Host "Running tests: dotnet run --no-restore --project RunTests\RunTests.csproj -- --target $Target --runtime $AspRuntimeVersion --queue $Queue --arch $Arch --quarantined $Quarantined --ef $EF --helixTimeout $HelixTimeout" -dotnet run --no-restore --project RunTests\RunTests.csproj -- --target $Target --runtime $AspRuntimeVersion --queue $Queue --arch $Arch --quarantined $Quarantined --ef $EF --helixTimeout $HelixTimeout --playwright $InstallPlaywright +dotnet run --no-restore --project RunTests\RunTests.csproj -- --target $Target --runtime $AspRuntimeVersion --queue $Queue --arch $Arch --quarantined $Quarantined --ef $EF --helixTimeout $HelixTimeout Write-Host "Finished running tests: exit_code=$LastExitCode" exit $LastExitCode diff --git a/eng/helix/content/runtests.sh b/eng/helix/content/runtests.sh index a69edc7a2d1f..1a6ee3a3125f 100644 --- a/eng/helix/content/runtests.sh +++ b/eng/helix/content/runtests.sh @@ -84,7 +84,7 @@ echo "Restore: $DOTNET_ROOT/dotnet restore RunTests/RunTests.csproj --ignore-fai $DOTNET_ROOT/dotnet restore RunTests/RunTests.csproj --ignore-failed-sources echo "Running tests: $DOTNET_ROOT/dotnet run --no-restore --project RunTests/RunTests.csproj -- --target $1 --runtime $4 --queue $5 --arch $6 --quarantined $7 --ef $8 --helixTimeout $9" -$DOTNET_ROOT/dotnet run --no-restore --project RunTests/RunTests.csproj -- --target $1 --runtime $4 --queue $5 --arch $6 --quarantined $7 --ef $8 --helixTimeout $9 --playwright $10 +$DOTNET_ROOT/dotnet run --no-restore --project RunTests/RunTests.csproj -- --target $1 --runtime $4 --queue $5 --arch $6 --quarantined $7 --ef $8 --helixTimeout $9 exit_code=$? echo "Finished tests...exit_code=$exit_code" From bc48000299bf54b5be5b2243b5e5526c81a6984b Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 15:41:05 -0800 Subject: [PATCH 70/90] Fix dotnet build param --- eng/helix/content/runtests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index 5e89a8a4825e..a0acc9ac4890 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -103,8 +103,8 @@ if ($LastExitCode -ne 0) { if ($InstallPlaywright -eq "true") { $env:PLAYWRIGHT_BROWSERS_PATH = "$currentDirectory\ms-playwright" - Write-Host "InstallPlaywright requested, building dotnet build --no-restore RunTests\RunTests.csproj -p:InstallPlaywright:true" - dotnet build --no-restore RunTests\RunTests.csproj -p:InstallPlaywright:true + Write-Host "InstallPlaywright requested, building dotnet build --no-restore /p:InstallPlaywright=true RunTests\RunTests.csproj" + dotnet build --no-restore /p:InstallPlaywright=true RunTests\RunTests.csproj } Write-Host "Running tests: dotnet run --no-restore --project RunTests\RunTests.csproj -- --target $Target --runtime $AspRuntimeVersion --queue $Queue --arch $Arch --quarantined $Quarantined --ef $EF --helixTimeout $HelixTimeout" From e330e799db77d820fd5a00b65798c2eca2b65f84 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 16 Feb 2021 19:31:26 -0800 Subject: [PATCH 71/90] Fixes --- eng/helix/content/RunTests/RunTestsOptions.cs | 3 ++- eng/helix/content/runtests.ps1 | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/eng/helix/content/RunTests/RunTestsOptions.cs b/eng/helix/content/RunTests/RunTestsOptions.cs index 031326ba8a14..beaf08f19595 100644 --- a/eng/helix/content/RunTests/RunTestsOptions.cs +++ b/eng/helix/content/RunTests/RunTestsOptions.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.CommandLine; +using System.Globalization; using System.IO; using System.Runtime.InteropServices; using System.Threading.Tasks; @@ -67,7 +68,7 @@ public static RunTestsOptions Parse(string[] args) Quarantined = parseResult.ValueForOption("--quarantined"), RuntimeVersion = sharedFxVersion, Target = parseResult.ValueForOption("--target"), - Timeout = TimeSpan.Parse(parseResult.ValueForOption("--helixTimeout")), + Timeout = TimeSpan.Parse(parseResult.ValueForOption("--helixTimeout"), CultureInfo.InvariantCulture), // When targeting pack builds, it has exactly the same version as the shared framework. AspNetRef = $"Microsoft.AspNetCore.App.Ref.{sharedFxVersion}.nupkg", diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index a0acc9ac4890..61d31e3f145e 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -93,8 +93,8 @@ if ($InstallPlaywright -eq "true") { } } -Write-Host "Restore: dotnet restore RunTests\RunTests.csproj --ignore-failed-sources -p:InstallPlaywright:$InstallPlaywright " -dotnet restore RunTests\RunTests.csproj --ignore-failed-sources +Write-Host "Restore: dotnet restore RunTests\RunTests.csproj --ignore-failed-sources -p:InstallPlaywright:$InstallPlaywright" +dotnet restore RunTests\RunTests.csproj --ignore-failed-sources -p:InstallPlaywright:$InstallPlaywright if ($LastExitCode -ne 0) { exit $LastExitCode From d0bb51146ac7173e097f7254017ca4187cd9977f Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 17 Feb 2021 01:17:41 -0800 Subject: [PATCH 72/90] Fix runtests --- eng/helix/content/runtests.ps1 | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index 61d31e3f145e..29d0dc710461 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -14,6 +14,7 @@ param( $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1 $env:DOTNET_MULTILEVEL_LOOKUP = 0 +$env:PLAYWRIGHT_BROWSERS_PATH = "$currentDirectory\ms-playwright" $currentDirectory = Get-Location $envPath = "$env:PATH;$env:HELIX_CORRELATION_PAYLOAD\node\bin" @@ -93,22 +94,15 @@ if ($InstallPlaywright -eq "true") { } } -Write-Host "Restore: dotnet restore RunTests\RunTests.csproj --ignore-failed-sources -p:InstallPlaywright:$InstallPlaywright" -dotnet restore RunTests\RunTests.csproj --ignore-failed-sources -p:InstallPlaywright:$InstallPlaywright +Write-Host "Restore: dotnet restore RunTests\RunTests.csproj --ignore-failed-sources /p:InstallPlaywright=$InstallPlaywright" +dotnet restore RunTests\RunTests.csproj --ignore-failed-sources /p:InstallPlaywright=$InstallPlaywright if ($LastExitCode -ne 0) { exit $LastExitCode } -if ($InstallPlaywright -eq "true") { - $env:PLAYWRIGHT_BROWSERS_PATH = "$currentDirectory\ms-playwright" - - Write-Host "InstallPlaywright requested, building dotnet build --no-restore /p:InstallPlaywright=true RunTests\RunTests.csproj" - dotnet build --no-restore /p:InstallPlaywright=true RunTests\RunTests.csproj -} - -Write-Host "Running tests: dotnet run --no-restore --project RunTests\RunTests.csproj -- --target $Target --runtime $AspRuntimeVersion --queue $Queue --arch $Arch --quarantined $Quarantined --ef $EF --helixTimeout $HelixTimeout" -dotnet run --no-restore --project RunTests\RunTests.csproj -- --target $Target --runtime $AspRuntimeVersion --queue $Queue --arch $Arch --quarantined $Quarantined --ef $EF --helixTimeout $HelixTimeout +Write-Host "Running tests: dotnet run --no-restore /p:InstallPlaywright=$InstallPlaywright --project RunTests\RunTests.csproj -- --target $Target --runtime $AspRuntimeVersion --queue $Queue --arch $Arch --quarantined $Quarantined --ef $EF --helixTimeout $HelixTimeout" +dotnet run --no-restore /p:InstallPlaywright=$InstallPlaywright --project RunTests\RunTests.csproj -- --target $Target --runtime $AspRuntimeVersion --queue $Queue --arch $Arch --quarantined $Quarantined --ef $EF --helixTimeout $HelixTimeout Write-Host "Finished running tests: exit_code=$LastExitCode" exit $LastExitCode From 1fe6c9d623145eea2eecb8932b7592c105355fc9 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 17 Feb 2021 09:10:03 -0800 Subject: [PATCH 73/90] Update BlazorTemplates.Tests.csproj --- .../BlazorTemplates.Tests/BlazorTemplates.Tests.csproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj index 79a1a9efa768..8001d254d00c 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj @@ -57,12 +57,4 @@ - - - - <_browsers Include="$(USERPROFILE)\AppData\Local\ms-playwright\**\*.*" /> - - - - From 2578ea3b4ea67e3bfcd26f74c6e063b22d45d03a Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 17 Feb 2021 09:10:53 -0800 Subject: [PATCH 74/90] Try the full matrix --- .azure/pipelines/helix-matrix.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.azure/pipelines/helix-matrix.yml b/.azure/pipelines/helix-matrix.yml index 558afc7bbaa2..520fb47cdf77 100644 --- a/.azure/pipelines/helix-matrix.yml +++ b/.azure/pipelines/helix-matrix.yml @@ -1,5 +1,9 @@ # We only want to run full helix matrix on main -pr: none +pr: + autoCancel: true + branches: + include: + - '*' trigger: none schedules: # Cron timezone is UTC. From b7d90c3fb72ff7fffffadf981b3f4494fe1ce773 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 17 Feb 2021 13:33:19 -0800 Subject: [PATCH 75/90] Update installPlaywrightReqs.ps1 --- eng/helix/content/installPlaywrightReqs.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/helix/content/installPlaywrightReqs.ps1 b/eng/helix/content/installPlaywrightReqs.ps1 index fc02550d71ca..1fc8e23e0d70 100644 --- a/eng/helix/content/installPlaywrightReqs.ps1 +++ b/eng/helix/content/installPlaywrightReqs.ps1 @@ -1,6 +1,6 @@ Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation (For Playwright)" try { - Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation + Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation -Force -Confirm:$false } catch { Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation threw an exception: $PSItem.Exception.Message" } From 954b230feeb6cc1d0a21c9e15027b329ee4d5867 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 17 Feb 2021 13:37:05 -0800 Subject: [PATCH 76/90] Update installPlaywrightReqs.ps1 --- eng/helix/content/installPlaywrightReqs.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/helix/content/installPlaywrightReqs.ps1 b/eng/helix/content/installPlaywrightReqs.ps1 index 1fc8e23e0d70..eceac500fe08 100644 --- a/eng/helix/content/installPlaywrightReqs.ps1 +++ b/eng/helix/content/installPlaywrightReqs.ps1 @@ -1,3 +1,5 @@ +Write-Host "Set-ExecutionPolicy Bypass -Scope Process" +Set-ExecutionPolicy Bypass -Scope Process Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation (For Playwright)" try { Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation -Force -Confirm:$false From bd5864c8ce176024b69b0169edfaef4ee6e127c8 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 17 Feb 2021 15:56:42 -0800 Subject: [PATCH 77/90] Only try to install server media foundation if needed --- eng/helix/content/installPlaywrightReqs.ps1 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/eng/helix/content/installPlaywrightReqs.ps1 b/eng/helix/content/installPlaywrightReqs.ps1 index eceac500fe08..99f54c221b1b 100644 --- a/eng/helix/content/installPlaywrightReqs.ps1 +++ b/eng/helix/content/installPlaywrightReqs.ps1 @@ -1,8 +1,12 @@ Write-Host "Set-ExecutionPolicy Bypass -Scope Process" Set-ExecutionPolicy Bypass -Scope Process -Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation (For Playwright)" -try { - Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation -Force -Confirm:$false -} catch { - Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation threw an exception: $PSItem.Exception.Message" -} +if ((Get-WindowsOptionalFeature -FeatureName ServerMediaFoundation -Online).State -eq "Enabled") { + Write-Host "ServerMediaFoundation feature already enabled." +} else { + Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation -Confirm:$false (For Playwright)" + try { + Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation -Confirm:$false + } catch { + Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation -Confirm:$false threw an exception: $PSItem" + } +} \ No newline at end of file From 1511fc2b0147f22e8b14496148f668e4718461d4 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 17 Feb 2021 17:44:44 -0800 Subject: [PATCH 78/90] Skip playwright tests on win7 (missing dism cmdlet) --- eng/targets/Helix.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/targets/Helix.targets b/eng/targets/Helix.targets index 5392265ea557..46f0904db538 100644 --- a/eng/targets/Helix.targets +++ b/eng/targets/Helix.targets @@ -9,6 +9,7 @@ + Windows.7.Amd64.Open From 9b189a812131643f2111c658d4473aa248f1ddad Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 17 Feb 2021 17:45:17 -0800 Subject: [PATCH 79/90] Update installPlaywrightReqs.ps1 --- eng/helix/content/installPlaywrightReqs.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/helix/content/installPlaywrightReqs.ps1 b/eng/helix/content/installPlaywrightReqs.ps1 index 99f54c221b1b..2342511cdb4c 100644 --- a/eng/helix/content/installPlaywrightReqs.ps1 +++ b/eng/helix/content/installPlaywrightReqs.ps1 @@ -3,10 +3,10 @@ Set-ExecutionPolicy Bypass -Scope Process if ((Get-WindowsOptionalFeature -FeatureName ServerMediaFoundation -Online).State -eq "Enabled") { Write-Host "ServerMediaFoundation feature already enabled." } else { - Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation -Confirm:$false (For Playwright)" + Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation (For Playwright)" try { - Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation -Confirm:$false + Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation } catch { - Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation -Confirm:$false threw an exception: $PSItem" + Write-Host "Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation threw an exception: $PSItem" } -} \ No newline at end of file +} From 2d5734de2384f72e0183b9c5693da092b437c9a9 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 17 Feb 2021 18:12:07 -0800 Subject: [PATCH 80/90] Update Helix.targets --- eng/targets/Helix.targets | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eng/targets/Helix.targets b/eng/targets/Helix.targets index 46f0904db538..3e6ea1d4bdc6 100644 --- a/eng/targets/Helix.targets +++ b/eng/targets/Helix.targets @@ -8,8 +8,11 @@ - + Windows.7.Amd64.Open + + + From 938b316aecb99f376fec0e2861cdc537d8288978 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 17 Feb 2021 19:52:42 -0800 Subject: [PATCH 81/90] Disable verbose logging for now --- src/Shared/BrowserTesting/src/BrowserManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shared/BrowserTesting/src/BrowserManager.cs b/src/Shared/BrowserTesting/src/BrowserManager.cs index ede459195318..20f970736e27 100644 --- a/src/Shared/BrowserTesting/src/BrowserManager.cs +++ b/src/Shared/BrowserTesting/src/BrowserManager.cs @@ -46,7 +46,7 @@ private async Task InitializeAsync() async Task InitializeCore() { - Playwright = await PlaywrightSharp.Playwright.CreateAsync(_loggerFactory, debug: "pw:api"); + Playwright = await PlaywrightSharp.Playwright.CreateAsync(_loggerFactory/*, debug: "pw:api"*/); foreach (var (browserName, options) in _browserManagerConfiguration.BrowserOptions) { if (!_launchBrowsers.ContainsKey(browserName)) From c82ad5f17d48c0d385ff6c616c06f1086a8f10cc Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 17 Feb 2021 23:58:29 -0800 Subject: [PATCH 82/90] Skip win81 too --- eng/targets/Helix.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/targets/Helix.targets b/eng/targets/Helix.targets index 3e6ea1d4bdc6..9592591f1d87 100644 --- a/eng/targets/Helix.targets +++ b/eng/targets/Helix.targets @@ -9,7 +9,7 @@ - Windows.7.Amd64.Open + Windows.7.Amd64.Open;Windows.81.Amd64.Open From 4b5a7c2b8db9bf908a4240ba84cbb1ee9ac3885f Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Sat, 20 Feb 2021 13:45:01 -0800 Subject: [PATCH 83/90] Remove net5.0 install --- eng/helix/content/runtests.ps1 | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/eng/helix/content/runtests.ps1 b/eng/helix/content/runtests.ps1 index 29d0dc710461..2c0cb0b3a01b 100644 --- a/eng/helix/content/runtests.ps1 +++ b/eng/helix/content/runtests.ps1 @@ -80,20 +80,6 @@ if ([string]::IsNullOrEmpty($FeedCred)) { InstallDotnetSDKAndRuntime "https://dotnetclimsrc.blob.core.windows.net/dotnet" $FeedCred } -if ($InstallPlaywright -eq "true") { - foreach ($i in 1..5) { - $success = InvokeInstallDotnet ". eng\common\tools.ps1; InstallDotNet $env:DOTNET_ROOT 5.0.103 $Arch `'`' `$true `'`' `'`' `$true" - - if (!$success) { - Write-Host "Retrying..." - } - else - { - break - } - } -} - Write-Host "Restore: dotnet restore RunTests\RunTests.csproj --ignore-failed-sources /p:InstallPlaywright=$InstallPlaywright" dotnet restore RunTests\RunTests.csproj --ignore-failed-sources /p:InstallPlaywright=$InstallPlaywright From 4820f8f66346538c5efc14efd5f8d147bece78bd Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Sat, 20 Feb 2021 13:45:43 -0800 Subject: [PATCH 84/90] Update BlazorWasmTemplateTest.cs --- .../BlazorTemplates.Tests/BlazorWasmTemplateTest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs index 93ef6294c9c4..fc1238089390 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs @@ -663,6 +663,7 @@ private void UpdatePublishedSettings(Project serverProject) else { command = "dotnet-serve"; + args = "--roll-forward LatestMajor " + args; // dotnet-server targets net5.0 by default } var serveProcess = ProcessEx.Run(Output, publishDir, command, args); From c9c1c87e8d2c545dba6863f6bfa36877232d7498 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Sat, 20 Feb 2021 13:46:04 -0800 Subject: [PATCH 85/90] Update BlazorWasmTemplateTest.cs --- .../BlazorTemplates.Tests/BlazorWasmTemplateTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs index fc1238089390..d917e71ca32a 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs @@ -663,7 +663,7 @@ private void UpdatePublishedSettings(Project serverProject) else { command = "dotnet-serve"; - args = "--roll-forward LatestMajor " + args; // dotnet-server targets net5.0 by default + args = "--roll-forward LatestMajor " + args; // dotnet-serve targets net5.0 by default } var serveProcess = ProcessEx.Run(Output, publishDir, command, args); From 2f921b18b0d3007dd9171ae5a6bb16c1711698f4 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Sat, 20 Feb 2021 17:57:09 -0800 Subject: [PATCH 86/90] Update TestRunner.cs --- eng/helix/content/RunTests/TestRunner.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/helix/content/RunTests/TestRunner.cs b/eng/helix/content/RunTests/TestRunner.cs index 763244a72721..9214c9b9070b 100644 --- a/eng/helix/content/RunTests/TestRunner.cs +++ b/eng/helix/content/RunTests/TestRunner.cs @@ -162,6 +162,7 @@ await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet", throwOnError: false, cancellationToken: new CancellationTokenSource(TimeSpan.FromMinutes(2)).Token); +#if INSTALLPLAYWRIGHT await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet", $"tool install dotnet-serve --tool-path {Options.HELIX_WORKITEM_ROOT}", environmentVariables: EnvironmentVariables, @@ -169,6 +170,7 @@ await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet", errorDataReceived: Console.Error.WriteLine, throwOnError: false, cancellationToken: new CancellationTokenSource(TimeSpan.FromMinutes(2)).Token); +#endif // ';' is the path separator on Windows, and ':' on Unix Options.Path += OperatingSystem.IsWindows() ? ";" : ":"; From d804ff29fb7f552fb3234d94a691463096c8cf8b Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Sat, 20 Feb 2021 20:53:24 -0800 Subject: [PATCH 87/90] Update TestRunner.cs --- eng/helix/content/RunTests/TestRunner.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eng/helix/content/RunTests/TestRunner.cs b/eng/helix/content/RunTests/TestRunner.cs index 9214c9b9070b..2a48452d7356 100644 --- a/eng/helix/content/RunTests/TestRunner.cs +++ b/eng/helix/content/RunTests/TestRunner.cs @@ -95,6 +95,7 @@ public async Task InstallPlaywrightAsync() { try { + Console.WriteLine($"Installing Playwright to {EnvironmentVariables["PLAYWRIGHT_BROWSERS_PATH"]}"); await Playwright.InstallAsync(EnvironmentVariables["PLAYWRIGHT_BROWSERS_PATH"]); return true; } @@ -162,7 +163,6 @@ await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet", throwOnError: false, cancellationToken: new CancellationTokenSource(TimeSpan.FromMinutes(2)).Token); -#if INSTALLPLAYWRIGHT await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet", $"tool install dotnet-serve --tool-path {Options.HELIX_WORKITEM_ROOT}", environmentVariables: EnvironmentVariables, @@ -170,7 +170,6 @@ await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet", errorDataReceived: Console.Error.WriteLine, throwOnError: false, cancellationToken: new CancellationTokenSource(TimeSpan.FromMinutes(2)).Token); -#endif // ';' is the path separator on Windows, and ':' on Unix Options.Path += OperatingSystem.IsWindows() ? ";" : ":"; From 30cf20882a9b95a087d82f2f31633287ee904215 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 23 Feb 2021 14:04:14 -0800 Subject: [PATCH 88/90] Record har's directly to helix upload directory --- src/Shared/BrowserTesting/src/ContextInformation.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Shared/BrowserTesting/src/ContextInformation.cs b/src/Shared/BrowserTesting/src/ContextInformation.cs index 07cadc4bf0f5..38efc67ef298 100644 --- a/src/Shared/BrowserTesting/src/ContextInformation.cs +++ b/src/Shared/BrowserTesting/src/ContextInformation.cs @@ -55,7 +55,13 @@ internal BrowserContextOptions ConfigureUniqueHarPath(BrowserContextOptions brow if (browserContextOptions?.RecordHar?.Path != null) { var identifier = Guid.NewGuid().ToString("N"); - browserContextOptions.RecordHar.Path = Path.Combine(browserContextOptions.RecordHar.Path, $"{identifier}.har"); + var harDirectory = Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT"); + if (string.IsNullOrEmpty(harDirectory)) + { + harDirectory = browserContextOptions.RecordHar.Path; + } + + browserContextOptions.RecordHar.Path = Path.Combine(harDirectory, $"{identifier}.har"); _harPath = browserContextOptions.RecordHar.Path; } From de864380d111d04c42ceeefa350a6b9fbe495bba Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 23 Feb 2021 14:12:26 -0800 Subject: [PATCH 89/90] Update video path to helix upload dir --- src/Shared/BrowserTesting/src/ContextInformation.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Shared/BrowserTesting/src/ContextInformation.cs b/src/Shared/BrowserTesting/src/ContextInformation.cs index 38efc67ef298..7aec84d972de 100644 --- a/src/Shared/BrowserTesting/src/ContextInformation.cs +++ b/src/Shared/BrowserTesting/src/ContextInformation.cs @@ -65,6 +65,15 @@ internal BrowserContextOptions ConfigureUniqueHarPath(BrowserContextOptions brow _harPath = browserContextOptions.RecordHar.Path; } + if (browserContextOptions?.RecordVideo?.Dir != null) + { + var uploadDir = Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT"); + if (!string.IsNullOrEmpty(uploadDir)) + { + browserContextOptions.RecordVideo.Dir = uploadDir; + } + } + return browserContextOptions; } } From 422af5e7477f440df5a6a596b2bdb64754c8ffbc Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 25 Feb 2021 09:15:44 -0800 Subject: [PATCH 90/90] Fail to look at artifacts --- .../BlazorTemplates.Tests/BlazorWasmTemplateTest.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs index d917e71ca32a..abad1b3c4b4e 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs @@ -79,6 +79,8 @@ public async Task BlazorWasmStandaloneTemplate_Works(BrowserKind browserKind) EnsureBrowserAvailable(browserKind); } } + + Assert.True(0 == 1, "Fail to get logs"); } private async Task NavigateToPage(IBrowserContext browser, string listeningUri)