8000 Fix error message truncation by NikolaMilosavljevic · Pull Request #551 · dotnet/dotnet · GitHub
[go: up one dir, main page]

Skip to content

Fix error message truncation #551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

NikolaMilosavljevic
Copy link
Member

Fixes: dotnet/source-build#5141

Updated all instances of Assert.Null(message); with Assert.True(message == null, message);

Verified locally. Here's the produced output for a sample injected failure in poison tests:

Before:

  Error Message:
   Assert.Null() Failure: Value is not null
Expected: null
Actual:   "\nExpected file '/src/git/dotnet3/artifacts/bin/Mi"···

After:

  Error Message:

Expected file '/src/git/dotnet3/artifacts/bin/Microsoft.DotNet.SourceBuild.Tests/Release/assets/PoisonTests/PoisonUsage.txt' does not match actual file '/src/git/dotnet3/artifacts/TestResults/Release/UpdatedPoisonUsage.txt`.
diff --git a/src/git/dotnet3/artifacts/bin/Microsoft.DotNet.SourceBuild.Tests/Release/assets/PoisonTests/PoisonUsage.txt b/src/git/dotnet3/artifacts/TestResults/Release/UpdatedPoisonUsage.txt
index ebe355d179d..dbe36e0d43b 100644
--- a/src/git/dotnet3/artifacts/bin/Microsoft.DotNet.SourceBuild.Tests/Release/assets/PoisonTests/PoisonUsage.txt
+++ b/src/git/dotnet3/artifacts/TestResults/Release/UpdatedPoisonUsage.txt
@@ -1,6 +1,6 @@
 <PrebuiltLeakReport>
   <File Path="artifacts/assets/Release/Sdk/x.y.z/dotnet-sdk-x.y.z/packs/NETStandard.Library.Ref/x.y.z/ref/netstandard2.1/Microsoft.Win32.Primitives.dll">
-    <Type>bad</Type>
+    <Type>SourceBuildReferenceAssembly</Type>
   </File>
   <File Path="artifacts/assets/Release/Sdk/x.y.z/dotnet-sdk-x.y.z/packs/NETStandard.Library.Ref/x.y.z/ref/netstandard2.1/mscorlib.dll">
     <Type>SourceBuildReferenceAssembly</Type>

@NikolaMilosavljevic NikolaMilosavljevic requested review from a team as code owners May 14, 2025 19:41
Copy link
Member
@MichaelSimons MichaelSimons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this UX issue!

@NikolaMilosavljevic
Copy link
Member Author

Known issues in checks that are unrelated to my changes - merging.

@NikolaMilosavljevic NikolaMilosavljevic merged commit ae48124 into dotnet:main May 15, 2025
4 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Truncated test failure messages
2 participants
0