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
This commit is contained in:
Pranav K 2020-06-30 14:58:54 -07:00 committed by GitHub
parent c4eaad5df5
commit 71e388eab7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 5 deletions

View File

@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<BlazorWebAssemblyJSPath>$(MSBuildThisFileDirectory)blazor.webassembly.js</BlazorWebAssemblyJSPath>
</PropertyGroup>
</Project>

View File

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // 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.E2ETesting;
using Microsoft.AspNetCore.Testing;
using Templates.Test.Helpers; using Templates.Test.Helpers;
using Xunit; using Xunit;
@ -11,4 +10,3 @@ using Xunit;
[assembly: Microsoft.AspNetCore.E2ETesting.AssemblyFixture(typeof(ProjectFactoryFixture))] [assembly: Microsoft.AspNetCore.E2ETesting.AssemblyFixture(typeof(ProjectFactoryFixture))]
[assembly: Microsoft.AspNetCore.E2ETesting.AssemblyFixture(typeof(SeleniumStandaloneServer))] [assembly: Microsoft.AspNetCore.E2ETesting.AssemblyFixture(typeof(SeleniumStandaloneServer))]
[assembly: QuarantinedTest("Investigation pending in https://github.com/dotnet/aspnetcore/issues/20479")]

View File

@ -9,6 +9,7 @@
<DefineConstants>$(DefineConstants);XPLAT</DefineConstants> <DefineConstants>$(DefineConstants);XPLAT</DefineConstants>
<RunTemplateTests Condition="'$(RunTemplateTests)' == ''" >true</RunTemplateTests> <RunTemplateTests Condition="'$(RunTemplateTests)' == ''" >true</RunTemplateTests>
<SkipTests Condition="'$(RunTemplateTests)' != 'true'">true</SkipTests>
<!--Do not run this test project on Helix.--> <!--Do not run this test project on Helix.-->
<BuildHelixPayload>false</BuildHelixPayload> <BuildHelixPayload>false</BuildHelixPayload>
<SkipHelixArm>true</SkipHelixArm> <SkipHelixArm>true</SkipHelixArm>

View File

@ -333,7 +333,7 @@ namespace Templates.Test
public async Task BlazorWasmStandaloneTemplate_IndividualAuth_Works() public async Task BlazorWasmStandaloneTemplate_IndividualAuth_Works()
{ {
var project = await ProjectFactory.GetOrCreateProject("blazorstandaloneindividual", Output); var project = await ProjectFactory.GetOrCreateProject("blazorstandaloneindividual", Output);
project.TargetFramework = "netstandard2.1"; project.RuntimeIdentifier = "browser-wasm";
var createResult = await project.RunDotNetNewAsync("blazorwasm", args: new[] { var createResult = await project.RunDotNetNewAsync("blazorwasm", args: new[] {
"-au", "-au",

View File

@ -44,7 +44,7 @@ namespace Templates.Test.Helpers
DiagnosticsMessageSink = DiagnosticsMessageSink, DiagnosticsMessageSink = DiagnosticsMessageSink,
ProjectGuid = Path.GetRandomFileName().Replace(".", string.Empty) ProjectGuid = Path.GetRandomFileName().Replace(".", string.Empty)
}; };
project.ProjectName = $"AspNet.{key}.{project.ProjectGuid}"; project.ProjectName = $"AspNet.{project.ProjectGuid}";
var assemblyPath = GetType().Assembly; var assemblyPath = GetType().Assembly;
var basePath = GetTemplateFolderBasePath(assemblyPath); var basePath = GetTemplateFolderBasePath(assemblyPath);

View File

@ -92,6 +92,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<!-- <!--
Calculates the outputs and the paths for Blazor WASM. This target is invoked frequently and should perform minimal work. Calculates the outputs and the paths for Blazor WASM. This target is invoked frequently and should perform minimal work.
--> -->
<ItemGroup> <ItemGroup>
<_BlazorJSFile Include="$(BlazorWebAssemblyJSPath)" /> <_BlazorJSFile Include="$(BlazorWebAssemblyJSPath)" />
<_BlazorJSFile Include="$(BlazorWebAssemblyJSMapPath)" Condition="Exists('$(BlazorWebAssemblyJSMapPath)')" /> <_BlazorJSFile Include="$(BlazorWebAssemblyJSMapPath)" Condition="Exists('$(BlazorWebAssemblyJSMapPath)')" />
@ -140,7 +141,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<Output TaskParameter="SatelliteAssembly" ItemName="_BlazorReadSatelliteAssembly" /> <Output TaskParameter="SatelliteAssembly" ItemName="_BlazorReadSatelliteAssembly" />
</BlazorReadSatelliteAssemblyFile> </BlazorReadSatelliteAssemblyFile>
<ItemGroup > <ItemGroup>
<!-- We've imported a previously Cacheed file. Let's turn in to a _BlazorOutputWithTargetPath --> <!-- We've imported a previously Cacheed file. Let's turn in to a _BlazorOutputWithTargetPath -->
<_BlazorOutputWithTargetPath <_BlazorOutputWithTargetPath
Include="@(_BlazorReadSatelliteAssembly)" Include="@(_BlazorReadSatelliteAssembly)"
@ -162,6 +163,12 @@ Copyright (c) .NET Foundation. All rights reserved.
<ReferenceCopyLocalPaths DestinationSubDirectory="$(_BlazorOutputPath)%(ReferenceCopyLocalPaths.DestinationSubDirectory)" /> <ReferenceCopyLocalPaths DestinationSubDirectory="$(_BlazorOutputPath)%(ReferenceCopyLocalPaths.DestinationSubDirectory)" />
</ItemGroup> </ItemGroup>
<!-- A missing blazor.webassembly.js is our packaging error. Produce an error so it's discovered early. -->
<Error
Text="Unable to find BlazorWebAssembly JS files. This usually indicates a packaging error."
Code="RAZORSDK1007"
Condition="'@(_BlazorJSFile->Count())' == '0'" />
<!-- <!--
When building with BuildingProject=false, satellite assemblies do not get resolved (the ones for the current project and the one for When building with BuildingProject=false, satellite assemblies do not get resolved (the ones for the current project and the one for
referenced project). BuildingProject=false is typically set for referenced projects when building inside VisualStudio. referenced project). BuildingProject=false is typically set for referenced projects when building inside VisualStudio.