Skip to content

Commit 3f30ac6

Browse files
authored
September infra rollout - continued CoreCLR / Mono test cleanup (minimal) (#40345)
Similar to the previous occasion, I have identified this set as the minimum meaningful set of scripts to move without causing too much disruption apart from purely mechanical renames. This change moves the developer-facing test-related CoreCLR scripts under the src/tests folder in accordance with the previous move of the tests themselves: src/coreclr/build-test.cmd to src/tests/build.cmd src/coreclr/build-test.sh to src/tests/build.sh src/coreclr/tests/build.proj to src/tests/build.proj src/coreclr/tests/runtest.cmd to src/tests/run.cmd src/coreclr/tests/runtest.sh to src/tests/run.sh src/coreclr/tests/src/runtest.proj to src/tests/run.proj src/coreclr/tests/issues.targets to src/tests/issues.targets The rest of the change constitutes mere path adjustments to match the primary rename. Fixes: #38919 Thanks Tomas
1 parent 395fe0c commit 3f30ac6

File tree

16 files changed

+70
-73
lines changed

16 files changed

+70
-73
lines changed

eng/pipelines/common/templates/runtimes/build-test-job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
displayName: Disk Usage before Build
121121
122122
# Build managed test components
123-
- script: $(Build.SourcesDirectory)/src/coreclr/build-test$(scriptExt) allTargets skipstressdependencies skipnative skipgeneratelayout skiptestwrappers $(buildConfig) $(archType) $(crossArg) $(priorityArg) ci $(librariesOverrideArg)
123+
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) allTargets skipstressdependencies skipnative skipgeneratelayout skiptestwrappers $(buildConfig) $(archType) $(crossArg) $(priorityArg) ci $(librariesOverrideArg)
124124
displayName: Build managed test components
125125

126126
- ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}:

eng/pipelines/common/templates/runtimes/run-test-job.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,24 +244,24 @@ jobs:
244244
# and directly unzip them there after download). Unfortunately the logic to copy
245245
# the native artifacts to the final test folders is dependent on availability of the
246246
# managed test artifacts.
247-
- script: $(Build.SourcesDirectory)/src/coreclr/build-test$(scriptExt) skipstressdependencies copynativeonly $(crossgenArg) $(buildConfig) $(archType) $(priorityArg) $(librariesOverrideArg)
247+
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) skipstressdependencies copynativeonly $(crossgenArg) $(buildConfig) $(archType) $(priorityArg) $(librariesOverrideArg)
248248
displayName: Copy native test components to test output folder
249249

250250

251251
# Generate test wrappers. This is the step that examines issues.targets to exclude tests.
252-
- script: $(Build.SourcesDirectory)/src/coreclr/build-test$(scriptExt) buildtestwrappersonly $(runtimeFlavorArgs) $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg)
252+
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) buildtestwrappersonly $(runtimeFlavorArgs) $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg)
253253
displayName: Generate test wrappers
254254

255255

256256
# Compose the Core_Root folder containing all artifacts needed for running
257257
# CoreCLR tests.
258-
- script: $(Build.SourcesDirectory)/src/coreclr/build-test$(scriptExt) generatelayoutonly $(runtimeFlavorArgs) $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg)
258+
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) generatelayoutonly $(runtimeFlavorArgs) $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg)
259259
displayName: Generate CORE_ROOT
260260

261261

262262
# Crossgen framework assemblies prior to triggering readyToRun execution runs.
263263
- ${{ if eq(parameters.readyToRun, true) }}:
264-
- script: $(Build.SourcesDirectory)/src/coreclr/build-test$(scriptExt) crossgenframeworkonly $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg)
264+
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) crossgenframeworkonly $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg)
265265
displayName: Crossgen framework assemblies
266266

267267
# Overwrite coreclr runtime binaries with mono ones
@@ -274,7 +274,7 @@ jobs:
274274
displayName: "Patch dotnet with mono"
275275

276276
- ${{ if and(eq(parameters.runtimeFlavor, 'mono'), eq(parameters.runtimeVariant, 'llvmaot')) }}:
277-
- script: $(Build.SourcesDirectory)/src/coreclr/build-test$(scriptExt) mono_aot $(buildConfig)
277+
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) mono_aot $(buildConfig)
278278
displayName: "LLVM AOT compile CoreCLR tests"
279279

280280
# Send tests to Helix

eng/pipelines/common/templates/runtimes/wasm-runtime-and-send-to-helix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ parameters:
3030

3131

3232
steps:
33-
- script: $(Build.SourcesDirectory)/src/coreclr/build-test$(scriptExt) /p:LibrariesConfiguration=${{ parameters.buildConfig }} -ci -skipstressdependencies -excludemonofailures os Browser wasm $(buildConfigUpper)
33+
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) /p:LibrariesConfiguration=${{ parameters.buildConfig }} -ci -skipstressdependencies -excludemonofailures os Browser wasm $(buildConfigUpper)
3434
displayName: Build Tests
3535

3636
# Send tests to Helix

eng/pipelines/coreclr/templates/build-job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ jobs:
164164

165165
# Build native test components
166166
- ${{ if ne(parameters.isOfficialBuild, true) }}:
167-
- script: $(Build.SourcesDirectory)/src/coreclr/build-test$(scriptExt) skipstressdependencies skipmanaged skipgeneratelayout $(buildConfig) $(archType) $(crossArg) $(osArg) $(priorityArg) $(compilerArg)
167+
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) skipstressdependencies skipmanaged skipgeneratelayout $(buildConfig) $(archType) $(crossArg) $(osArg) $(priorityArg) $(compilerArg)
168168
displayName: Build native test components
169169

170170
# Sign and add entitlements to these MacOS binaries

eng/pipelines/coreclr/templates/crossgen-comparison-job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
displayName: 'live-built libraries'
105105

106106
# Populate Core_Root
107-
- script: $(Build.SourcesDirectory)/src/coreclr/build-test$(scriptExt) $(buildConfig) $(archType) $(crossArg) generatelayoutonly
107+
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(buildConfig) $(archType) $(crossArg) generatelayoutonly
108108
displayName: Populate Core_Root
109109

110110
# Create directories and ensure crossgen is executable

eng/pipelines/coreclr/templates/perf-job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
displayName: "Create wasm directory (Linux)"
111111

112112
# Create Core_Root
113-
- script: $(Build.SourcesDirectory)/src/coreclr/build-test$(scriptExt) $(buildConfig) $(archType) generatelayoutonly $(librariesOverrideArg)
113+
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(buildConfig) $(archType) generatelayoutonly $(librariesOverrideArg)
114114
displayName: Create Core_Root
115115
condition: and(succeeded(), ne(variables.runtimeFlavorName, 'Mono'))
116116

eng/pipelines/runtime.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ jobs:
115115
include:
116116
- src/tests/*
117117
- src/coreclr/tests/*
118-
- src/coreclr/build-test.cmd
119-
- src/coreclr/build-test.sh
120118
- subset: installer
121119
include:
122120
- docs/manpages/*

eng/pipelines/runtimelab/runtimelab-post-build-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ parameters:
77

88
steps:
99
# Build coreclr native test output
10-
- script: $(Build.SourcesDirectory)/src/coreclr/build-test$(scriptExt) skipstressdependencies skipmanaged skipgeneratelayout $(buildConfigUpper) ${{ parameters.archType }}
10+
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) skipstressdependencies skipmanaged skipgeneratelayout $(buildConfigUpper) ${{ parameters.archType }}
1111
displayName: Build native test components
1212

1313
# Copy all build output into artifacts staging directory

src/coreclr/tests/runtest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ def call_msbuild(args):
611611

612612
command = [args.dotnetcli_script_path,
613613
"msbuild",
614-
os.path.join(args.coreclr_tests_src_dir, "runtest.proj"),
614+
os.path.join(args.coreclr_tests_src_dir, "run.proj"),
615615
"/p:Runtests=true",
616616
"/clp:showcommandline"]
617617

@@ -1158,7 +1158,7 @@ def setup_args(args):
11581158
coreclr_setup_args.corerun_path = os.path.join(coreclr_setup_args.core_root, "corerun%s" % (".exe" if coreclr_setup_args.host_os == "Windows_NT" else ""))
11591159
coreclr_setup_args.dotnetcli_script_path = os.path.join(coreclr_setup_args.runtime_repo_location, "dotnet%s" % (".cmd" if coreclr_setup_args.host_os == "Windows_NT" else ".sh"))
11601160
coreclr_setup_args.coreclr_tests_dir = os.path.join(coreclr_setup_args.coreclr_dir, "tests")
1161-
coreclr_setup_args.coreclr_tests_src_dir = os.path.join(coreclr_setup_args.coreclr_tests_dir, "src")
1161+
coreclr_setup_args.coreclr_tests_src_dir = os.path.join(coreclr_setup_args.runtime_repo_location, "src", "tests")
11621162
coreclr_setup_args.runincontext_script_path = os.path.join(coreclr_setup_args.coreclr_tests_dir, "scripts", "runincontext%s" % (".cmd" if coreclr_setup_args.host_os == "Windows_NT" else ".sh"))
11631163
coreclr_setup_args.logs_dir = os.path.join(coreclr_setup_args.artifacts_location, "log")
11641164

src/coreclr/build-test.cmd renamed to src/tests/build.cmd

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@ set "__MsgPrefix=BUILDTEST: "
77

88
echo %__MsgPrefix%Starting Build at %TIME%
99

10+
set "__ProjectDir=%~dp0"
11+
:: remove trailing slash
12+
if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
13+
set "__RepoRootDir=%__ProjectDir%\..\.."
14+
for %%i in ("%__RepoRootDir%") do SET "__RepoRootDir=%%~fi"
1015

11-
set __ThisScriptDir="%~dp0"
16+
set "__TestDir=%__RepoRootDir%\src\tests"
1217

13-
call "%__ThisScriptDir%"\setup_vs_tools.cmd
18+
call %__RepoRootDir%\src\coreclr\setup_vs_tools.cmd
1419
if NOT '%ERRORLEVEL%' == '0' exit /b 1
1520

1621
if defined VS160COMNTOOLS (
@@ -28,21 +33,14 @@ set __BuildArch=x64
2833
set __BuildType=Debug
2934
set __TargetOS=Windows_NT
3035

31-
set "__ProjectDir=%~dp0"
32-
:: remove trailing slash
33-
if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
34-
set "__RepoRootDir=%__ProjectDir%\..\.."
35-
for %%i in ("%__RepoRootDir%") do SET "__RepoRootDir=%%~fi"
36-
37-
set "__TestDir=%__RepoRootDir%\src\tests"
3836
set "__ProjectFilesDir=%__TestDir%"
39-
set "__SourceDir=%__ProjectDir%\src"
37+
set "__SourceDir=%__RepoRootDir%\src\coreclr\src"
4038
set "__RootBinDir=%__RepoRootDir%\artifacts"
4139
set "__LogsDir=%__RootBinDir%\log"
4240
set "__MsbuildDebugLogsDir=%__LogsDir%\MsbuildDebugLogs"
4341

4442
:: Default __Exclude to issues.targets
45-
set __Exclude=%__ProjectDir%\tests\issues.targets
43+
set __Exclude=%__RepoRootDir%\src\tests\issues.targets
4644

4745
REM __UnprocessedBuildArgs are args that we pass to msbuild (e.g. /p:TargetArchitecture=x64)
4846
set "__args= %*"
@@ -204,7 +202,7 @@ REM ============================================================================
204202

205203
if defined __SkipStressDependencies goto skipstressdependencies
206204

207-
call "%__ProjectDir%\tests\setup-stress-dependencies.cmd" /arch %__BuildArch% /outputdir %__BinDir%
205+
call "%__RepoRootDir%\src\coreclr\tests\setup-stress-dependencies.cmd" /arch %__BuildArch% /outputdir %__BinDir%
208206
if errorlevel 1 (
209207
echo %__ErrMsgPrefix%%__MsgPrefix%Error: setup-stress-dependencies failed.
210208
goto :Exit_Failure
@@ -312,7 +310,7 @@ set __MsbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
312310
set __Logging='!__MsbuildLog!' '!__MsbuildWrn!' '!__MsbuildErr!'
313311

314312
powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -Command "%__RepoRootDir%\eng\common\msbuild.ps1" %__ArcadeScriptArgs%^
315-
%__ProjectDir%\tests\build.proj -warnAsError:0 /t:BatchRestorePackages /nodeReuse:false^
313+
%__RepoRootDir%\src\tests\build.proj -warnAsError:0 /t:BatchRestorePackages /nodeReuse:false^
316314
/p:RestoreDefaultOptimizationDataPackage=false /p:PortableBuild=true^
317315
/p:UsePartialNGENOptimization=false /maxcpucount^
318316
%__SkipFXRestoreArg%^
@@ -339,7 +337,7 @@ if defined __SkipManaged goto SkipManagedBuild
339337
echo %__MsgPrefix%Starting the Managed Tests Build
340338

341339
if not defined VSINSTALLDIR (
342-
echo %__ErrMsgPrefix%%__MsgPrefix%Error: build-test.cmd should be run from a Visual Studio Command Prompt. Please see https://github.com/dotnet/runtime/tree/master/docs/workflow for build instructions.
340+
echo %__ErrMsgPrefix%%__MsgPrefix%Error: build.cmd should be run from a Visual Studio Command Prompt. Please see https://github.com/dotnet/runtime/tree/master/docs/workflow for build instructions.
343341
exit /b 1
344342
)
345343
set __AppendToLog=false
@@ -370,7 +368,7 @@ for /l %%G in (1, 1, %__NumberOfTestGroups%) do (
370368
set __TestGroupToBuild=%%G
371369

372370
if not "%__CopyNativeTestBinaries%" == "1" (
373-
set __MSBuildBuildArgs=!__ProjectDir!\tests\build.proj
371+
set __MSBuildBuildArgs=!__RepoRootDir!\src\tests\build.proj
374372
set __MSBuildBuildArgs=!__MSBuildBuildArgs! -warnAsError:0
375373
set __MSBuildBuildArgs=!__MSBuildBuildArgs! /nodeReuse:false
376374
set __MSBuildBuildArgs=!__MSBuildBuildArgs! !__Logging!
@@ -390,12 +388,12 @@ for /l %%G in (1, 1, %__NumberOfTestGroups%) do (
390388
echo %__BuildWrn%
391389
echo %__BuildErr%
392390
REM This is necessary because of a(n apparent) bug in the FOR /L command. Under certain circumstances,
393-
REM such as when this script is invoke with CMD /C "build-test.cmd", a non-zero exit directly from
391+
REM such as when this script is invoke with CMD /C "build.cmd", a non-zero exit directly from
394392
REM within the loop body will not propagate to the caller. For some reason, goto works around it.
395393
goto :Exit_Failure
396394
)
397395
) else (
398-
set __MSBuildBuildArgs=!__ProjectDir!\tests\build.proj -warnAsError:0 /nodeReuse:false !__Logging! !TargetsWindowsMsbuildArg! !__msbuildArgs! !__PriorityArg! !__BuildNeedTargetArg! !__SkipFXRestoreArg! !__UnprocessedBuildArgs! "/t:CopyAllNativeProjectReferenceBinaries"
396+
set __MSBuildBuildArgs=!__RepoRootDir!\src\tests\build.proj -warnAsError:0 /nodeReuse:false !__Logging! !TargetsWindowsMsbuildArg! !__msbuildArgs! !__PriorityArg! !__BuildNeedTargetArg! !__SkipFXRestoreArg! !__UnprocessedBuildArgs! "/t:CopyAllNativeProjectReferenceBinaries"
399397
echo Running: msbuild !__MSBuildBuildArgs!
400398
!__CommonMSBuildCmdPrefix! !__MSBuildBuildArgs!
401399

@@ -405,7 +403,7 @@ for /l %%G in (1, 1, %__NumberOfTestGroups%) do (
405403
echo %__BuildWrn%
406404
echo %__BuildErr%
407405
REM This is necessary because of a(n apparent) bug in the FOR /L command. Under certain circumstances,
408-
REM such as when this script is invoke with CMD /C "build-test.cmd", a non-zero exit directly from
406+
REM such as when this script is invoke with CMD /C "build.cmd", a non-zero exit directly from
409407
REM within the loop body will not propagate to the caller. For some reason, goto works around it.
410408
goto :Exit_Failure
411409
)
@@ -421,9 +419,9 @@ if "%__CopyNativeTestBinaries%" == "1" goto :SkipManagedBuild
421419
REM Check that we've built about as many tests as we expect. This is primarily intended to prevent accidental changes that cause us to build
422420
REM drastically fewer Pri-1 tests than expected.
423421
echo %__MsgPrefix%Check the managed tests build
424-
echo Running: dotnet msbuild %__ProjectDir%\tests\src\runtest.proj /t:CheckTestBuild /nodeReuse:false /p:CLRTestPriorityToBuild=%__Priority% %__SkipFXRestoreArg% %__msbuildArgs% %__unprocessedBuildArgs%
422+
echo Running: dotnet msbuild %__RepoRootDir%\src\tests\run.proj /t:CheckTestBuild /nodeReuse:false /p:CLRTestPriorityToBuild=%__Priority% %__SkipFXRestoreArg% %__msbuildArgs% %__unprocessedBuildArgs%
425423
powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__RepoRootDir%\eng\common\msbuild.ps1" %__ArcadeScriptArgs%^
426-
%__ProjectDir%\tests\src\runtest.proj /t:CheckTestBuild /nodeReuse:false /p:CLRTestPriorityToBuild=%__Priority% %__msbuildArgs% %__unprocessedBuildArgs%
424+
%__RepoRootDir%\src\tests\run.proj /t:CheckTestBuild /nodeReuse:false /p:CLRTestPriorityToBuild=%__Priority% %__msbuildArgs% %__unprocessedBuildArgs%
427425
if errorlevel 1 (
428426
echo %__ErrMsgPrefix%%__MsgPrefix%Error: Check Test Build failed.
429427
exit /b 1
@@ -472,7 +470,7 @@ set __MsbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
472470
set __Logging=!__MsbuildLog! !__MsbuildWrn! !__MsbuildErr!
473471

474472
powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__RepoRootDir%\eng\common\msbuild.ps1" %__ArcadeScriptArgs%^
475-
%__ProjectDir%\tests\src\runtest.proj /t:CreateTestOverlay /nodeReuse:false^
473+
%__RepoRootDir%\src\tests\run.proj /t:CreateTestOverlay /nodeReuse:false^
476474
/p:RestoreDefaultOptimizationDataPackage=false /p:PortableBuild=true^
477475
/p:UsePartialNGENOptimization=false /maxcpucount^
478476
%__SkipFXRestoreArg%^
@@ -517,7 +515,7 @@ if %%__Mono%%==1 (
517515
)
518516

519517
REM Build wrappers using the local SDK's msbuild. As we move to arcade, the other builds should be moved away from run.exe as well.
520-
call "%__RepoRootDir%\dotnet.cmd" msbuild %__ProjectDir%\tests\src\runtest.proj /nodereuse:false /p:BuildWrappers=true /p:TestBuildMode=%__TestBuildMode% !__Logging! %__msbuildArgs% %TargetsWindowsMsbuildArg% %__SkipFXRestoreArg% %__UnprocessedBuildArgs% /p:RuntimeFlavor=%RuntimeFlavor%
518+
call "%__RepoRootDir%\dotnet.cmd" msbuild %__RepoRootDir%\src\tests\run.proj /nodereuse:false /p:BuildWrappers=true /p:TestBuildMode=%__TestBuildMode% !__Logging! %__msbuildArgs% %TargetsWindowsMsbuildArg% %__SkipFXRestoreArg% %__UnprocessedBuildArgs% /p:RuntimeFlavor=%RuntimeFlavor%
521519
if errorlevel 1 (
522520
echo %__ErrMsgPrefix%%__MsgPrefix%Error: XUnit wrapper build failed. Refer to the build log files for details:
523521
echo %__BuildLog%

0 commit comments

Comments
 (0)