Skip to content

Commit b65f049

Browse files
Add command tracing to publish tests for better diagnostics
Co-authored-by: kirankumarkolli <6880899+kirankumarkolli@users.noreply.github.com>
1 parent c2460bf commit b65f049

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/MSBuild/CosmosTargetsPublishTests.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ private string PublishProject(string projectFile, string runtimeIdentifier)
178178
CreateNoWindow = true
179179
};
180180

181+
// Trace the command being executed for debugging
182+
string commandLine = $"{processInfo.FileName} {processInfo.Arguments}";
183+
Console.WriteLine($"Executing: {commandLine}");
184+
Console.WriteLine($"Working directory: {projectDir}");
185+
181186
using (var process = Process.Start(processInfo))
182187
{
183188
process.WaitForExit(timeout: TimeSpan.FromMinutes(5));
@@ -187,7 +192,11 @@ private string PublishProject(string projectFile, string runtimeIdentifier)
187192

188193
if (process.ExitCode != 0)
189194
{
190-
Assert.Fail($"dotnet publish failed for {runtimeIdentifier}.\nOutput: {output}\nError: {error}");
195+
Assert.Fail($"dotnet publish failed for {runtimeIdentifier}.\nCommand: {commandLine}\nOutput: {output}\nError: {error}");
196+
}
197+
else
198+
{
199+
Console.WriteLine($"Publish succeeded for {runtimeIdentifier}. Exit code: {process.ExitCode}");
191200
}
192201
}
193202

0 commit comments

Comments
 (0)