File tree Expand file tree Collapse file tree 5 files changed +16
-9
lines changed Expand file tree Collapse file tree 5 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 1
1
set target = %1
2
2
set sdkVersion = %2
3
3
set runtimeVersion = %3
4
+ set helixQueue = %4
4
5
5
6
set DOTNET_HOME = %HELIX_CORRELATION_PAYLOAD% \sdk
6
7
set DOTNET_ROOT = %DOTNET_HOME% \x64
@@ -13,7 +14,7 @@ set PATH=%DOTNET_ROOT%;%PATH%
13
14
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 x64 -Version %sdkVersion% -InstallDir %DOTNET_ROOT% "
14
15
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 x64 -Runtime dotnet -Version %runtimeVersion% -InstallDir %DOTNET_ROOT% "
15
16
16
- set HELIX = true
17
+ set HELIX = %helixQueue%
17
18
18
19
%DOTNET_ROOT% \dotnet vstest %target% -lt > discovered.txt
19
20
find /c " Exception thrown" discovered.txt
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ export DOTNET_MULTILEVEL_LOOKUP=0
58
58
# Avoid contaminating userprofiles
59
59
export DOTNET_CLI_HOME=" $HELIX_CORRELATION_PAYLOAD /home"
60
60
61
- export helix=" true "
61
+ export helix=" $4 "
62
62
63
63
$DOTNET_ROOT /dotnet vstest $1 -lt > discovered.txt
64
64
if grep -q " Exception thrown" discovered.txt; then
Original file line number Diff line number Diff line change 1
1
set target = %1
2
- set helix = true
2
+ set helix = %4
3
3
xunit.console.exe %target% -xml testResults.xml
Original file line number Diff line number Diff line change 64
64
<TestAssembly >$(TargetFileName)</TestAssembly >
65
65
<PreCommands >@(HelixPreCommand)</PreCommands >
66
66
<PostCommands >@(HelixPostCommand)</PostCommands >
67
- <Command Condition =" $(IsWindowsHelixQueue)" >call runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppPackageVersion)</Command >
68
- <Command Condition =" !$(IsWindowsHelixQueue)" >./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppPackageVersion)</Command >
67
+ <Command Condition =" $(IsWindowsHelixQueue)" >call runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppPackageVersion) $(HelixTargetQueue) </Command >
68
+ <Command Condition =" !$(IsWindowsHelixQueue)" >./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppPackageVersion) $(HelixTargetQueue) </Command >
69
69
<Timeout >$(HelixTimeout)</Timeout >
70
70
</HelixWorkItem >
71
71
</ItemGroup >
Original file line number Diff line number Diff line change 2
2
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3
3
4
4
using System ;
5
+ using System . Linq ;
5
6
6
7
namespace Microsoft . AspNetCore . Testing . xunit
7
8
{
8
9
/// <summary>
9
- /// Skip test if a given environment variable is not enabled. To enable the test, set environment variable
10
- /// to "true" for the test process.
10
+ /// Skip test if running on helix (or a particular helix queue).
11
11
/// </summary>
12
12
[ AttributeUsage ( AttributeTargets . Method | AttributeTargets . Class , AllowMultiple = false ) ]
13
13
public class SkipOnHelixAttribute : Attribute , ITestCondition
@@ -16,10 +16,14 @@ public bool IsMet
16
16
{
17
17
get
18
18
{
19
- return ! OnHelix ( ) ;
19
+ var skip = OnHelix ( ) && ( Queues == null || Queues . ToLowerInvariant ( ) . Split ( ";" ) . Contains ( GetTargetHelixQueue ( ) . ToLowerInvariant ( ) ) ) ;
20
+ return ! skip ;
20
21
}
21
22
}
22
23
24
+ // Queues that should be skipped on, i.e. "Windows.10.Amd64.ClientRS4.VS2017.Open;OSX.1012.Amd64.Open"
25
+ public string Queues { get ; set ; }
26
+
23
27
public string SkipReason
24
28
{
25
29
get
@@ -28,6 +32,8 @@ public string SkipReason
28
32
}
29
33
}
30
34
31
- public static bool OnHelix ( ) => string . Equals ( Environment . GetEnvironmentVariable ( "helix" ) , "true" , StringComparison . OrdinalIgnoreCase ) ;
35
+ public static bool OnHelix ( ) => ! string . IsNullOrEmpty ( GetTargetHelixQueue ( ) ) ;
36
+
37
+ public static string GetTargetHelixQueue ( ) => Environment . GetEnvironmentVariable ( "helix" ) ;
32
38
}
33
39
}
You can’t perform that action at this time.
0 commit comments