Skip to content

Commit ff0709d

Browse files
committed
Switch to using the environment variable directly in the CLI call
1 parent 0cc58a2 commit ff0709d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ private async Task<List<ITaskItem>> PrepareWorkItem(ITaskItem xunitProject)
149149
foreach (var assemblyPartitionInfo in assemblyPartitionInfos)
150150
{
151151
string command;
152-
string logFileLocation = Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT"),"dotnetTestLog.log");
152+
string enableDiagLogging = IsPosixShell ? "-d $HELIX_WORKITEM_UPLOAD_ROOT//dotnetTestLog.log" : "-d %HELIX_WORKITEM_UPLOAD_ROOT%\\dotnetTestLog.log";
153153

154154
var testFilter = string.IsNullOrEmpty(assemblyPartitionInfo.ClassListArgumentString) ? "" : $"--filter \"{assemblyPartitionInfo.ClassListArgumentString}\"";
155155
command = $"{driver} test {assemblyName} -e HELIX_WORK_ITEM_TIMEOUT={timeout} {testExecutionDirectory} {msbuildAdditionalSdkResolverFolder} " +
156-
$"{(XUnitArguments != null ? " " + XUnitArguments : "")} --results-directory .{Path.DirectorySeparatorChar} --logger trx --blame-hang --blame-hang-timeout 15m {testFilter} -d {logFileLocation} -- {arguments}";
156+
$"{(XUnitArguments != null ? " " + XUnitArguments : "")} --results-directory .{Path.DirectorySeparatorChar} --logger trx --blame-hang --blame-hang-timeout 15m {testFilter} {enableDiagLogging} -- {arguments}";
157157

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

0 commit comments

Comments
 (0)