From 802b1e904d75013e08d5ae4bc958cd83c747bc5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 21 Nov 2024 19:38:10 +0100 Subject: [PATCH 1/6] Use temp directory as TestExecutionDirectory in RunTestsOnHelix.sh See if https://github.com/dotnet/sdk/issues/3923 is still an issue --- build/RunTestsOnHelix.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build/RunTestsOnHelix.sh b/build/RunTestsOnHelix.sh index 9474b2fcf119..15e4f4007805 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=$(mktemp -d "${TMPDIR:-/tmp}"/dotnetSdkTests.XXXXXXXX) export DOTNET_CLI_HOME=$TestExecutionDirectory/.dotnet cp -a $HELIX_CORRELATION_PAYLOAD/t/TestExecutionDirectoryFiles/. $TestExecutionDirectory/ @@ -36,4 +35,4 @@ 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 From 87be1166e876ce4f607f7c910b36d99f9d05a54f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 21 Nov 2024 19:39:56 +0100 Subject: [PATCH 2/6] Remove comment --- .../SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs b/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs index 65f2b992a07d..f54f6c7beb04 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"; From 0e57aa0866e0dc7404f6df93431f00a04f8b401d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Fri, 22 Nov 2024 12:22:27 +0100 Subject: [PATCH 3/6] Use realpath --- build/RunTestsOnHelix.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/RunTestsOnHelix.sh b/build/RunTestsOnHelix.sh index 15e4f4007805..640138d7d8f7 100644 --- a/build/RunTestsOnHelix.sh +++ b/build/RunTestsOnHelix.sh @@ -9,7 +9,7 @@ export MicrosoftNETBuildExtensionsTargets=$HELIX_CORRELATION_PAYLOAD/ex/msbuildE export DOTNET_ROOT=$HELIX_CORRELATION_PAYLOAD/d export PATH=$DOTNET_ROOT:$PATH -export TestExecutionDirectory=$(mktemp -d "${TMPDIR:-/tmp}"/dotnetSdkTests.XXXXXXXX) +export TestExecutionDirectory=$(realpath "$(mktemp -d "${TMPDIR:-/tmp}"/dotnetSdkTests.XXXXXXXX)") export DOTNET_CLI_HOME=$TestExecutionDirectory/.dotnet cp -a $HELIX_CORRELATION_PAYLOAD/t/TestExecutionDirectoryFiles/. $TestExecutionDirectory/ From d89a8be50cad8a60a859513f6fcfc6548ccf328e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Fri, 22 Nov 2024 16:12:21 +0100 Subject: [PATCH 4/6] Debugging --- .../SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs b/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs index f54f6c7beb04..a45f75da1dad 100644 --- a/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs +++ b/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs @@ -157,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 -method Microsoft.DotNet.Cli.Workload.Update.Tests.GivenDotnetWorkloadUpdate.GivenWorkloadUpdateAcrossFeatureBandsItUpdatesPacks {arguments}"; } Log.LogMessage($"Creating work item with properties Identity: {assemblyName}, PayloadDirectory: {publishDirectory}, Command: {command}"); From 424b4f59e9a99347092f1f1fdba46d5db348d243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Fri, 22 Nov 2024 16:40:06 +0100 Subject: [PATCH 5/6] Debugging --- .../SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs b/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs index a45f75da1dad..541163f81df5 100644 --- a/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs +++ b/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs @@ -158,7 +158,7 @@ private async Task> PrepareWorkItem(ITaskItem xunitProject) else { command = $"strace -f --trace=file {driver} exec {assemblyName} -e HELIX_WORK_ITEM_TIMEOUT={timeout} {testExecutionDirectory} {msbuildAdditionalSdkResolverFolder} " + - $"{(XUnitArguments != null ? " " + XUnitArguments : "")} -xml testResults.xml -method Microsoft.DotNet.Cli.Workload.Update.Tests.GivenDotnetWorkloadUpdate.GivenWorkloadUpdateAcrossFeatureBandsItUpdatesPacks {arguments}"; + $"{(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}"); From ba23c4b2e74bf5e782bcb1412e82837c267e57c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Fri, 22 Nov 2024 18:10:38 +0100 Subject: [PATCH 6/6] Debugging --- build/RunTestsOnHelix.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/RunTestsOnHelix.sh b/build/RunTestsOnHelix.sh index 640138d7d8f7..d7051fc20648 100644 --- a/build/RunTestsOnHelix.sh +++ b/build/RunTestsOnHelix.sh @@ -36,3 +36,5 @@ dotnet nuget remove source dotnet-tools-transport --configfile $TestExecutionDir 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 + +env