diff --git a/build/RunTestsOnHelix.sh b/build/RunTestsOnHelix.sh index 9474b2fcf119..d7051fc20648 100644 --- a/build/RunTestsOnHelix.sh +++ b/build/RunTestsOnHelix.sh @@ -9,8 +9,7 @@ export MicrosoftNETBuildExtensionsTargets=$HELIX_CORRELATION_PAYLOAD/ex/msbuildE export DOTNET_ROOT=$HELIX_CORRELATION_PAYLOAD/d export PATH=$DOTNET_ROOT:$PATH -export TestExecutionDirectory=$(pwd)/testExecutionDirectory -mkdir $TestExecutionDirectory +export TestExecutionDirectory=$(realpath "$(mktemp -d "${TMPDIR:-/tmp}"/dotnetSdkTests.XXXXXXXX)") export DOTNET_CLI_HOME=$TestExecutionDirectory/.dotnet cp -a $HELIX_CORRELATION_PAYLOAD/t/TestExecutionDirectoryFiles/. $TestExecutionDirectory/ @@ -36,4 +35,6 @@ dotnet nuget remove source dotnet-libraries-transport --configfile $TestExecutio dotnet nuget remove source dotnet-tools-transport --configfile $TestExecutionDirectory/NuGet.config dotnet nuget remove source dotnet-libraries --configfile $TestExecutionDirectory/NuGet.config dotnet nuget remove source dotnet-eng --configfile $TestExecutionDirectory/NuGet.config -dotnet nuget list source --configfile $TestExecutionDirectory/NuGet.config \ No newline at end of file +dotnet nuget list source --configfile $TestExecutionDirectory/NuGet.config + +env diff --git a/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs b/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs index 65f2b992a07d..541163f81df5 100644 --- a/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs +++ b/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs @@ -132,8 +132,6 @@ private async Task> PrepareWorkItem(ITaskItem xunitProject) throw new NotImplementedException("does not support non support the runtime specified"); } - // On mac due to https://github.com/dotnet/sdk/issues/3923, we run against workitem directory - // but on Windows, if we running against working item diretory, we would hit long path. string testExecutionDirectory = netFramework ? "-e DOTNET_SDK_TEST_EXECUTION_DIRECTORY=%TestExecutionDirectory%" : IsPosixShell ? "-testExecutionDirectory $TestExecutionDirectory" : "-testExecutionDirectory %TestExecutionDirectory%"; string msbuildAdditionalSdkResolverFolder = netFramework ? "-e DOTNET_SDK_TEST_MSBUILDSDKRESOLVER_FOLDER=%HELIX_CORRELATION_PAYLOAD%\\r" : IsPosixShell ? "" : "-msbuildAdditionalSdkResolverFolder %HELIX_CORRELATION_PAYLOAD%\\r"; @@ -159,8 +157,8 @@ private async Task> PrepareWorkItem(ITaskItem xunitProject) } else { - command = $"{driver} exec {assemblyName} -e HELIX_WORK_ITEM_TIMEOUT={timeout} {testExecutionDirectory} {msbuildAdditionalSdkResolverFolder} " + - $"{(XUnitArguments != null ? " " + XUnitArguments : "")} -xml testResults.xml {assemblyPartitionInfo.ClassListArgumentString} {arguments}"; + command = $"strace -f --trace=file {driver} exec {assemblyName} -e HELIX_WORK_ITEM_TIMEOUT={timeout} {testExecutionDirectory} {msbuildAdditionalSdkResolverFolder} " + + $"{(XUnitArguments != null ? " " + XUnitArguments : "")} -xml testResults.xml -class Microsoft.DotNet.Cli.Workload.Update.Tests.GivenDotnetWorkloadUpdate {arguments}"; } Log.LogMessage($"Creating work item with properties Identity: {assemblyName}, PayloadDirectory: {publishDirectory}, Command: {command}");