Skip to content

Enable SpaServices tests on helix #29247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
11 commits merged into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions eng/helix/content/InstallNode.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@
This script installs NodeJs from http://nodejs.org/dist on a machine.
.PARAMETER Version
The version of NodeJS to install.
.PARAMETER InstallDir
The directory to install NodeJS to.
.LINK
https://nodejs.org/en/
#>
param(
[Parameter(Mandatory = $true)]
$Version,

[Parameter(Mandatory = $true)]
$InstallDir
$Version
)

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

Set-StrictMode -Version 1

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

if (Test-Path "$InstallDir\node.exe")
{
Write-Host "Node.exe found at $InstallDir"
Write-Host "Node.exe found at $InstallDir\node.exe"
exit
}

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

Write-Host "Expanded NodeJs"
New-Item -Path "$InstallDir" -ItemType "directory" -Force
Write-Host "Copying $tempDir\$nodeFile\node.exe to $InstallDir"
Copy-Item "$tempDir\$nodeFile\node.exe" "$InstallDir\node.exe"

Write-Host "Expanded NodeJs to $tempDir, moving $tempDir\$nodeFile to $InstallDir subdir"
move $tempDir\$nodeFile $InstallDir
if (Test-Path "$InstallDir\node.exe")
{
Write-Host "Node.exe copied to $InstallDir"
Expand Down
2 changes: 1 addition & 1 deletion eng/helix/content/runtests.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
set DOTNET_MULTILEVEL_LOOKUP=0
set DOTNET_CLI_HOME=%CD%\home%random%

set "PATH=%DOTNET_ROOT%;%PATH%;%HELIX_CORRELATION_PAYLOAD%\node\bin"
set "PATH=%DOTNET_ROOT%;%PATH%;%CD%\nodejs"
echo Set path to: "%PATH%"
echo.

Expand Down
2 changes: 1 addition & 1 deletion eng/targets/Helix.targets
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ItemGroup>

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

<ItemGroup Condition=" '$(TestDependsOnAspNetRuntime)' == 'true' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
<PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<TestDependsOnNode>true</TestDependsOnNode>
<!-- Depends on npm which is not picked up on helix -->
<!-- https://github.com/dotnet/aspnetcore/issues/18672 -->
<BuildHelixPayload>false</BuildHelixPayload>
<SkipHelixArm>true</SkipHelixArm>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public void UseSpa_ThrowsInvalidOperationException_IfRootpathNotSet()
Assert.Equal("No RootPath was set on the SpaStaticFilesOptions.", exception.Message);
}

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

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