Skip to content

Commit b8f9262

Browse files
authored
Enable CoreFX test filtering for CoreCLR PRs (dotnet#24259)
This change enables CoreFX tests for CoreCLR.
1 parent 68fb276 commit b8f9262

File tree

7 files changed

+641
-51
lines changed

7 files changed

+641
-51
lines changed

azure-pipelines.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,18 @@ jobs:
235235
jobParameters:
236236
readyToRun: true
237237
testGroup: innerloop
238+
displayNameArgs: R2R
239+
# The CoreFX runs against CoreCLR
240+
- template: eng/platform-matrix.yml
241+
parameters:
242+
jobTemplate: test-job.yml
243+
buildConfig: release
244+
platforms:
245+
- Windows_NT_x64
246+
jobParameters:
247+
corefxTests: true
248+
testGroup: innerloop
249+
displayNameArgs: CoreFX
238250

239251
# CI
240252
- ${{ if and(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI')) }}:
@@ -263,6 +275,7 @@ jobs:
263275
jobParameters:
264276
readyToRun: true
265277
testGroup: outerloop
278+
displayNameArgs: R2R
266279

267280
#
268281
# Release test builds
@@ -295,6 +308,7 @@ jobs:
295308
jobParameters:
296309
testGroup: outerloop
297310
readyToRun: true
311+
displayNameArgs: R2R
298312

299313

300314
# Publish build information to Build Assets Registry

eng/Version.Details.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
<Uri>https://github.com/dotnet/arcade</Uri>
1212
<Sha>a7a250e9c13147134543c35fef2fb81f19592edf</Sha>
1313
</Dependency>
14+
<!-- This dependency should be added, but it causes the github PR legs to not launch. -->
15+
<!-- Dependency Name="microsoft.dotnet.build.tasks.feed" Version="2.2.0-beta.19229.8">
16+
<Uri>https://github.com/dotnet/arcade</Uri>
17+
<Sha>a7a250e9c13147134543c35fef2fb81f19592edf</Sha>
18+
</Dependency-->
1419
<Dependency Name="Microsoft.Private.CoreFx.NETCoreApp" Version="4.6.0-preview6.19229.1">
1520
<Uri>https://github.com/dotnet/corefx</Uri>
1621
<Sha>173a2a165316af9a4e211ceab8c8d9692de8a528</Sha>

eng/helixcorefxtests.proj

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
<Project InitialTargets="BuildHelixWorkItems" Sdk="Microsoft.DotNet.Helix.Sdk">
2+
<Import Project="$(NuGetPackageRoot)microsoft.dotnet.build.tasks.feed\$(MicrosoftDotNetBuildTasksFeedVersion)\build\Microsoft.DotNet.Build.Tasks.Feed.targets" />
3+
4+
<PropertyGroup>
5+
<!-- Set the TargetFramework just to make the SDK happy -->
6+
<TargetFramework>netstandard2.0</TargetFramework>
7+
</PropertyGroup>
8+
9+
<PropertyGroup>
10+
<Creator>$(_Creator)</Creator>
11+
<HelixAccessToken>$(_HelixAccessToken)</HelixAccessToken>
12+
<HelixBuild>$(_HelixBuild)</HelixBuild>
13+
<HelixSource>$(_HelixSource)</HelixSource>
14+
<HelixTargetQueues>$(_HelixTargetQueues)</HelixTargetQueues>
15+
<HelixType>$(_HelixType)</HelixType>
16+
<HelixArchitecture>$(__BuildArch)</HelixArchitecture>
17+
<HelixConfiguration>$(__BuildType)</HelixConfiguration>
18+
19+
<!--
20+
TODO: ProjectDir, RootBinDir, TestWorkingDir, and TargetsWindows are global properties set in dir.props, remove the property assignment here when we port to arcade.
21+
-->
22+
<ProjectDir Condition="'$(__ProjectDir)'==''">$(MSBuildThisFileDirectory)..\</ProjectDir>
23+
<RootBinDir Condition="'$(__RootBinDir)'==''">$(ProjectDir)bin\</RootBinDir>
24+
<TestWorkingDir Condition="'$(__TestWorkingDir)'==''">$(RootBinDir)tests\$(__BuildOS).$(__BuildArch).$(__BuildType)\</TestWorkingDir>
25+
<TargetsWindows Condition="'$(__BuildOS)' == 'Windows_NT'">true</TargetsWindows>
26+
27+
<TestHostRootPath>$(TestWorkingDir)testhost\</TestHostRootPath>
28+
<TestArchiveRuntimeRoot>$(TestWorkingDir)helix\</TestArchiveRuntimeRoot>
29+
<TestArchiveRuntimeFile>$(TestArchiveRuntimeRoot)testhost-runtime.zip</TestArchiveRuntimeFile>
30+
<HelixCorrelationPayload></HelixCorrelationPayload>
31+
32+
<EnableAzurePipelinesReporter>$(_PublishTestResults)</EnableAzurePipelinesReporter>
33+
<EnableAzurePipelinesReporter Condition=" '$(EnableAzurePipelinesReporter)' == '' ">false</EnableAzurePipelinesReporter>
34+
<EnableXUnitReporter>true</EnableXUnitReporter>
35+
<FailOnMissionControlTestFailure>true</FailOnMissionControlTestFailure>
36+
<FailOnWorkItemFailure>true</FailOnWorkItemFailure>
37+
38+
<TimeoutInSeconds Condition="'$(TimeoutInSeconds)' == ''">600</TimeoutInSeconds>
39+
<CommandTimeoutSpan>$([System.TimeSpan]::FromSeconds($(TimeoutInSeconds)))</CommandTimeoutSpan>
40+
<MaxRetryCount Condition="'$(MaxRetryCount)' == ''">4</MaxRetryCount>
41+
<WaitForWorkItemCompletion>true</WaitForWorkItemCompletion>
42+
</PropertyGroup>
43+
44+
<PropertyGroup>
45+
<!--
46+
For windows we need to use call, since the command is going to be called from a bat script created by Helix
47+
and we exit /b at the end of RunTests.cmd, Helix runs some other commands after ours within the bat script,
48+
if we don't use call, then we cause the parent script to exit, and anything after will not be executed.
49+
The arguments passed in to the run script in order are the runtime directory, the dotnet root directory (for
50+
helix submissions same as the runtime directory) and the global tools directory.
51+
-->
52+
<HelixCommand Condition="'$(TargetsWindows)' == 'true'">call RunTests.cmd -r %HELIX_CORRELATION_PAYLOAD% -d %HELIX_CORRELATION_PAYLOAD% -g %HELIX_CORRELATION_PAYLOAD%\tools --rsp-file %HELIX_CORRELATION_PAYLOAD%\CoreFX.issues.rsp </HelixCommand>
53+
<HelixCommand Condition="'$(TargetsWindows)' != 'true'">./RunTests.sh -r $HELIX_CORRELATION_PAYLOAD -d $HELIX_CORRELATION_PAYLOAD -g $HELIX_CORRELATION_PAYLOAD/tools --rsp-file $HELIX_CORRELATION_PAYLOAD/CoreFX.issues.rsp </HelixCommand>
54+
</PropertyGroup>
55+
56+
<ItemGroup>
57+
<TestArchiveRuntimeInputs Include="$(TestHostRootPath)**/*" />
58+
</ItemGroup>
59+
60+
<Target Name="CopyRSPFile">
61+
<Copy
62+
SourceFiles="$(ProjectDir)\tests\CoreFX\CoreFX.issues.rsp"
63+
DestinationFolder="$(TestHostRootPath)" />
64+
</Target>
65+
66+
<Target Name="CompressRuntimeDirectory"
67+
Inputs="@(TestArchiveRuntimeInputs)"
68+
Outputs="$(TestArchiveRuntimeFile)"
69+
DependsOnTargets="CopyRSPFile" >
70+
71+
<MakeDir Directories="$(TestArchiveRuntimeRoot)" />
72+
73+
<ZipDirectory
74+
SourceDirectory="$(TestHostRootPath)"
75+
DestinationFile="$(TestArchiveRuntimeFile)"
76+
Overwrite="true" />
77+
78+
<Message Importance="High" Text="Zipped correlation payload into $(TestArchiveRuntimeFile)" />
79+
</Target>
80+
81+
<PropertyGroup>
82+
<TestAssetBlobFeedUrl>https://dotnetfeed.blob.core.windows.net/dotnet-core</TestAssetBlobFeedUrl>
83+
</PropertyGroup>
84+
85+
<Target Name="GetTestAssetManifest"
86+
Returns="@(TestAssetBlobInfos)">
87+
88+
<PropertyGroup>
89+
<_TargetGroup>netcoreapp</_TargetGroup>
90+
<_AssetManifestPath>$(TestAssetBlobFeedUrl)/corefx-tests/$(MicrosoftPrivateCoreFxNETCoreAppVersion)/$(__BuildOS).$(__BuildArch)/$(_TargetGroup)/corefx-test-assets.xml</_AssetManifestPath>
91+
</PropertyGroup>
92+
93+
<ParseBuildManifest AssetManifestPath="$(_AssetManifestPath)">
94+
<Output TaskParameter="BlobInfos" ItemName="TestAssetBlobInfos" />
95+
</ParseBuildManifest>
96+
</Target>
97+
98+
<Target Name="BuildHelixWorkItems"
99+
Inputs="$(TestArchiveRuntimeFile);@(TestAssetBlobInfos)"
100+
Outputs="@(HelixCorrelationPayload);@(HelixWorkItem)"
101+
DependsOnTargets="CompressRuntimeDirectory;GetTestAssetManifest">
102+
103+
<ItemGroup>
104+
<HelixCorrelationPayload
105+
Include="$(TestArchiveRuntimeFile)" />
106+
107+
<HelixWorkItem Include="@(TestAssetBlobInfos -> '%(FileName)')">
108+
<PayloadUri>$(TestAssetBlobFeedUrl)/%(Identity)</PayloadUri>
109+
<Command>$(HelixCommand)</Command>
110+
<Timeout>$(CommandTimeoutSpan)</Timeout>
111+
</HelixWorkItem>
112+
</ItemGroup>
113+
114+
<Message Importance="High" Text="@(HelixWorkItem -> '%(PayloadUri)')" />
115+
</Target>
116+
</Project>

eng/send-to-helix-step.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,17 @@ parameters:
1515
timeoutPerTestCollectionInMinutes: ''
1616
timeoutPerTestInMinutes: ''
1717
runCrossGen: ''
18+
helixProjectArguments: ''
1819

1920
steps:
2021
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
21-
- powershell: eng\common\msbuild.ps1 -ci tests\helixpublishwitharcade.proj /maxcpucount
22+
# TODO: Remove and consolidate this when we move to arcade via init-tools.cmd.
23+
- powershell: eng\common\build.ps1 /p:DotNetPublishToBlobFeed=true -ci -restore -projects $(Build.SourcesDirectory)\eng\empty.proj
24+
displayName: Restore blob feed tasks
25+
${{ if ne(parameters.condition, '') }}:
26+
condition: ${{ parameters.condition }}
27+
28+
- powershell: eng\common\msbuild.ps1 -ci ${{ parameters.helixProjectArguments }} /maxcpucount /bl:$(Build.SourcesDirectory)/bin/Logs/SendToHelix.binlog
2229
displayName: ${{ parameters.displayName }}
2330
${{ if ne(parameters.condition, '') }}:
2431
condition: ${{ parameters.condition }}
@@ -39,9 +46,21 @@ steps:
3946
_TimeoutPerTestInMinutes: ${{ parameters.timeoutPerTestInMinutes }}
4047
${{ if eq(parameters.publishTestResults, 'true') }}:
4148
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
49+
# TODO: remove NUGET_PACKAGES once https://github.com/dotnet/arcade/issues/1578 is fixed
50+
NUGET_PACKAGES: $(Build.SourcesDirectory)\.packages
4251

4352
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
44-
- script: ./eng/common/msbuild.sh --ci tests/helixpublishwitharcade.proj /maxcpucount
53+
# TODO: Remove and consolidate this when we move to arcade via init-tools.sh.
54+
- script: ./eng/common/build.sh /p:DotNetPublishToBlobFeed=true --ci --restore --projects $(Build.SourcesDirectory)/eng/empty.proj
55+
displayName: Restore blob feed tasks
56+
${{ if ne(parameters.condition, '') }}:
57+
condition: ${{ parameters.condition }}
58+
${{ if eq(parameters.osGroup, 'FreeBSD') }}:
59+
env:
60+
# Arcade uses this SDK instead of trying to restore one.
61+
DotNetCoreSdkDir: /usr/local/dotnet
62+
63+
- script: ./eng/common/msbuild.sh --ci ${{ parameters.helixProjectArguments }} /maxcpucount /bl:$(Build.SourcesDirectory)/bin/Logs/SendToHelix.binlog
4564
displayName: ${{ parameters.displayName }}
4665
${{ if ne(parameters.condition, '') }}:
4766
condition: ${{ parameters.condition }}
@@ -62,3 +81,5 @@ steps:
6281
_TimeoutPerTestInMinutes: ${{ parameters.timeoutPerTestInMinutes }}
6382
${{ if eq(parameters.publishTestResults, 'true') }}:
6483
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
84+
# TODO: remove NUGET_PACKAGES once https://github.com/dotnet/arcade/issues/1578 is fixed
85+
NUGET_PACKAGES: $(Build.SourcesDirectory)/.packages

eng/test-job.yml

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ parameters:
77
readyToRun: false
88
helixQueues: ''
99
crossrootfsDir: ''
10+
# If true, run the corefx tests instead of the coreclr ones
11+
corefxTests: false
12+
displayNameArgs: ''
1013

1114
### Test job
1215

@@ -23,19 +26,13 @@ jobs:
2326
helixType: 'build/tests/'
2427

2528
# Compute job name from template parameters
26-
${{ if and(eq(parameters.testGroup, 'innerloop'), eq(parameters.readyToRun, false)) }}:
27-
name: ${{ format('testbuild_pri0_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
28-
displayName: ${{ format('Test Pri0 {0} {1} {2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
29-
${{ if and(eq(parameters.testGroup, 'innerloop'), eq(parameters.readyToRun, true)) }}:
30-
name: ${{ format('testbuild_pri0_r2r_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
31-
displayName: ${{ format('Test Pri0 R2R {0} {1} {2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
32-
33-
${{ if and(ne(parameters.testGroup, 'innerloop'), eq(parameters.readyToRun, false)) }}:
34-
name: ${{ format('testbuild_pri1_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
35-
displayName: ${{ format('Test Pri1 {0} {1} {2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
36-
${{ if and(ne(parameters.testGroup, 'innerloop'), eq(parameters.readyToRun, true)) }}:
37-
name: ${{ format('testbuild_pri1_r2r_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
38-
displayName: ${{ format('Test Pri1 R2R {0} {1} {2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
29+
${{ if eq(parameters.testGroup, 'innerloop') }}:
30+
name: ${{ format('testbuild_pri0_{0}_{1}_{2}_{3}', parameters.displayNameArgs, parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
31+
displayName: ${{ format('Test Pri0 {0} {1} {2}_{3}', parameters.displayNameArgs, parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
32+
33+
${{ if ne(parameters.testGroup, 'innerloop') }}:
34+
name: ${{ format('testbuild_pri1_{0}_{1}_{2}_{3}', parameters.displayNameArgs, parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
35+
displayName: ${{ format('Test Pri1 {0} {1} {2} {3}', parameters.displayNameArgs, parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
3936

4037
crossrootfsDir: ${{ parameters.crossrootfsDir }}
4138

@@ -69,6 +66,16 @@ jobs:
6966
- name: clangArg
7067
value: '-clang5.0'
7168

69+
- name: testhostArg
70+
value: ''
71+
- ${{ if eq(parameters.corefxTests, true) }}:
72+
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
73+
- name: testhostArg
74+
value: 'generatetesthostonly'
75+
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
76+
- name: testhostArg
77+
value: 'buildtesthostonly'
78+
7279
# FreeBSD test jobs are disabled since we don't have any FreeBSD helix queues.
7380
${{ if eq(parameters.osGroup, 'FreeBSD') }}:
7481
condition: false
@@ -115,18 +122,18 @@ jobs:
115122

116123
# Build tests
117124
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
118-
- script: ./build-test.sh $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(crossgenArg) $(clangArg)
125+
- script: ./build-test.sh $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(crossgenArg) $(clangArg) $(testhostArg)
119126
displayName: Build tests
120127
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
121-
- script: build-test.cmd $(buildConfig) $(archType) $(priorityArg) $(crossgenArg)
128+
- script: build-test.cmd $(buildConfig) $(archType) $(priorityArg) $(crossgenArg) $(testhostArg)
122129
displayName: Build tests
123130

124131

125132
# Send tests to Helix
126133
- template: /eng/send-to-helix-step.yml
127134
parameters:
128135
displayName: Send tests to Helix
129-
buildConfig: ${{ parameters.buildConfig }}
136+
buildConfig: $(buildConfigUpper)
130137
archType: ${{ parameters.archType }}
131138
osGroup: ${{ parameters.osGroup }}
132139

@@ -172,6 +179,12 @@ jobs:
172179
# DotNet-HelixApi-Access variable group
173180
helixAccessToken: $(HelixApiAccessToken)
174181

182+
# Sets up the template to run the corefx tests
183+
${{ if eq(parameters.corefxTests, true) }}:
184+
helixProjectArguments: 'eng/helixcorefxtests.proj /t:Test /p:ArcadeBuild=True'
185+
${{ if eq(parameters.corefxTests, false) }}:
186+
helixProjectArguments: 'tests/helixpublishwitharcade.proj'
187+
175188
${{ if in(parameters.testGroup, 'innerloop', 'outerloop') }}:
176189
scenarios:
177190
- normal

0 commit comments

Comments
 (0)