-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Use the Xunit assert library instead of CoreCLRTestLibrary for most asserts #61226
Conversation
…sserts. Asserts not provided by Xunit are provided by an AssertExtensions class. Tests that reference System.Private.Corelib directly will use a polyfill implementation based off the old CoreCLRTestLibrary asserts. All assert methods provided by CoreCLRTestLibrary have been changed to follow Xunit conventions.
Tagging subscribers to this area: @hoyosjs Issue DetailsAsserts not provided by Xunit are provided by an AssertExtensions class. Tests that reference System.Private.Corelib directly will use a polyfill implementation based off the old CoreCLRTestLibrary asserts. All assert methods provided by CoreCLRTestLibrary have been changed to follow Xunit conventions (this is why the change is so noisy). This contribues to our move towards more xunit-style tests in the src/tests tree, just with a custom runner (as part of the test merging initiative). cc: @trylek for review cc: @elinor-fung and @AaronRobinsonMSFT as the Interop team owns or has worked on most of the tests that are modified by this change.
|
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be useful to add a bullet about test utilities / asserts to https://github.com/dotnet/runtime/blob/main/docs/workflow/testing/coreclr/test-configuration.md#adding-test-guidelines?
CollectionEqual ended up in infinite recursion as the array variant no longer accepts the third string argument (there's no use for it as Assert.Equal no longer supports it; after all, a single test was using it) so that the enumerable variant ended up calling itself instead of the array variant. I have removed the message string and I deleted it from the one ResolveUnmanagedDllTests source. In ThrowsWithInnerException there was a typo, there should be "is TInner" in the inner exception check, not "is T". Thanks Tomas
@tylek I think there's a conflicting change that got merged in before this one. Can you check the Pri0 test build and make sure it isn't broken? (I'm not near my computer otherwise I'd do it myself) |
Is failure like this https://dev.azure.com/dnceng/public/_build/results?buildId=1458028&view=logs&jobId=e2abd64e-6d96-553c-c262-deb1bd067c99&j=e2abd64e-6d96-553c-c262-deb1bd067c99&t=1849d1b9-84d9-551e-f982-c77c09278369 related?
|
Asserts not provided by Xunit are provided by an AssertExtensions class.
Tests that reference System.Private.Corelib directly will use a polyfill implementation based off the old CoreCLRTestLibrary asserts.
All assert methods provided by CoreCLRTestLibrary have been changed to follow Xunit conventions (this is why the change is so noisy).
This contribues to our move towards more xunit-style tests in the src/tests tree, just with a custom runner (as part of the test merging initiative).
cc: @trylek for review
cc: @elinor-fung and @AaronRobinsonMSFT as the Interop team owns or has worked on most of the tests that are modified by this change.