Skip to content

Commit 112d891

Browse files
committed
Update Helix.targets
Update Microsoft.AspNetCore.App.UnitTests.csproj Update TargetingPackTests.cs Update SharedFxTests.cs Update TargetingPackTests.cs Update InstallAspNetRef.ps1 Update Helix.targets Create installaspnetref.sh Update SharedFxTests.cs Update TargetingPackTests.cs Update SharedFxTests.cs Fix runtimeVersion Update runtests.cmd Update runtests.cmd Update runtests.sh Update runtests.sh Update runtests.cmd Update SharedFxTests.cs Update runtests.cmd Update runtests.cmd Update InstallAppRuntime.ps1 Update runtests.sh Skip versions file check on helix for now Update Microsoft.AspNetCore.App.UnitTests.csproj Run unit tests on azdo too Update SharedFxTests.cs Update SharedFxTests.cs Update Microsoft.AspNetCore.App.UnitTests.csproj
1 parent 04f0790 commit 112d891

File tree

7 files changed

+41
-19
lines changed

7 files changed

+41
-19
lines changed

eng/helix/content/InstallAppRuntime.ps1

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ $ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
3030

3131
Set-StrictMode -Version 1
3232

33-
Write-Host "Extracting to $InstallDir"
34-
3533
$zipPackage = [io.path]::ChangeExtension($AppRuntimePath, ".zip")
3634
Write-Host "Renaming to $zipPackage"
3735
Rename-Item -Path $AppRuntimePath -NewName $zipPackage
@@ -46,8 +44,7 @@ else {
4644
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipPackage, ".\tmpRuntime")
4745
}
4846

49-
Get-ChildItem -Path ".\tmpRuntime" -Recurse
50-
47+
New-Item -ItemType Directory -Force -Path $InstallDir
5148
Write-Host "Copying managed files to $InstallDir"
5249
Copy-Item -Path ".\tmpRuntime\runtimes\$RuntimeIdentifier\lib\$Framework\*" $InstallDir
5350
Write-Host "Copying native files to $InstallDir"

eng/helix/content/InstallAspNetRef.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ param(
1313
$RefPath,
1414

1515
[Parameter(Mandatory = $true)]
16-
$InstallDir,
16+
$InstallDir
1717
)
1818

1919
$ErrorActionPreference = 'Stop'

eng/helix/content/installaspnetref.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
# Cause the script to fail if any subcommand fails
4+
set -e
5+
6+
refPath=$1
7+
output_dir=$2
8+
tmpDir=./tmpRuntime
9+
10+
echo "Installing ref package from $refPath"
11+
cp $refPath sharedFx.zip
12+
13+
mkdir -p $output_dir
14+
echo "Unzip to $output_dir"
15+
unzip sharedFx.zip -d $output_dir

eng/targets/Helix.targets

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,21 @@
1616
<HelixPreCommand Include="call RunPowershell.cmd InstallNode.ps1 $(NodeVersion) %25HELIX_CORRELATION_PAYLOAD%25\node\bin || exit /b 1" />
1717
</ItemGroup>
1818

19-
<ItemGroup Condition="'$(IsHelixJob)' == 'true' AND '$(IsWindowsHelixQueue)' == 'true' AND '$(TestDependsOnAspNetRuntime)' == 'true'">
20-
<HelixContent Include="$(RepoRoot)artifacts\packages\Release\Shipping\Microsoft.AspNetCore.App.Runtime.win-x64.$(AppRuntimeVersion).nupkg" />
21-
<HelixPreCommand Include="call RunPowershell.cmd InstallAppRuntime.ps1 Microsoft.AspNetCore.App.Runtime.win-x64.$(AppRuntimeVersion).nupkg Microsoft.AspNetCore.App netcoreapp5.0 win-x64 || exit /b 1" />
19+
<ItemGroup Condition="'$(IsHelixJob)' == 'true' AND '$(IsWindowsHelixQueue)' == 'true' AND '$(TestDependsOnAspNetRef)' == 'true'">
20+
<HelixContent Include="$(RepoRoot)artifacts\packages\Release\Shipping\Microsoft.AspNetCore.App.Ref.$(AppRuntimeVersion).nupkg" />
21+
<HelixPreCommand Include="call RunPowershell.cmd InstallAspNetRef.ps1 Microsoft.AspNetCore.App.Ref.$(AppRuntimeVersion).nupkg Microsoft.AspNetCore.App.Ref || exit /b 1" />
2222
</ItemGroup>
2323

24-
<ItemGroup Condition="'$(IsHelixJob)' == 'true' AND '$(IsWindowsHelixQueue)' == 'true' AND '$(TestDependsOnAspNetRef)' == 'true'">
24+
<ItemGroup Condition="'$(IsHelixJob)' == 'true' AND '$(IsWindowsHelixQueue)' == 'false' AND '$(TestDependsOnAspNetRef)' == 'true'">
2525
<HelixContent Include="$(RepoRoot)artifacts\packages\Release\Shipping\Microsoft.AspNetCore.App.Ref.$(AppRuntimeVersion).nupkg" />
26-
<HelixPreCommand Include="call RunPowershell.cmd InstallRef.ps1 Microsoft.AspNetCore.App.Ref.$(AppRuntimeVersion).nupkg Microsoft.AspNetCore.App.Ref || exit /b 1" />
26+
<HelixPreCommand Include="./installaspnetref.sh Microsoft.AspNetCore.App.Ref.$(AppRuntimeVersion).nupkg Microsoft.AspNetCore.App.Ref || exit /b 1" />
2727
</ItemGroup>
2828

29+
<ItemGroup Condition="'$(IsHelixJob)' == 'true' AND '$(IsWindowsHelixQueue)' == 'true' AND '$(TestDependsOnAspNetRuntime)' == 'true'">
30+
<HelixContent Include="$(RepoRoot)artifacts\packages\Release\Shipping\Microsoft.AspNetCore.App.Runtime.win-x64.$(AppRuntimeVersion).nupkg" />
31+
<HelixPreCommand Include="call RunPowershell.cmd InstallAppRuntime.ps1 Microsoft.AspNetCore.App.Runtime.win-x64.$(AppRuntimeVersion).nupkg Microsoft.AspNetCore.App netcoreapp5.0 win-x64 || exit /b 1" />
32+
</ItemGroup>
33+
2934
<ItemGroup Condition="'$(IsHelixJob)' == 'true' AND '$(IsWindowsHelixQueue)' == 'false' AND '$(TestDependsOnAspNetRuntime)' == 'true'">
3035
<HelixContent Include="$(RepoRoot)artifacts\packages\Release\Shipping\Microsoft.AspNetCore.App.Runtime.win-x64.$(AppRuntimeVersion).nupkg" />
3136
<HelixPreCommand Include="./installappruntime.sh Microsoft.AspNetCore.App.Runtime.win-x64.$(AppRuntimeVersion).nupkg Microsoft.AspNetCore.App netcoreapp5.0 win-x64" />

src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
<RootNamespace>Microsoft.AspNetCore</RootNamespace>
66
<VerifyAncmBinary Condition="'$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' != 'arm'">true</VerifyAncmBinary>
77
<TestDependsOnAspNetRuntime>true</TestDependsOnAspNetRuntime>
8+
<TestDependsOnAspNetRef>true</TestDependsOnAspNetRef>
9+
10+
<!-- Some tests still do not work on Helix, so continue running these on azdo for now as well -->
11+
<SkipTests>false</SkipTests>
812
</PropertyGroup>
913

1014
<ItemGroup>
@@ -47,6 +51,7 @@
4751

4852
<ItemGroup>
4953
<Reference Include="Newtonsoft.Json" />
54+
<Compile Include="$(SharedSourceRoot)test\SkipOnHelixAttribute.cs" />
5055
</ItemGroup>
5156

5257
<ItemGroup>

src/Framework/test/SharedFxTests.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Collections.Generic;
66
using System.IO;
77
using System.Linq;
8+
using Microsoft.AspNetCore.Testing;
89
using Newtonsoft.Json.Linq;
910
using Xunit;
1011
using Xunit.Abstractions;
@@ -23,10 +24,9 @@ public SharedFxTests(ITestOutputHelper output)
2324
_output = output;
2425
_expectedTfm = "netcoreapp" + TestData.GetSharedFxVersion().Substring(0, 3);
2526
_expectedRid = TestData.GetSharedFxRuntimeIdentifier();
26-
var root = string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))
27-
? TestData.GetTestDataValue("SharedFrameworkLayoutRoot")
28-
: Environment.GetEnvironmentVariable("DOTNET_ROOT");
29-
_sharedFxRoot = Path.Combine(root, "shared", "Microsoft.AspNetCore.App", TestData.GetTestDataValue("RuntimePackageVersion"))
27+
_sharedFxRoot = string.IsNullOrEmpty(Environment.GetEnvironmentVariable("ASPNET_RUNTIME_PATH"))
28+
? Path.Combine(TestData.GetTestDataValue("SharedFrameworkLayoutRoot"), "shared", TestData.GetTestDataValue("RuntimePackageVersion"))
29+
: Environment.GetEnvironmentVariable("ASPNET_RUNTIME_PATH");
3030
}
3131

3232
[Fact]
@@ -131,7 +131,8 @@ public void ItContainsValidDepsJson()
131131
}
132132
}
133133

134-
[Fact]
134+
[ConditionalFact]
135+
[SkipOnHelix("missing file from sfx builds")]
135136
public void ItContainsVersionFile()
136137
{
137138
var versionFile = Path.Combine(_sharedFxRoot, "Microsoft.AspNetCore.App.versions.txt");

src/Framework/test/TargetingPackTests.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ public TargetingPackTests(ITestOutputHelper output)
2626
{
2727
_output = output;
2828
_expectedRid = TestData.GetSharedFxRuntimeIdentifier();
29-
var root = string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))
30-
? TestData.GetTestDataValue("TargetingPackLayoutRoot")
31-
: Environment.GetEnvironmentVariable("DOTNET_ROOT");
32-
_targetingPackRoot = Path.Combine(TestData.GetTestDataValue("TargetingPackLayoutRoot"), "packs", "Microsoft.AspNetCore.App.Ref", TestData.GetTestDataValue("TargetingPackVersion"));
29+
_targetingPackRoot = string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))
30+
? Path.Combine(TestData.GetTestDataValue("TargetingPackLayoutRoot"), "packs", "Microsoft.AspNetCore.App.Ref", TestData.GetTestDataValue("TargetingPackVersion"))
31+
: Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT"), "Microsoft.AspNetCore.App.Ref");
3332
_isTargetingPackBuilding = bool.Parse(TestData.GetTestDataValue("IsTargetingPackBuilding"));
3433
}
3534

0 commit comments

Comments
 (0)