Skip to content
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

When generating Theory, wrap execution into try/catch #112031

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kant2002
Copy link
Contributor

so in case of failure it's possible detect what specific data parameters trigger an error.

Sample output

BEGIN EXECUTION
 "c:\d\runtime\artifacts\tests\coreclr\windows.x64.Release\Tests\Core_Root\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false" -p "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true"  ILVerificationTests.dll
System.Exception: Thrown during execution of the global::ILVerification.Tests.ILMethodTester.TestMethodsWithInvalidIL([FieldTests] LdsfldInitonlyInCtor (InitOnly))
 ---> Xunit.Sdk.EqualException: Assert.Equal() Failure: Values differ
Expected: 1
Actual:   0
   at Xunit.Assert.Equal[T](T expected, T actual, IEqualityComparer`1 comparer) in /_/src/Microsoft.DotNet.XUnitAssert/src/EqualityAsserts.cs:line 174
   at ILVerification.Tests.ILMethodTester.TestMethodsWithInvalidIL(InvalidILTestCase invalidIL) in C:\d\runtime\src\tests\ilverify\ILMethodTester.cs:line 47
   at ILVerification.Tests.ILMethodTester.TestMethodsWithInvalidIL(InvalidILTestCase invalidIL) in C:\d\runtime\src\tests\ilverify\ILMethodTester.cs:line 31
   at __GeneratedMainWrapper.Main() in C:\d\runtime\artifacts\tests\coreclr\obj\windows.x64.Release\Managed\ilverify\ILVerificationTests\XUnitWrapperGenerator\XUnitWrapperGenerator.XUnitWrapperGenerator\SimpleRunner.g.cs:line 24
   --- End of inner exception stack trace ---
   at __GeneratedMainWrapper.Main() in C:\d\runtime\artifacts\tests\coreclr\obj\windows.x64.Release\Managed\ilverify\ILVerificationTests\XUnitWrapperGenerator\XUnitWrapperGenerator.XUnitWrapperGenerator\SimpleRunner.g.cs:line 28
Expected: 100
Actual: 101
END EXECUTION - FAILED
FAILED

so in case of failure it's possible detect what specific data parameters trigger an error
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jan 31, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jan 31, 2025
@filipnavara filipnavara added area-Infrastructure-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Infrastructure-coreclr community-contribution Indicates that the PR has been added by a community member
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants