Skip to content

Commit 71e388e

Browse files
authored
Unquaratine blazor template tests (#23521)
* Ensure BlazorWebAssembly.js is present * Unquaratine blazor template tests * The failure issue #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
1 parent c4eaad5 commit 71e388e

File tree

6 files changed

+16
-5
lines changed

6 files changed

+16
-5
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project>
2+
<PropertyGroup>
3+
<BlazorWebAssemblyJSPath>$(MSBuildThisFileDirectory)blazor.webassembly.js</BlazorWebAssemblyJSPath>
4+
</PropertyGroup>
5+
</Project>

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

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

44
using Microsoft.AspNetCore.E2ETesting;
5-
using Microsoft.AspNetCore.Testing;
65
using Templates.Test.Helpers;
76
using Xunit;
87

@@ -11,4 +10,3 @@
1110
[assembly: Microsoft.AspNetCore.E2ETesting.AssemblyFixture(typeof(ProjectFactoryFixture))]
1211
[assembly: Microsoft.AspNetCore.E2ETesting.AssemblyFixture(typeof(SeleniumStandaloneServer))]
1312

14-
[assembly: QuarantinedTest("Investigation pending in https://github.com/dotnet/aspnetcore/issues/20479")]

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<DefineConstants>$(DefineConstants);XPLAT</DefineConstants>
1010

1111
<RunTemplateTests Condition="'$(RunTemplateTests)' == ''" >true</RunTemplateTests>
12+
<SkipTests Condition="'$(RunTemplateTests)' != 'true'">true</SkipTests>
1213
<!--Do not run this test project on Helix.-->
1314
<BuildHelixPayload>false</BuildHelixPayload>
1415
<SkipHelixArm>true</SkipHelixArm>

src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ private async Task BlazorWasmHostedTemplate_IndividualAuth_Works(bool useLocalDb
333333
public async Task BlazorWasmStandaloneTemplate_IndividualAuth_Works()
334334
{
335335
var project = await ProjectFactory.GetOrCreateProject("blazorstandaloneindividual", Output);
336-
project.TargetFramework = "netstandard2.1";
336+
project.RuntimeIdentifier = "browser-wasm";
337337

338338
var createResult = await project.RunDotNetNewAsync("blazorwasm", args: new[] {
339339
"-au",

src/ProjectTemplates/Shared/ProjectFactoryFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public async Task<Project> GetOrCreateProject(string projectKey, ITestOutputHelp
4444
DiagnosticsMessageSink = DiagnosticsMessageSink,
4545
ProjectGuid = Path.GetRandomFileName().Replace(".", string.Empty)
4646
};
47-
project.ProjectName = $"AspNet.{key}.{project.ProjectGuid}";
47+
project.ProjectName = $"AspNet.{project.ProjectGuid}";
4848

4949
var assemblyPath = GetType().Assembly;
5050
var basePath = GetTemplateFolderBasePath(assemblyPath);

src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.Components.Wasm.targets

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Copyright (c) .NET Foundation. All rights reserved.
9292
<!--
9393
Calculates the outputs and the paths for Blazor WASM. This target is invoked frequently and should perform minimal work.
9494
-->
95+
9596
<ItemGroup>
9697
<_BlazorJSFile Include="$(BlazorWebAssemblyJSPath)" />
9798
<_BlazorJSFile Include="$(BlazorWebAssemblyJSMapPath)" Condition="Exists('$(BlazorWebAssemblyJSMapPath)')" />
@@ -140,7 +141,7 @@ Copyright (c) .NET Foundation. All rights reserved.
140141
<Output TaskParameter="SatelliteAssembly" ItemName="_BlazorReadSatelliteAssembly" />
141142
</BlazorReadSatelliteAssemblyFile>
142143

143-
<ItemGroup >
144+
<ItemGroup>
144145
<!-- We've imported a previously Cacheed file. Let's turn in to a _BlazorOutputWithTargetPath -->
145146
<_BlazorOutputWithTargetPath
146147
Include="@(_BlazorReadSatelliteAssembly)"
@@ -162,6 +163,12 @@ Copyright (c) .NET Foundation. All rights reserved.
162163
<ReferenceCopyLocalPaths DestinationSubDirectory="$(_BlazorOutputPath)%(ReferenceCopyLocalPaths.DestinationSubDirectory)" />
163164
</ItemGroup>
164165

166+
<!-- A missing blazor.webassembly.js is our packaging error. Produce an error so it's discovered early. -->
167+
<Error
168+
Text="Unable to find BlazorWebAssembly JS files. This usually indicates a packaging error."
169+
Code="RAZORSDK1007"
170+
Condition="'@(_BlazorJSFile->Count())' == '0'" />
171+
165172
<!--
166173
When building with BuildingProject=false, satellite assemblies do not get resolved (the ones for the current project and the one for
167174
referenced project). BuildingProject=false is typically set for referenced projects when building inside VisualStudio.

0 commit comments

Comments
 (0)