From 71a1de06693870134574de0a812c1f03aeec0377 Mon Sep 17 00:00:00 2001 From: Matt Galbraith Date: Thu, 1 Jul 2021 11:38:53 -0700 Subject: [PATCH 1/3] Include Helix Docker image for test reporting Follow up from https://github.com/dotnet/arcade/pull/7383. This means we now depend on the Helix clients to do reporting, and the code path is somewhat different for Docker, so let's test one docker variation (Alpine chosen because it's small, and the original reason the Helix Docker feature exists) --- tests/UnitTests.proj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/UnitTests.proj b/tests/UnitTests.proj index e1f2e16a924..825442cbcf4 100644 --- a/tests/UnitTests.proj +++ b/tests/UnitTests.proj @@ -61,6 +61,7 @@ + @@ -73,6 +74,7 @@ + From f3faa7758d4dab5c64e8395364624693de8db8cd Mon Sep 17 00:00:00 2001 From: Matt Galbraith Date: Thu, 1 Jul 2021 14:02:42 -0700 Subject: [PATCH 2/3] Try with a non-MUSL linux flavor --- tests/UnitTests.proj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/UnitTests.proj b/tests/UnitTests.proj index 825442cbcf4..b200bcfd4a6 100644 --- a/tests/UnitTests.proj +++ b/tests/UnitTests.proj @@ -61,7 +61,7 @@ - + @@ -74,7 +74,7 @@ - + From 300c633ecd771a4c2d28f802369ca817792902b8 Mon Sep 17 00:00:00 2001 From: Matt Galbraith Date: Thu, 1 Jul 2021 15:03:05 -0700 Subject: [PATCH 3/3] Last try before creating an issue, use HELIX_WORKITEM_PAYLOAD instead of temp in docker case --- .../Microsoft.DotNet.Helix.Sdk.Tests/HelpersTests.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/HelpersTests.cs b/src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/HelpersTests.cs index 86c53ddee40..af88f34435f 100644 --- a/src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/HelpersTests.cs +++ b/src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/HelpersTests.cs @@ -43,6 +43,14 @@ public void VerifyNonEncodedFowardSlashIsConverted() public void FailOnceThenPass() { var target = Path.Combine(Path.GetTempPath(), "my-test-file-123456.snt"); + + // If we're inside a Helix Docker work item, GetTempPath() is cleaned every execution, + // but the work item's own directory is not (and is writeable from inside Docker), so use it. + if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DOCKER_ENTRYPOINT"))) + { + target = Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_PAYLOAD"), "my-test-file-123456.snt"); + } + bool exists = File.Exists(target); if (!exists) {