From 7acb62c68dfe9ae16b634b66313e76ce2fa49712 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 17 Mar 2021 21:38:40 -0700 Subject: [PATCH 01/19] Update AspNetProcess.cs --- src/ProjectTemplates/Shared/AspNetProcess.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ProjectTemplates/Shared/AspNetProcess.cs b/src/ProjectTemplates/Shared/AspNetProcess.cs index 5187af7fff19..40b774f3524f 100644 --- a/src/ProjectTemplates/Shared/AspNetProcess.cs +++ b/src/ProjectTemplates/Shared/AspNetProcess.cs @@ -42,9 +42,10 @@ public AspNetProcess( bool published, bool hasListeningUri = true, bool usePublishedAppHost = false, - ILogger logger = null) + ILogger logger = null, + DevelopmentCertificate cert = null) { - _developmentCertificate = DevelopmentCertificate.Create(workingDirectory); + _developmentCertificate = cert ?? DevelopmentCertificate.Create(workingDirectory); _output = output; _httpClient = new HttpClient(new HttpClientHandler() From 359fc665af41ca502f9ddc1f20aa188401acf92e Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 17 Mar 2021 21:39:59 -0700 Subject: [PATCH 02/19] Update Project.cs --- src/ProjectTemplates/Shared/Project.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ProjectTemplates/Shared/Project.cs b/src/ProjectTemplates/Shared/Project.cs index bf2d1082587b..0ad6d97a7cf3 100644 --- a/src/ProjectTemplates/Shared/Project.cs +++ b/src/ProjectTemplates/Shared/Project.cs @@ -40,6 +40,7 @@ public class Project : IDisposable public string TemplateOutputDir { get; set; } public string TargetFramework { get; set; } = GetAssemblyMetadata("Test.DefaultTargetFramework"); public string RuntimeIdentifier { get; set; } = string.Empty; + public DevelopmentCertificate DevCert { get; set; } public string TemplateBuildDir => Path.Combine(TemplateOutputDir, "bin", "Debug", TargetFramework, RuntimeIdentifier); public string TemplatePublishDir => Path.Combine(TemplateOutputDir, "bin", "Release", TargetFramework, RuntimeIdentifier, "publish"); @@ -178,7 +179,7 @@ internal AspNetProcess StartBuiltProjectAsync(bool hasListeningUri = true, ILogg } var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll"); - return new AspNetProcess(Output, TemplateOutputDir, projectDll, environment, published: false, hasListeningUri: hasListeningUri, logger: logger); + return new AspNetProcess(Output, TemplateOutputDir, projectDll, environment, published: false, hasListeningUri: hasListeningUri, logger: logger, cert: DevCert); } internal AspNetProcess StartPublishedProjectAsync(bool hasListeningUri = true, bool usePublishedAppHost = false) @@ -193,7 +194,7 @@ internal AspNetProcess StartPublishedProjectAsync(bool hasListeningUri = true, b }; var projectDll = Path.Combine(TemplatePublishDir, $"{ProjectName}.dll"); - return new AspNetProcess(Output, TemplatePublishDir, projectDll, environment, published: true, hasListeningUri: hasListeningUri, usePublishedAppHost: usePublishedAppHost); + return new AspNetProcess(Output, TemplatePublishDir, projectDll, environment, published: true, hasListeningUri: hasListeningUri, usePublishedAppHost: usePublishedAppHost, cert: DevCert); } internal async Task RunDotNetEfCreateMigrationAsync(string migrationName) From 63adce14df6ef45b1645a65eccf083d10de3ed66 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 17 Mar 2021 21:41:13 -0700 Subject: [PATCH 03/19] Create dev cert on project creation instead of in AspNetProcess --- src/ProjectTemplates/Shared/ProjectFactoryFixture.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs b/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs index 2f25714fd64b..478dc3f3aa59 100644 --- a/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs +++ b/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs @@ -41,6 +41,9 @@ public async Task GetOrCreateProject(string projectKey, ITestOutputHelp var assemblyPath = GetType().Assembly; var basePath = GetTemplateFolderBasePath(assemblyPath); project.TemplateOutputDir = Path.Combine(basePath, project.ProjectName); + + project.DevCert = DevelopmentCertificate.Create(project.TemplateOutputDir); + return project; }, output); From 83ead3beb11f175392e7fc948b0feb98aad42f36 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 17 Mar 2021 21:42:53 -0700 Subject: [PATCH 04/19] Update BlazorServerTemplateTest.cs --- .../BlazorTemplates.Tests/BlazorServerTemplateTest.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs index 24fe3fa75aa6..7c8e71f474d4 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs @@ -35,7 +35,7 @@ public BlazorServerTemplateTest(ProjectFactoryFixture projectFactory, Playwright [Theory] [InlineData(BrowserKind.Chromium)] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30761")] + //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30761")] public async Task BlazorServerTemplateWorks_NoAuth(BrowserKind browserKind) { // Additional arguments are needed. See: https://github.com/dotnet/aspnetcore/issues/24278 @@ -107,8 +107,8 @@ await Fixture.BrowserManager.GetBrowserInstance(browserKind, BrowserContextInfo) [Theory] [MemberData(nameof(BlazorServerTemplateWorks_IndividualAuthData))] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30807")] - [SkipOnHelix("https://github.com/dotnet/aspnetcore/issues/30825", Queues = "All.OSX")] + //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30807")] + //[SkipOnHelix("https://github.com/dotnet/aspnetcore/issues/30825", Queues = "All.OSX")] public async Task BlazorServerTemplateWorks_IndividualAuth(BrowserKind browserKind, bool useLocalDB) { // Additional arguments are needed. See: https://github.com/dotnet/aspnetcore/issues/24278 @@ -217,7 +217,7 @@ private async Task TestBasicNavigation(IPage page) [InlineData("SingleOrg", null)] [InlineData("SingleOrg", new string[] { "--called-api-url \"https://graph.microsoft.com\"", "--called-api-scopes user.readwrite" })] [InlineData("SingleOrg", new string[] { "--calls-graph" })] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] + //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] public async Task BlazorServerTemplat_IdentityWeb_BuildAndPublish(string auth, string[] args) { Project = await ProjectFactory.GetOrCreateProject("blazorserveridweb" + Guid.NewGuid().ToString().Substring(0, 10).ToLowerInvariant(), Output); From ffe22d76dc4effe24320a1532d25b2cbdea10ec4 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 17 Mar 2021 21:43:57 -0700 Subject: [PATCH 05/19] Update BlazorWasmTemplateTest.cs --- .../BlazorWasmTemplateTest.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs index 9d2252ce079a..4893e9b7bbad 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs @@ -42,7 +42,7 @@ public BlazorWasmTemplateTest(ProjectFactoryFixture projectFactory, PlaywrightFi [Theory] [InlineData(BrowserKind.Chromium)] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] + //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] public async Task BlazorWasmStandaloneTemplate_Works(BrowserKind browserKind) { // Additional arguments are needed. See: https://github.com/dotnet/aspnetcore/issues/24278 @@ -91,7 +91,7 @@ private async Task NavigateToPage(IBrowserContext browser, string listeni [Theory] [InlineData(BrowserKind.Chromium)] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] + //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] public async Task BlazorWasmHostedTemplate_Works(BrowserKind browserKind) { // Additional arguments are needed. See: https://github.com/dotnet/aspnetcore/issues/24278 @@ -151,7 +151,7 @@ private static async Task AssertCompressionFormat(AspNetProcess aspNetProcess, s [Theory] [InlineData(BrowserKind.Chromium)] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] + //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] public async Task BlazorWasmStandalonePwaTemplate_Works(BrowserKind browserKind) { // Additional arguments are needed. See: https://github.com/dotnet/aspnetcore/issues/24278 @@ -199,7 +199,7 @@ public async Task BlazorWasmStandalonePwaTemplate_Works(BrowserKind browserKind) [Theory] [InlineData(BrowserKind.Chromium)] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] + //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] public async Task BlazorWasmHostedPwaTemplate_Works(BrowserKind browserKind) { // Additional arguments are needed. See: https://github.com/dotnet/aspnetcore/issues/24278 @@ -284,7 +284,7 @@ private void ValidatePublishedServiceWorker(Project project) [InlineData(BrowserKind.Chromium)] // LocalDB doesn't work on non Windows platforms [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30700")] + //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30700")] public Task BlazorWasmHostedTemplate_IndividualAuth_Works_WithLocalDB(BrowserKind browserKind) { return BlazorWasmHostedTemplate_IndividualAuth_Works(browserKind, true); @@ -292,8 +292,8 @@ public Task BlazorWasmHostedTemplate_IndividualAuth_Works_WithLocalDB(BrowserKin [Theory] [InlineData(BrowserKind.Chromium)] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30820")] - [SkipOnHelix("https://github.com/dotnet/aspnetcore/issues/30825", Queues = "All.OSX")] + //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30820")] + //[SkipOnHelix("https://github.com/dotnet/aspnetcore/issues/30825", Queues = "All.OSX")] public Task BlazorWasmHostedTemplate_IndividualAuth_Works_WithOutLocalDB(BrowserKind browserKind) { return BlazorWasmHostedTemplate_IndividualAuth_Works(browserKind, false); @@ -488,7 +488,7 @@ public TemplateInstance(string name, params string[] arguments) [Theory] [MemberData(nameof(TemplateData))] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30880")] + //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30880")] public async Task BlazorWasmHostedTemplate_AzureActiveDirectoryTemplate_Works(TemplateInstance instance) { var project = await ProjectFactory.GetOrCreateProject(instance.Name, Output); From f5bbfbe06960ea57e08e24919be2161aa9b486b2 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 17 Mar 2021 22:43:05 -0700 Subject: [PATCH 06/19] Update DevelopmentCertificate.cs --- src/ProjectTemplates/Shared/DevelopmentCertificate.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProjectTemplates/Shared/DevelopmentCertificate.cs b/src/ProjectTemplates/Shared/DevelopmentCertificate.cs index cc814808e0fe..b01252b86a12 100644 --- a/src/ProjectTemplates/Shared/DevelopmentCertificate.cs +++ b/src/ProjectTemplates/Shared/DevelopmentCertificate.cs @@ -7,7 +7,7 @@ namespace Templates.Test.Helpers { - public readonly struct DevelopmentCertificate + public class DevelopmentCertificate { public DevelopmentCertificate(string certificatePath, string certificatePassword, string certificateThumbprint) { From b5f9fd45e76e136b35a410bddf1ae5dfabdbea3f Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 18 Mar 2021 00:44:50 -0700 Subject: [PATCH 07/19] Update DevelopmentCertificate.cs --- src/ProjectTemplates/Shared/DevelopmentCertificate.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ProjectTemplates/Shared/DevelopmentCertificate.cs b/src/ProjectTemplates/Shared/DevelopmentCertificate.cs index b01252b86a12..2461267d7ff2 100644 --- a/src/ProjectTemplates/Shared/DevelopmentCertificate.cs +++ b/src/ProjectTemplates/Shared/DevelopmentCertificate.cs @@ -16,9 +16,9 @@ public DevelopmentCertificate(string certificatePath, string certificatePassword CertificateThumbprint = certificateThumbprint; } - public readonly string CertificatePath { get; } - public readonly string CertificatePassword { get; } - public readonly string CertificateThumbprint { get; } + public string CertificatePath { get; } + public string CertificatePassword { get; } + public string CertificateThumbprint { get; } public static DevelopmentCertificate Create(string workingDirectory) { From a8e2b1ab649f8576dbdb36c6c3b9a11d6cbb1fc2 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 18 Mar 2021 10:05:55 -0700 Subject: [PATCH 08/19] Create the dev cert once in the project fixture --- src/ProjectTemplates/Shared/ProjectFactoryFixture.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs b/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs index 478dc3f3aa59..e01491de456d 100644 --- a/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs +++ b/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs @@ -15,6 +15,7 @@ namespace Templates.Test.Helpers public class ProjectFactoryFixture : IDisposable { private readonly ConcurrentDictionary _projects = new ConcurrentDictionary(); + private DevelopmentCertificate _cert = DevelopmentCertificate.Create(AppDomain.BaseDirectory); public IMessageSink DiagnosticsMessageSink { get; } @@ -41,9 +42,7 @@ public async Task GetOrCreateProject(string projectKey, ITestOutputHelp var assemblyPath = GetType().Assembly; var basePath = GetTemplateFolderBasePath(assemblyPath); project.TemplateOutputDir = Path.Combine(basePath, project.ProjectName); - - project.DevCert = DevelopmentCertificate.Create(project.TemplateOutputDir); - + project.DevCert = _cert; return project; }, output); From ad79fd12fe045555edbcd3880903b478a2794dbe Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 18 Mar 2021 11:37:35 -0700 Subject: [PATCH 09/19] Update ProjectFactoryFixture.cs --- src/ProjectTemplates/Shared/ProjectFactoryFixture.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs b/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs index e01491de456d..2d3dd106304e 100644 --- a/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs +++ b/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs @@ -15,7 +15,7 @@ namespace Templates.Test.Helpers public class ProjectFactoryFixture : IDisposable { private readonly ConcurrentDictionary _projects = new ConcurrentDictionary(); - private DevelopmentCertificate _cert = DevelopmentCertificate.Create(AppDomain.BaseDirectory); + private DevelopmentCertificate _cert = DevelopmentCertificate.Create(AppContext.BaseDirectory); public IMessageSink DiagnosticsMessageSink { get; } From b6187b5561f8d38c84bbbfcc4625b7e2ac51f51b Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 18 Mar 2021 15:05:01 -0700 Subject: [PATCH 10/19] Update AspNetProcess.cs --- src/ProjectTemplates/Shared/AspNetProcess.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProjectTemplates/Shared/AspNetProcess.cs b/src/ProjectTemplates/Shared/AspNetProcess.cs index 40b774f3524f..1cb208b1e95e 100644 --- a/src/ProjectTemplates/Shared/AspNetProcess.cs +++ b/src/ProjectTemplates/Shared/AspNetProcess.cs @@ -45,7 +45,7 @@ public AspNetProcess( ILogger logger = null, DevelopmentCertificate cert = null) { - _developmentCertificate = cert ?? DevelopmentCertificate.Create(workingDirectory); + _developmentCertificate = cert ?? throw new ArgumentNullException(nameof(cert)); //DevelopmentCertificate.Create(workingDirectory); _output = output; _httpClient = new HttpClient(new HttpClientHandler() From 1aa5487f1940b2be9f9d14c7463c5ae7c611b487 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 18 Mar 2021 16:48:15 -0700 Subject: [PATCH 11/19] Update ProjectFactoryFixture.cs --- src/ProjectTemplates/Shared/ProjectFactoryFixture.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs b/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs index 2d3dd106304e..2f25714fd64b 100644 --- a/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs +++ b/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs @@ -15,7 +15,6 @@ namespace Templates.Test.Helpers public class ProjectFactoryFixture : IDisposable { private readonly ConcurrentDictionary _projects = new ConcurrentDictionary(); - private DevelopmentCertificate _cert = DevelopmentCertificate.Create(AppContext.BaseDirectory); public IMessageSink DiagnosticsMessageSink { get; } @@ -42,7 +41,6 @@ public async Task GetOrCreateProject(string projectKey, ITestOutputHelp var assemblyPath = GetType().Assembly; var basePath = GetTemplateFolderBasePath(assemblyPath); project.TemplateOutputDir = Path.Combine(basePath, project.ProjectName); - project.DevCert = _cert; return project; }, output); From 31ec81e1ffd86ef029337b2c2f8f84fad8352dba Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 18 Mar 2021 16:49:11 -0700 Subject: [PATCH 12/19] Update Project.cs --- src/ProjectTemplates/Shared/Project.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProjectTemplates/Shared/Project.cs b/src/ProjectTemplates/Shared/Project.cs index 0ad6d97a7cf3..4d5caba7740b 100644 --- a/src/ProjectTemplates/Shared/Project.cs +++ b/src/ProjectTemplates/Shared/Project.cs @@ -40,7 +40,7 @@ public class Project : IDisposable public string TemplateOutputDir { get; set; } public string TargetFramework { get; set; } = GetAssemblyMetadata("Test.DefaultTargetFramework"); public string RuntimeIdentifier { get; set; } = string.Empty; - public DevelopmentCertificate DevCert { get; set; } + public static DevelopmentCertificate DevCert { get; } = DevelopmentCertificate.Create(AppContext.BaseDirectory); public string TemplateBuildDir => Path.Combine(TemplateOutputDir, "bin", "Debug", TargetFramework, RuntimeIdentifier); public string TemplatePublishDir => Path.Combine(TemplateOutputDir, "bin", "Release", TargetFramework, RuntimeIdentifier, "publish"); From 07dbac08653ffb686ca88b5633e30ef1da87ba76 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 18 Mar 2021 18:26:19 -0700 Subject: [PATCH 13/19] Update DevelopmentCertificate.cs --- src/ProjectTemplates/Shared/DevelopmentCertificate.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ProjectTemplates/Shared/DevelopmentCertificate.cs b/src/ProjectTemplates/Shared/DevelopmentCertificate.cs index 2461267d7ff2..cc814808e0fe 100644 --- a/src/ProjectTemplates/Shared/DevelopmentCertificate.cs +++ b/src/ProjectTemplates/Shared/DevelopmentCertificate.cs @@ -7,7 +7,7 @@ namespace Templates.Test.Helpers { - public class DevelopmentCertificate + public readonly struct DevelopmentCertificate { public DevelopmentCertificate(string certificatePath, string certificatePassword, string certificateThumbprint) { @@ -16,9 +16,9 @@ public DevelopmentCertificate(string certificatePath, string certificatePassword CertificateThumbprint = certificateThumbprint; } - public string CertificatePath { get; } - public string CertificatePassword { get; } - public string CertificateThumbprint { get; } + public readonly string CertificatePath { get; } + public readonly string CertificatePassword { get; } + public readonly string CertificateThumbprint { get; } public static DevelopmentCertificate Create(string workingDirectory) { From feb1a8c2f80c596017bd599f5aa4fb4d209caab4 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 18 Mar 2021 18:26:59 -0700 Subject: [PATCH 14/19] Update AspNetProcess.cs --- src/ProjectTemplates/Shared/AspNetProcess.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ProjectTemplates/Shared/AspNetProcess.cs b/src/ProjectTemplates/Shared/AspNetProcess.cs index 1cb208b1e95e..e18e1816c526 100644 --- a/src/ProjectTemplates/Shared/AspNetProcess.cs +++ b/src/ProjectTemplates/Shared/AspNetProcess.cs @@ -35,6 +35,7 @@ public class AspNetProcess : IDisposable internal ProcessEx Process { get; } public AspNetProcess( + DevelopmentCertificate cert, ITestOutputHelper output, string workingDirectory, string dllPath, @@ -42,10 +43,9 @@ public AspNetProcess( bool published, bool hasListeningUri = true, bool usePublishedAppHost = false, - ILogger logger = null, - DevelopmentCertificate cert = null) + ILogger logger = null) { - _developmentCertificate = cert ?? throw new ArgumentNullException(nameof(cert)); //DevelopmentCertificate.Create(workingDirectory); + _developmentCertificate = cert ?? throw new ArgumentNullException(nameof(cert)); _output = output; _httpClient = new HttpClient(new HttpClientHandler() From ad9782ec665e4b4dcf6a3effc8df8fa659d3fc3c Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 18 Mar 2021 18:27:42 -0700 Subject: [PATCH 15/19] Update Project.cs --- src/ProjectTemplates/Shared/Project.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ProjectTemplates/Shared/Project.cs b/src/ProjectTemplates/Shared/Project.cs index 4d5caba7740b..32910329d056 100644 --- a/src/ProjectTemplates/Shared/Project.cs +++ b/src/ProjectTemplates/Shared/Project.cs @@ -179,7 +179,7 @@ internal AspNetProcess StartBuiltProjectAsync(bool hasListeningUri = true, ILogg } var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll"); - return new AspNetProcess(Output, TemplateOutputDir, projectDll, environment, published: false, hasListeningUri: hasListeningUri, logger: logger, cert: DevCert); + return new AspNetProcess(DevCert, Output, TemplateOutputDir, projectDll, environment, published: false, hasListeningUri: hasListeningUri, logger: logger); } internal AspNetProcess StartPublishedProjectAsync(bool hasListeningUri = true, bool usePublishedAppHost = false) @@ -194,7 +194,7 @@ internal AspNetProcess StartPublishedProjectAsync(bool hasListeningUri = true, b }; var projectDll = Path.Combine(TemplatePublishDir, $"{ProjectName}.dll"); - return new AspNetProcess(Output, TemplatePublishDir, projectDll, environment, published: true, hasListeningUri: hasListeningUri, usePublishedAppHost: usePublishedAppHost, cert: DevCert); + return new AspNetProcess(DevCert, Output, TemplatePublishDir, projectDll, environment, published: true, hasListeningUri: hasListeningUri, usePublishedAppHost: usePublishedAppHost); } internal async Task RunDotNetEfCreateMigrationAsync(string migrationName) From cd314ee9ca2589768eddb4bdd66f4f41c67acd83 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 18 Mar 2021 20:50:37 -0700 Subject: [PATCH 16/19] Update AspNetProcess.cs --- src/ProjectTemplates/Shared/AspNetProcess.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ProjectTemplates/Shared/AspNetProcess.cs b/src/ProjectTemplates/Shared/AspNetProcess.cs index e18e1816c526..ad8fc892215b 100644 --- a/src/ProjectTemplates/Shared/AspNetProcess.cs +++ b/src/ProjectTemplates/Shared/AspNetProcess.cs @@ -45,8 +45,7 @@ public AspNetProcess( bool usePublishedAppHost = false, ILogger logger = null) { - _developmentCertificate = cert ?? throw new ArgumentNullException(nameof(cert)); - + _developmentCertificate = cert; _output = output; _httpClient = new HttpClient(new HttpClientHandler() { From 04919ec87c2cbbdc6267c84bfc053015df70f0ec Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 18 Mar 2021 23:38:45 -0700 Subject: [PATCH 17/19] Update BlazorServerTemplateTest.cs --- .../BlazorTemplates.Tests/BlazorServerTemplateTest.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs index 7c8e71f474d4..24fe3fa75aa6 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorServerTemplateTest.cs @@ -35,7 +35,7 @@ public BlazorServerTemplateTest(ProjectFactoryFixture projectFactory, Playwright [Theory] [InlineData(BrowserKind.Chromium)] - //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30761")] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30761")] public async Task BlazorServerTemplateWorks_NoAuth(BrowserKind browserKind) { // Additional arguments are needed. See: https://github.com/dotnet/aspnetcore/issues/24278 @@ -107,8 +107,8 @@ await Fixture.BrowserManager.GetBrowserInstance(browserKind, BrowserContextInfo) [Theory] [MemberData(nameof(BlazorServerTemplateWorks_IndividualAuthData))] - //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30807")] - //[SkipOnHelix("https://github.com/dotnet/aspnetcore/issues/30825", Queues = "All.OSX")] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30807")] + [SkipOnHelix("https://github.com/dotnet/aspnetcore/issues/30825", Queues = "All.OSX")] public async Task BlazorServerTemplateWorks_IndividualAuth(BrowserKind browserKind, bool useLocalDB) { // Additional arguments are needed. See: https://github.com/dotnet/aspnetcore/issues/24278 @@ -217,7 +217,7 @@ private async Task TestBasicNavigation(IPage page) [InlineData("SingleOrg", null)] [InlineData("SingleOrg", new string[] { "--called-api-url \"https://graph.microsoft.com\"", "--called-api-scopes user.readwrite" })] [InlineData("SingleOrg", new string[] { "--calls-graph" })] - //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] public async Task BlazorServerTemplat_IdentityWeb_BuildAndPublish(string auth, string[] args) { Project = await ProjectFactory.GetOrCreateProject("blazorserveridweb" + Guid.NewGuid().ToString().Substring(0, 10).ToLowerInvariant(), Output); From b64c83dcce6857cd888aad4187904fe21d18dd1a Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 18 Mar 2021 23:39:45 -0700 Subject: [PATCH 18/19] Update BlazorWasmTemplateTest.cs --- .../BlazorWasmTemplateTest.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs index 4893e9b7bbad..423359dc4998 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs @@ -42,7 +42,7 @@ public BlazorWasmTemplateTest(ProjectFactoryFixture projectFactory, PlaywrightFi [Theory] [InlineData(BrowserKind.Chromium)] - //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] public async Task BlazorWasmStandaloneTemplate_Works(BrowserKind browserKind) { // Additional arguments are needed. See: https://github.com/dotnet/aspnetcore/issues/24278 @@ -91,7 +91,7 @@ private async Task NavigateToPage(IBrowserContext browser, string listeni [Theory] [InlineData(BrowserKind.Chromium)] - //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] public async Task BlazorWasmHostedTemplate_Works(BrowserKind browserKind) { // Additional arguments are needed. See: https://github.com/dotnet/aspnetcore/issues/24278 @@ -151,7 +151,7 @@ private static async Task AssertCompressionFormat(AspNetProcess aspNetProcess, s [Theory] [InlineData(BrowserKind.Chromium)] - //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] public async Task BlazorWasmStandalonePwaTemplate_Works(BrowserKind browserKind) { // Additional arguments are needed. See: https://github.com/dotnet/aspnetcore/issues/24278 @@ -199,7 +199,7 @@ public async Task BlazorWasmStandalonePwaTemplate_Works(BrowserKind browserKind) [Theory] [InlineData(BrowserKind.Chromium)] - //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30882")] public async Task BlazorWasmHostedPwaTemplate_Works(BrowserKind browserKind) { // Additional arguments are needed. See: https://github.com/dotnet/aspnetcore/issues/24278 @@ -292,8 +292,8 @@ public Task BlazorWasmHostedTemplate_IndividualAuth_Works_WithLocalDB(BrowserKin [Theory] [InlineData(BrowserKind.Chromium)] - //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30820")] - //[SkipOnHelix("https://github.com/dotnet/aspnetcore/issues/30825", Queues = "All.OSX")] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30820")] + [SkipOnHelix("https://github.com/dotnet/aspnetcore/issues/30825", Queues = "All.OSX")] public Task BlazorWasmHostedTemplate_IndividualAuth_Works_WithOutLocalDB(BrowserKind browserKind) { return BlazorWasmHostedTemplate_IndividualAuth_Works(browserKind, false); @@ -488,7 +488,7 @@ public TemplateInstance(string name, params string[] arguments) [Theory] [MemberData(nameof(TemplateData))] - //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30880")] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30880")] public async Task BlazorWasmHostedTemplate_AzureActiveDirectoryTemplate_Works(TemplateInstance instance) { var project = await ProjectFactory.GetOrCreateProject(instance.Name, Output); From 7fb50a1c234f6e80c01e1294b834c5b7202f0c08 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 18 Mar 2021 23:40:13 -0700 Subject: [PATCH 19/19] 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 423359dc4998..9d2252ce079a 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs @@ -284,7 +284,7 @@ private void ValidatePublishedServiceWorker(Project project) [InlineData(BrowserKind.Chromium)] // LocalDB doesn't work on non Windows platforms [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] - //[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30700")] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/30700")] public Task BlazorWasmHostedTemplate_IndividualAuth_Works_WithLocalDB(BrowserKind browserKind) { return BlazorWasmHostedTemplate_IndividualAuth_Works(browserKind, true);