-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathRunTestsOnHelix.cmd
More file actions
54 lines (44 loc) · 3.43 KB
/
RunTestsOnHelix.cmd
File metadata and controls
54 lines (44 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
REM make NuGet network operations more robust
set NUGET_ENABLE_EXPERIMENTAL_HTTP_RETRY=true
set NUGET_EXPERIMENTAL_MAX_NETWORK_TRY_COUNT=6
set NUGET_EXPERIMENTAL_NETWORK_RETRY_DELAY_MILLISECONDS=1000
set MicrosoftNETBuildExtensionsTargets=%HELIX_CORRELATION_PAYLOAD%\ex\msbuildExtensions\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets
set DOTNET_ROOT=%HELIX_CORRELATION_PAYLOAD%\d
set PATH=%DOTNET_ROOT%;%PATH%
set TestFullMSBuild=%1
REM Set DOTNET_HOST_PATH so MSBuild task hosts can locate the dotnet executable.
REM Without this, tasks from NuGet packages that use TaskHostFactory fail with MSB4216.
set DOTNET_HOST_PATH=%DOTNET_ROOT%\dotnet.exe
REM Ensure Visual Studio instances allow preview SDKs
PowerShell -ExecutionPolicy ByPass -NoProfile -File "%HELIX_CORRELATION_PAYLOAD%\t\eng\enable-preview-sdks.ps1"
REM Use powershell to call partical Arcade logic to get full framework msbuild path and assign it
if "%TestFullMSBuild%"=="true" (
FOR /F "tokens=*" %%g IN ('PowerShell -ExecutionPolicy ByPass -File "%HELIX_CORRELATION_PAYLOAD%\t\eng\print-full-msbuild-path.ps1"') do (SET DOTNET_SDK_TEST_MSBUILD_PATH=%%g)
)
REM Use powershell to run GetRandomFileName
FOR /F "tokens=*" %%g IN ('PowerShell -ExecutionPolicy ByPass [System.IO.Path]::GetRandomFileName^(^)') do (SET RandomDirectoryName=%%g)
set TestExecutionDirectory=%TEMP%\dotnetSdkTests\%RandomDirectoryName%
set DOTNET_CLI_HOME=%TestExecutionDirectory%\.dotnet
mkdir %TestExecutionDirectory%
REM https://stackoverflow.com/a/7487697/294804
robocopy %HELIX_CORRELATION_PAYLOAD%\t\TestExecutionDirectoryFiles %TestExecutionDirectory% /s /nfl /ndl /njh /njs /np
set DOTNET_SDK_TEST_EXECUTION_DIRECTORY=%TestExecutionDirectory%
set DOTNET_SDK_TEST_MSBUILDSDKRESOLVER_FOLDER=%HELIX_CORRELATION_PAYLOAD%\r
set DOTNET_SDK_TEST_ASSETS_DIRECTORY=%TestExecutionDirectory%\TestAssets
REM call dotnet new so the first run message doesn't interfere with the first test
dotnet new --debug:ephemeral-hive
dotnet nuget list source --configfile %TestExecutionDirectory%\nuget.config
if exist %TestExecutionDirectory%\Testpackages dotnet nuget add source %TestExecutionDirectory%\Testpackages --name testpackages --configfile %TestExecutionDirectory%\nuget.config
REM Remove feeds not needed for tests. Errors from non-existent sources
REM (e.g. internal-transport feeds only present in internal builds) are ignored.
dotnet nuget remove source dotnet6-transport --configfile %TestExecutionDirectory%\nuget.config 2>nul
dotnet nuget remove source dotnet6-internal-transport --configfile %TestExecutionDirectory%\nuget.config 2>nul
dotnet nuget remove source dotnet7-transport --configfile %TestExecutionDirectory%\nuget.config 2>nul
dotnet nuget remove source dotnet7-internal-transport --configfile %TestExecutionDirectory%\nuget.config 2>nul
dotnet nuget remove source richnav --configfile %TestExecutionDirectory%\nuget.config 2>nul
dotnet nuget remove source vs-impl --configfile %TestExecutionDirectory%\nuget.config 2>nul
dotnet nuget remove source dotnet-libraries-transport --configfile %TestExecutionDirectory%\nuget.config 2>nul
dotnet nuget remove source dotnet-tools-transport --configfile %TestExecutionDirectory%\nuget.config 2>nul
dotnet nuget remove source dotnet-libraries --configfile %TestExecutionDirectory%\nuget.config 2>nul
dotnet nuget remove source dotnet-eng --configfile %TestExecutionDirectory%\nuget.config 2>nul
dotnet nuget list source --configfile %TestExecutionDirectory%\nuget.config