-
Notifications
You must be signed in to change notification settings - Fork 595
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
Switch to Verify for API approval test #820
Conversation
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.
Thank you. On MacOS, the .NET 4.6.1 version fails with
dotnet test projects/Unit --filter "FullyQualifiedName~RabbitMQ.Client.Unit.APIApproval" Test run for /Users/antares/Development/RabbitMQ/umbrella.git/deps/rabbitmq_dotnet_client/projects/Unit/bin/Debug/net461/Unit.dll(.NETFramework,Version=v4.6.1)
Microsoft (R) Test Execution Command Line Tool Version 16.3.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
X Approve [382ms]
Error Message:
System.TypeInitializationException : The type initializer for 'Verify.SharedVerifySettings' threw an exception.
----> System.TypeInitializationException : The type initializer for 'Verify.Namer' threw an exception.
----> System.Exception : Could not resolve runtime for 'Mono 6.8.0.105 (tarball Tue Feb 4 20:29:35 GMT 2020)'.
Stack Trace:
at RabbitMQ.Client.Unit.APIApproval.Approve () [0x00032] in <0736cef46ef144f48e43a2dea3523e23>:0
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <b6f643ae6ccb410db69142d5eaf9b9c1>:0
--TypeInitializationException
at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
at Verify.SharedVerifySettings..cctor () [0x0000a] in <b6c99d0af76340b597c1067a1db4155d>:0
--Exception
at Verify.Namer.GetRuntimeAndVersion () [0x00064] in <b6c99d0af76340b597c1067a1db4155d>:0
at Verify.Namer..cctor () [0x00000] in <b6c99d0af76340b597c1067a1db4155d>:0
Test Run Failed.
Total tests: 1
Failed: 1
while the .NET Core 3.1 target passes. Should we make this approval test specific to .NET Core to avoid such issues? It would still serve its purpose.
You really shouldn't be trying to run the 4.6.1 tests on non-Windows OSes. That will try to run them with mono, and who knows if that will work. |
Fair enough. I have added a pragma to skip this test. If we run into more Mono-specific issues we can consider doing this for all tests. I'm not sure what would be the best way to do that with NUnit, though. |
Please don't skip the test on 4.6.1, it's important it runs on both. You just need to not run the 4.6.1 tests when you're not on Windows. |
@bording OK, how do I do that? |
Since there are separate assemblies for each target framework, it's actually possible that there could be unintentional differences in the public API surface, for example through
|
@bording I will skip the test only on Mono then. Adding |
This reverts commit 2f6bf46. See #820 (comment)
Since it is effectively unsupported at the moment, see #820 for the background.
This reverts commit 2f6bf46. See #820 (comment) (cherry picked from commit 4304b96)
Why do you care about mono at all at this point? It's not clear to me why you'd even be attempting to run any tests on mono now. Are you saying that you have been running the test suite with mono previously? |
Yes, prior to all of the changes for |
I use .NET Core on MacOS. Windows is not the primary development environment for our team (although we obvious test on it). How can I run tests on .NET 4.6.1 on MacOS? |
That's the point I'm trying to make. There is no compelling reason to try and run .NET Framework tests on non-Windows operating systems now that .NET Core exists. |
OK, then it makes sense to exclude them and only run against .NET Core (which has been the case until we went multi-target recently?). |
What do you mean by exclude them? You still need to run them on Windows. What problem are you trying to solve exactly? It's not clear to me what you're trying to do. |
|
That's why you should use the |
Actually, that's already in the run-test.sh script. |
Thanks for pointing that out @bording @michaelklishin we can expand |
I see, so I have to use |
(cherry picked from commit d5c90f7)
This switches a different approval library for the API approval test. Verify doesn't require special project settings to work in all scenarios like ApprovalTests does.
Fixes #815