@@ -121,11 +121,9 @@ private async Task<List<ITaskItem>> PrepareWorkItem(ITaskItem xunitProject)
121
121
// These tests have to be executed slightly differently and we give them a different Identity so ADO can tell them apart
122
122
var runtimeTargetFrameworkParsed = NuGetFramework . Parse ( runtimeTargetFramework ) ;
123
123
var testIdentityDifferentiator = "" ;
124
- bool netFramework = false ;
125
124
if ( runtimeTargetFrameworkParsed . Framework == ".NETFramework" )
126
125
{
127
126
testIdentityDifferentiator = ".netfx" ;
128
- netFramework = true ;
129
127
}
130
128
else if ( runtimeTargetFrameworkParsed . Framework != ".NETCoreApp" )
131
129
{
@@ -134,9 +132,9 @@ private async Task<List<ITaskItem>> PrepareWorkItem(ITaskItem xunitProject)
134
132
135
133
// On mac due to https://github.com/dotnet/sdk/issues/3923, we run against workitem directory
136
134
// but on Windows, if we running against working item diretory, we would hit long path.
137
- string testExecutionDirectory = netFramework ? "-e DOTNET_SDK_TEST_EXECUTION_DIRECTORY=%TestExecutionDirectory%" : IsPosixShell ? "-testExecutionDirectory $TestExecutionDirectory" : "-testExecutionDirectory %TestExecutionDirectory%" ;
135
+ string testExecutionDirectory = IsPosixShell ? "-e DOTNET_SDK_TEST_EXECUTION_DIRECTORY=$TestExecutionDirectory" : "-e DOTNET_SDK_TEST_EXECUTION_DIRECTORY= %TestExecutionDirectory%" ;
138
136
139
- string msbuildAdditionalSdkResolverFolder = netFramework ? "-e DOTNET_SDK_TEST_MSBUILDSDKRESOLVER_FOLDER=%HELIX_CORRELATION_PAYLOAD% \\ r" : IsPosixShell ? "" : "-msbuildAdditionalSdkResolverFolder %HELIX_CORRELATION_PAYLOAD%\\ r" ;
137
+ string msbuildAdditionalSdkResolverFolder = IsPosixShell ? "" : "-e DOTNET_SDK_TEST_MSBUILDSDKRESOLVER_FOLDER= %HELIX_CORRELATION_PAYLOAD%\\ r" ;
140
138
141
139
if ( ExcludeAdditionalParameters . Equals ( "true" ) )
142
140
{
@@ -145,23 +143,16 @@ private async Task<List<ITaskItem>> PrepareWorkItem(ITaskItem xunitProject)
145
143
}
146
144
147
145
var scheduler = new AssemblyScheduler ( methodLimit : ! string . IsNullOrEmpty ( Environment . GetEnvironmentVariable ( "TestFullMSBuild" ) ) ? 32 : 16 ) ;
148
- var assemblyPartitionInfos = scheduler . Schedule ( targetPath , netFramework : netFramework ) ;
146
+ var assemblyPartitionInfos = scheduler . Schedule ( targetPath ) ;
149
147
150
148
var partitionedWorkItem = new List < ITaskItem > ( ) ;
151
149
foreach ( var assemblyPartitionInfo in assemblyPartitionInfos )
152
150
{
153
151
string command ;
154
- if ( netFramework )
155
- {
156
- var testFilter = string . IsNullOrEmpty ( assemblyPartitionInfo . ClassListArgumentString ) ? "" : $ "--filter \" { assemblyPartitionInfo . ClassListArgumentString } \" ";
157
- command = $ "{ driver } test { assemblyName } -e HELIX_WORK_ITEM_TIMEOUT={ timeout } { testExecutionDirectory } { msbuildAdditionalSdkResolverFolder } " +
158
- $ "{ ( XUnitArguments != null ? " " + XUnitArguments : "" ) } --results-directory .\\ --logger trx { testFilter } ";
159
- }
160
- else
161
- {
162
- command = $ "{ driver } exec { assemblyName } -e HELIX_WORK_ITEM_TIMEOUT={ timeout } { testExecutionDirectory } { msbuildAdditionalSdkResolverFolder } " +
163
- $ "{ ( XUnitArguments != null ? " " + XUnitArguments : "" ) } -xml testResults.xml { assemblyPartitionInfo . ClassListArgumentString } { arguments } ";
164
- }
152
+
153
+ var testFilter = string . IsNullOrEmpty ( assemblyPartitionInfo . ClassListArgumentString ) ? "" : $ "--filter \" { assemblyPartitionInfo . ClassListArgumentString } \" ";
154
+ command = $ "{ driver } test { assemblyName } -e HELIX_WORK_ITEM_TIMEOUT={ timeout } { testExecutionDirectory } { msbuildAdditionalSdkResolverFolder } " +
155
+ $ "{ ( XUnitArguments != null ? " " + XUnitArguments : "" ) } --results-directory .{ Path . DirectorySeparatorChar } --logger trx --blame-hang --blame-hang-timeout 30m { testFilter } -- { arguments } ";
165
156
166
157
Log . LogMessage ( $ "Creating work item with properties Identity: { assemblyName } , PayloadDirectory: { publishDirectory } , Command: { command } ") ;
167
158
0 commit comments