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
Update AutoFixture.NUnit2 to version depend on NUnit 2.6.4 #779
Comments
Could you please clarify a purpose of this change? |
I am looking for a way to run AutoFixture tests with NUnit Test Adapter 2.1.1.0. When I replace NUnit Test Adapter 2 with R#, where I can specify a the NUnit runner and I provide a matching (in version) nunit.core, it works. This gives me an idea that is fails run tests because of mismatch of the library versions. Currently the result of the test run is: "No arguments were provided". Tried specifying assembyBindings, but that does not seem to help. |
Could you please share more detail? Please specify:
It will help to reproduce the issue locally and better understand the reason. |
VS 2017 An example:
|
Thanks for the details. Previously we had the exactly same issue and there the decision was to keep it as is. However, we could probably change that in
I don't know too much about NUnit2 and don't use it, so probably @gertjvr or somebody from @AutoFixture/core could help to understand why our add-in doesn't seem to work more in 2.6.4. |
After I played more with that I found that upgrading to nunit 2.6.4 actually fixes the issue and R# is capable of running tests out of the box. Also it seems to enable VS discover (while run still doesn't work like that is described here). @ladeak Could you please test these artifacts where I updated NUnit to 2.6.4 and let me know whether it works fine for you? Thank you in advance. P.S. Notice, that test branch is based on upcoming v4, so you might observe some breaking changes in API when you install that NuGet packages. |
Thank you for the follow up. |
I've investigated this question further (debugged the NUnit) to understand the reason and found that likely the only way will be to upgrade to the NUnit 2.6.4 to support it. The reason is that the LocalAddin we install to user's project is not recognized. I've investigated why that happens. Basically, the init sequence is following (see here):
If user uses NUnit 2.6.4 and installed our integration (which targets 2.6.2), the addin is not recognized. That is because on the step 1-2 when .NET resolves dependencies of the user's test assembly, it loads I've tried to add binding redirection as described here, but that does't help. It seems that Also I've tried to add a Module initializer to redirect load to the I wasn't able to find a way to make NUnit 2.6.4 work together with our integration (I've tested that with both Console runner and R#) and, therefore, would vote to re-target to 2.6.4 in @AutoFixture/core what do you think? 😉 |
Thank your for the very detailed investigation. |
Before AutoFixture.NUnit2 was created, back when we were discussing about it, I had my concerns, so I can't be of help in this space since I haven't followed this Glue Library's progress. |
It took me 2 days to understand that I made a mistake in binding redirection and actually it helps to solve the issue 😅 This how the working <?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="nunit.core.interfaces" publicKeyToken="96d09a1eb7f44a77" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.4.14350" newVersion="2.6.4.14350" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="nunit.core" publicKeyToken="96d09a1eb7f44a77" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.4.14350" newVersion="2.6.4.14350" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> With such config file tests are successfully passing with both Console and R# runners. Therefore, we actually need to do nothing as there is a way to easily work around the issue and make it compatible with NUnit 2.6.4. Likely, we need to update the @ladeak Could you please check you how your binding redirection is defined and check again whether it works? @moodmosaic I have a plan to refactor the glue libraries to extract the common parts (this is what I got from that boring referenced discussion 😇) . Rule of 3 should apply here as we have 4 libraries 😉 I'll fire a separate discussion a bit later. |
Please don't, if you want my opinion.
|
I am testing this again. Here is what I find. I ran these tests:
The one with bool input parameter runs correctly, and shows up as passed. See the value showing up in test explorer does not match with the value being used for the actual test run. |
@ladeak That means that the original issue posted here was actually solved. You were able to run tests using the never version of NUnit2. The issue you currently observe is related to the similar issue for NUnit3 (see #709). We should investigate whether we can do something similar with NUnit2. In any case, could you please create a separate issue for that? That is to make the track simpler. In the meanwhile you can try to use different runners (like R#) that should not suffer from this issue. @moodmosaic Thanks for that points! I need some time to realize them entirely 😳 If I finally decide to raise an issue, I'll keep them in mind! |
Yes, I am fine closing this. Thank you for the help. |
Please update dependencies of AutoFixture.NUnit2 to use NUnit 2.6.4.
The text was updated successfully, but these errors were encountered: