2
2
REM Disable "!Foo!" expansions because they break the filter syntax
3
3
setlocal disableextensions
4
4
5
- set target = %1
6
- set targetFrameworkIdentifier = %2
7
- set sdkVersion = %3
8
- set runtimeVersion = %4
9
- set helixQueue = %5
10
- set arch = %6
11
- set quarantined = %7
5
+ REM Use '$' as a variable name prefix to avoid MSBuild variable collisions with these variables
6
+ set $target = %1
7
+ set $ sdkVersion= %2
8
+ set $ runtimeVersion= %3
9
+ set $ helixQueue= %4
10
+ set $ arch= %5
11
+ set $ quarantined= %6
12
12
13
13
set DOTNET_HOME = %HELIX_CORRELATION_PAYLOAD% \sdk
14
- set DOTNET_ROOT = %DOTNET_HOME% \%arch%
14
+ set DOTNET_ROOT = %DOTNET_HOME% \%$ arch%
15
15
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
16
16
set DOTNET_MULTILEVEL_LOOKUP = 0
17
17
set DOTNET_CLI_HOME = %HELIX_CORRELATION_PAYLOAD% \home
18
18
19
19
set PATH = %DOTNET_ROOT% ;%PATH% ;%HELIX_CORRELATION_PAYLOAD% \node\bin
20
20
21
- powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command " [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) -Architecture %arch% -Version %sdkVersion% -InstallDir %DOTNET_ROOT% "
22
- powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command " [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) -Architecture %arch% -Runtime dotnet -Version %runtimeVersion% -InstallDir %DOTNET_ROOT% "
21
+ powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command " [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) -Architecture %$ arch% -Version %$ sdkVersion% -InstallDir %DOTNET_ROOT% "
22
+ powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command " [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) -Architecture %$ arch% -Runtime dotnet -Version %$ runtimeVersion% -InstallDir %DOTNET_ROOT% "
23
23
24
- set HELIX = %helixQueue%
24
+ set HELIX = %$ helixQueue%
25
25
26
- %DOTNET_ROOT% \dotnet vstest %target% -lt > discovered.txt
26
+ %DOTNET_ROOT% \dotnet vstest %$ target% -lt > discovered.txt
27
27
find /c " Exception thrown" discovered.txt
28
28
REM "ERRORLEVEL is not %ERRORLEVEL%" https://blogs.msdn.microsoft.com/oldnewthing/20080926-00/?p=20743/
29
29
if not errorlevel 1 (
@@ -34,11 +34,15 @@ if not errorlevel 1 (
34
34
35
35
set exit_code = 0
36
36
37
+ if %$quarantined% == True (
38
+ set %$quarantined = true
39
+ )
40
+
37
41
set NONQUARANTINE_FILTER = " Flaky:All!=true&Flaky:Helix:All ! =true&Flaky:Helix:Queue:All!=true&Flaky:Helix:Queue: %HELIX% ! =true"
38
42
set QUARANTINE_FILTER = " Flaky:All=true|Flaky:Helix:All=true|Flaky:Helix:Queue:All=true|Flaky:Helix:Queue:%HELIX% =true"
39
- if %quarantined% == true (
43
+ if %$ quarantined% == true (
40
44
echo Running quarantined tests.
41
- %DOTNET_ROOT% \dotnet vstest %target% --logger:xunit --TestCaseFilter:%QUARANTINE_FILTER%
45
+ %DOTNET_ROOT% \dotnet vstest %$ target% --logger:xunit --TestCaseFilter:%QUARANTINE_FILTER%
42
46
if errorlevel 1 (
43
47
echo Failure in flaky test 1 >& 2
44
48
REM DO NOT EXIT and DO NOT SET EXIT_CODE to 1
@@ -48,7 +52,7 @@ if %quarantined%==true (
48
52
REM only puts the explicit filter traits the user provided in
49
53
REM Filter syntax: https://github.com/Microsoft/vstest-docs/blob/master/docs/filter.md
50
54
echo Running non-quarantined tests.
51
- %DOTNET_ROOT% \dotnet vstest %target% --logger:xunit --TestCaseFilter:%NONQUARANTINE_FILTER%
55
+ %DOTNET_ROOT% \dotnet vstest %$ target% --logger:xunit --TestCaseFilter:%NONQUARANTINE_FILTER%
52
56
if errorlevel 1 (
53
57
echo Failure in non-flaky test 1 >& 2
54
58
set exit_code = 1
0 commit comments