Skip to content

Commit 699b80f

Browse files
authored
Enable SpaServices tests on helix (#29247)
* Update InstallNode.ps1 * Update runtests.cmd * Update Helix.targets * Update Microsoft.AspNetCore.SpaServices.Extensions.Tests.csproj * Update InstallNode.ps1 * Update InstallNode.ps1 * Update helix-matrix.yml * Update Microsoft.AspNetCore.SpaServices.Extensions.Tests.csproj * Update Microsoft.AspNetCore.SpaServices.Extensions.Tests.csproj * Skip on alpine * Update helix-matrix.yml
1 parent 3554d74 commit 699b80f

File tree

5 files changed

+12
-19
lines changed

5 files changed

+12
-19
lines changed

eng/helix/content/InstallNode.ps1

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,17 @@
55
This script installs NodeJs from http://nodejs.org/dist on a machine.
66
.PARAMETER Version
77
The version of NodeJS to install.
8-
.PARAMETER InstallDir
9-
The directory to install NodeJS to.
108
.LINK
119
https://nodejs.org/en/
1210
#>
1311
param(
1412
[Parameter(Mandatory = $true)]
15-
$Version,
16-
17-
[Parameter(Mandatory = $true)]
18-
$InstallDir
13+
$Version
1914
)
2015

2116
$ErrorActionPreference = 'Stop'
2217
$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
18+
$InstallDir = $PSScriptRoot + '\nodejs' # Always install to workitem root / nodejs
2319

2420
Set-StrictMode -Version 1
2521

@@ -31,7 +27,7 @@ if (Get-Command "node.exe" -ErrorAction SilentlyContinue)
3127

3228
if (Test-Path "$InstallDir\node.exe")
3329
{
34-
Write-Host "Node.exe found at $InstallDir"
30+
Write-Host "Node.exe found at $InstallDir\node.exe"
3531
exit
3632
}
3733

@@ -57,11 +53,8 @@ else {
5753
[System.IO.Compression.ZipFile]::ExtractToDirectory("nodejs.zip", $tempDir)
5854
}
5955

60-
Write-Host "Expanded NodeJs"
61-
New-Item -Path "$InstallDir" -ItemType "directory" -Force
62-
Write-Host "Copying $tempDir\$nodeFile\node.exe to $InstallDir"
63-
Copy-Item "$tempDir\$nodeFile\node.exe" "$InstallDir\node.exe"
64-
56+
Write-Host "Expanded NodeJs to $tempDir, moving $tempDir\$nodeFile to $InstallDir subdir"
57+
move $tempDir\$nodeFile $InstallDir
6558
if (Test-Path "$InstallDir\node.exe")
6659
{
6760
Write-Host "Node.exe copied to $InstallDir"

eng/helix/content/runtests.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
2121
set DOTNET_MULTILEVEL_LOOKUP=0
2222
set DOTNET_CLI_HOME=%CD%\home%random%
2323

24-
set "PATH=%DOTNET_ROOT%;%PATH%;%HELIX_CORRELATION_PAYLOAD%\node\bin"
24+
set "PATH=%DOTNET_ROOT%;%PATH%;%CD%\nodejs"
2525
echo Set path to: "%PATH%"
2626
echo.
2727

eng/targets/Helix.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</ItemGroup>
1414

1515
<ItemGroup Condition="'$(TestDependsOnNode)' == 'true' AND '$(IsWindowsHelixQueue)' == 'true'">
16-
<HelixPreCommand Include="call RunPowershell.cmd InstallNode.ps1 $(NodeVersion) %25HELIX_CORRELATION_PAYLOAD%25\node\bin || exit /b 1" />
16+
<HelixPreCommand Include="call RunPowershell.cmd InstallNode.ps1 $(NodeVersion) || exit /b 1" />
1717
</ItemGroup>
1818

1919
<ItemGroup Condition=" '$(TestDependsOnAspNetRuntime)' == 'true' ">

src/Middleware/SpaServices.Extensions/test/Microsoft.AspNetCore.SpaServices.Extensions.Tests.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
55
<TestDependsOnNode>true</TestDependsOnNode>
6-
<!-- Depends on npm which is not picked up on helix -->
7-
<!-- https://github.com/dotnet/aspnetcore/issues/18672 -->
8-
<BuildHelixPayload>false</BuildHelixPayload>
6+
<SkipHelixArm>true</SkipHelixArm>
97
</PropertyGroup>
108

119
<ItemGroup>

src/Middleware/SpaServices.Extensions/test/SpaServicesExtensionsTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public void UseSpa_ThrowsInvalidOperationException_IfRootpathNotSet()
3838
Assert.Equal("No RootPath was set on the SpaStaticFilesOptions.", exception.Message);
3939
}
4040

41-
[Fact]
41+
[ConditionalFact]
42+
[SkipOnHelix("Flaky on Alpine", Queues = "(Alpine.312.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:alpine-3.12-helix-20200908125345-56c6673")]
4243
public async Task UseSpa_KillsRds_WhenAppIsStopped()
4344
{
4445
var serviceProvider = GetServiceProvider(s => s.RootPath = "/");
@@ -57,7 +58,8 @@ public async Task UseSpa_KillsRds_WhenAppIsStopped()
5758
await Assert_NpmKilled_WhenAppIsStopped(applicationLifetime, listener);
5859
}
5960

60-
[Fact]
61+
[ConditionalFact]
62+
[SkipOnHelix("Flaky on Alpine", Queues = "(Alpine.312.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:alpine-3.12-helix-20200908125345-56c6673")]
6163
public async Task UseSpa_KillsAngularCli_WhenAppIsStopped()
6264
{
6365
var serviceProvider = GetServiceProvider(s => s.RootPath = "/");

0 commit comments

Comments
 (0)