Skip to content

Commit af4ddb4

Browse files
committed
try to write binlogs to helix upload root
1 parent dc4dca6 commit af4ddb4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/Microsoft.NET.ToolPack.Tests/GivenThatWeWantToPackAToolProjectWithPackagedShim.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,16 @@ public void It_uses_customized_PackagedShimOutputRootDirectory(bool multiTarget,
157157

158158
var packCommand = new PackCommand(Log, helloWorldAsset.TestRoot);
159159

160-
packCommand.Execute("-bl:{}").Should().Pass();
160+
var result = packCommand.Execute("-bl:{}");
161+
if (Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT") is string uploadRoot)
162+
{
163+
var binlogFiles = Directory.GetFiles(helloWorldAsset.TestRoot, "*.binlog");
164+
foreach (string binlogFile in binlogFiles)
165+
{
166+
File.Copy(binlogFile, Path.Combine(uploadRoot, Path.GetFileName(binlogFile)), true);
167+
}
168+
}
169+
result.Should().Pass();
161170

162171
string windowShimPath = Path.Combine(shimoutputPath, $"shims/{targetFramework}/win-x64/{_customToolCommandName}.exe");
163172
File.Exists(windowShimPath).Should().BeTrue($"Shim {windowShimPath} should exist");

0 commit comments

Comments
 (0)