From 71e388eab781698fa8e4e8afa5f3df464788f4c1 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 30 Jun 2020 14:58:54 -0700 Subject: [PATCH] Unquaratine blazor template tests (#23521) * Ensure BlazorWebAssembly.js is present * Unquaratine blazor template tests * The failure issue https://github.com/dotnet/aspnetcore/issues/20479 was resolved, but the assembly level quarantine was missed being removed. * Use shorter project file names to avoid long path issues. * Update blazorwasm template tests to react to net5 updates * Update src/ProjectTemplates/Shared/ProjectFactoryFixture.cs --- .../Microsoft.AspNetCore.Components.WebAssembly.props | 5 +++++ .../AssemblyInfo.AssemblyFixtures.cs | 2 -- .../BlazorTemplates.Tests/BlazorTemplates.Tests.csproj | 1 + .../BlazorTemplates.Tests/BlazorWasmTemplateTest.cs | 2 +- src/ProjectTemplates/Shared/ProjectFactoryFixture.cs | 2 +- .../Microsoft.NET.Sdk.Razor.Components.Wasm.targets | 9 ++++++++- 6 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 src/Components/WebAssembly/WebAssembly/src/build/net5.0/Microsoft.AspNetCore.Components.WebAssembly.props diff --git a/src/Components/WebAssembly/WebAssembly/src/build/net5.0/Microsoft.AspNetCore.Components.WebAssembly.props b/src/Components/WebAssembly/WebAssembly/src/build/net5.0/Microsoft.AspNetCore.Components.WebAssembly.props new file mode 100644 index 0000000000..41ae67bf35 --- /dev/null +++ b/src/Components/WebAssembly/WebAssembly/src/build/net5.0/Microsoft.AspNetCore.Components.WebAssembly.props @@ -0,0 +1,5 @@ + + + $(MSBuildThisFileDirectory)blazor.webassembly.js + + diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/AssemblyInfo.AssemblyFixtures.cs b/src/ProjectTemplates/BlazorTemplates.Tests/AssemblyInfo.AssemblyFixtures.cs index 5250fed054..57f163b513 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/AssemblyInfo.AssemblyFixtures.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/AssemblyInfo.AssemblyFixtures.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.E2ETesting; -using Microsoft.AspNetCore.Testing; using Templates.Test.Helpers; using Xunit; @@ -11,4 +10,3 @@ using Xunit; [assembly: Microsoft.AspNetCore.E2ETesting.AssemblyFixture(typeof(ProjectFactoryFixture))] [assembly: Microsoft.AspNetCore.E2ETesting.AssemblyFixture(typeof(SeleniumStandaloneServer))] -[assembly: QuarantinedTest("Investigation pending in https://github.com/dotnet/aspnetcore/issues/20479")] diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj index d9d6b2dda8..77e0ab1128 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj @@ -9,6 +9,7 @@ $(DefineConstants);XPLAT true + true false true diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs index ffa5da4de1..a63c8c4dfd 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs @@ -333,7 +333,7 @@ namespace Templates.Test public async Task BlazorWasmStandaloneTemplate_IndividualAuth_Works() { var project = await ProjectFactory.GetOrCreateProject("blazorstandaloneindividual", Output); - project.TargetFramework = "netstandard2.1"; + project.RuntimeIdentifier = "browser-wasm"; var createResult = await project.RunDotNetNewAsync("blazorwasm", args: new[] { "-au", diff --git a/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs b/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs index 41279ca0aa..d268ce8742 100644 --- a/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs +++ b/src/ProjectTemplates/Shared/ProjectFactoryFixture.cs @@ -44,7 +44,7 @@ namespace Templates.Test.Helpers DiagnosticsMessageSink = DiagnosticsMessageSink, ProjectGuid = Path.GetRandomFileName().Replace(".", string.Empty) }; - project.ProjectName = $"AspNet.{key}.{project.ProjectGuid}"; + project.ProjectName = $"AspNet.{project.ProjectGuid}"; var assemblyPath = GetType().Assembly; var basePath = GetTemplateFolderBasePath(assemblyPath); diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.Components.Wasm.targets b/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.Components.Wasm.targets index fff9969bcb..1d293e3ef4 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.Components.Wasm.targets +++ b/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.Components.Wasm.targets @@ -92,6 +92,7 @@ Copyright (c) .NET Foundation. All rights reserved. + <_BlazorJSFile Include="$(BlazorWebAssemblyJSPath)" /> <_BlazorJSFile Include="$(BlazorWebAssemblyJSMapPath)" Condition="Exists('$(BlazorWebAssemblyJSMapPath)')" /> @@ -140,7 +141,7 @@ Copyright (c) .NET Foundation. All rights reserved. - + <_BlazorOutputWithTargetPath Include="@(_BlazorReadSatelliteAssembly)" @@ -162,6 +163,12 @@ Copyright (c) .NET Foundation. All rights reserved. + + +