Skip to content

Commit f3ad3e7

Browse files
authored
Add a dotnet test diag log file
1 parent 877e63a commit f3ad3e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,11 @@ private async Task<List<ITaskItem>> PrepareWorkItem(ITaskItem xunitProject)
149149
foreach (var assemblyPartitionInfo in assemblyPartitionInfos)
150150
{
151151
string command;
152+
string logFileLocation = Path.Join(Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT"),"dotnetTestLog.log");
152153

153154
var testFilter = string.IsNullOrEmpty(assemblyPartitionInfo.ClassListArgumentString) ? "" : $"--filter \"{assemblyPartitionInfo.ClassListArgumentString}\"";
154155
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 15m {testFilter} -- {arguments}";
156+
$"{(XUnitArguments != null ? " " + XUnitArguments : "")} --results-directory .{Path.DirectorySeparatorChar} --logger trx --blame-hang --blame-hang-timeout 15m {testFilter} -d {logFileLocation} -- {arguments}";
156157

157158
Log.LogMessage($"Creating work item with properties Identity: {assemblyName}, PayloadDirectory: {publishDirectory}, Command: {command}");
158159

0 commit comments

Comments
 (0)