nunit / nunit-vs-adapter

Runs NUnit V2 tests inside the Visual Studio 2012 or later Test Explorer window.
MIT License
50 stars 43 forks source link

NUnit version 1.1.0.0 is broken with test class which ran under 1.0.0.0 #40

Closed rmatsick closed 10 years ago

rmatsick commented 10 years ago

I have been helping someone install NUnit Adapter in their VS2012 installation when I noticed that when we attempt to run a test which will run under version 1.0.0.0 of NUnit, this message comes up:

nunitfailuremessage

I checked versions on my system and I WAS running 1.0.0.0 which works and runs all tests perfectly fine. I saw there was an update available and so to isolate the issue I updated my version to 1.1.0.0. However, my system is now broken in the same manner as my colleagues'.

I assumed this had something to do with the version of NUnit framework we were using. I went to the NUnit website and downloaded the 2.6.3. msi file and attempted to install it when I was met with this error message:

nunit263msierrmessage

I saw that it was looking for a specific .NET version (2.0 or 4.0), so I then downloaded the .NET 4.0 web install package and started it when I discovered .NET 4.0 was already installed:

net40installmessage

This was very frustrating to say the least. I read quite a bit of bug history on this issue and it seems it is a common one amongst many people. The fact that I can repeat this on two different systems using NUnit Adapter as an extension in VS2012 Update 4 lends credence to this being a real bug and not just a nuisance on some systems.

I want to roll back my NUnit Adapter extension to version 1.0.0.0. Can you provide me with an installer for this version?

OsirisTerje commented 10 years ago

Thanks for this detailed description !

You can find the 1.0 binaries at https://launchpad.net/nunit-vs-adapter/+download

I agree there seems to be both an issue with the adapter on running pre 4.0 on VS 2012 and the framework itself about the detection of the .net version. I don't have VS2012 on my vacation laptop, so can't repro this now, but a few things to check:
The adapter has been updated to the VS 2013 .net FW (4.x), in order to use some newer functions from that fw. This means the test assemblies should also run under at least 4.0. Even if your production code is 3.5 that should work fine.
If you update the target framework to 4.0 on one of the test projects, do it run then ? If you run the tests "as is" but with VS 2013, does it run then ?

OsirisTerje commented 10 years ago

I managed to create a repro for this issue, and have a fix committed. I have uploaded a fix release, at https://bintray.com/nunit/NUnitAdapter/NUnitAdapter/1.1.0.5/view/files
Can you please check this out ?

rmatsick commented 10 years ago

Sure. Tomorrow morning when I get back.

Rick

R. Matsick Sent from my iPhone

On Jul 20, 2014, at 8:59 AM, "Terje Sandstrom" notifications@github.com<mailto:notifications@github.com> wrote:

I managed to create a repro for this issue, and have a fix committed. I have uploaded a fix release, at https://bintray.com/nunit/NUnitAdapter/NUnitAdapter/1.1.0.5/view/files

Can you please check this out ?

— Reply to this email directly or view it on GitHubhttps://github.com/nunit/nunit-vs-adapter/issues/40#issuecomment-49545700.

rmatsick commented 10 years ago

I downloded version 1.0.0.0 vsix file and it works. I downloaded version 1.1.0.5 vsix file and it does not display the tests after I clean and build the solution:

[cid:image001.png@01CFA4C5.BB9FFA50]

I tried the ‘Run All’ selection and this was posted to the tests console:

------ Discover test started ------ ========== Discover test finished: 0 found (0:00:00.046) ==========

Rick

From: Terje Sandstrom [mailto:notifications@github.com] Sent: Sunday, July 20, 2014 8:59 AM To: nunit/nunit-vs-adapter Cc: Matsick, Richard Subject: Re: [nunit-vs-adapter] NUnit version 1.1.0.0 is broken with test class which ran under 1.0.0.0 (#40)

I managed to create a repro for this issue, and have a fix committed. I have uploaded a fix release, at https://bintray.com/nunit/NUnitAdapter/NUnitAdapter/1.1.0.5/view/files

Can you please check this out ?

— Reply to this email directly or view it on GitHubhttps://github.com/nunit/nunit-vs-adapter/issues/40#issuecomment-49545700.

jimschubert commented 10 years ago

I'm also experiencing this issue, trying to get tests to run under 1.1.

With 1.1.0.0, 1.1.0.3, and 1.1.0.5 installed, the following does not list NUnit discoverers or executors:

vstest.console.exe MyTest.dll /Framework:Framework40 /UseVsixExtensions:true /ListDiscoverers /ListExecutors 

Reverting back to 1.0.0.0, Nunit is listed:

NUnit.VisualStudio.TestAdapter.NUnitTestDiscoverer
    Default Executor Uri: executor://nunittestexecutor/
    Supported File Types: .dll, .exe

NUnit.VisualStudio.TestAdapter.NUnitTestExecutor
    Uri: executor://NUnitTestExecutor

I also loaded my test project (built against .NET 4.5) directly into nunit gui targeting .NET 4.5 and was presented an error that the dll was not built against a known framework. Rebuilding against .NET 4.0 and changing the target in nunit gui, I'm able to run tests from the gui.

OsirisTerje commented 10 years ago

Thanks for testing this out, really appreciate it! As said, I don't have VS2012 available here, so I am working sort of blindly. I did manage to repro some of this on 2013 - the case where the test dll itself is .net fw 3.5. That should be fixed in 1.1.0.5, but obviously not the 2012 issue.
I have now diff'ed the 1.0 and 1.1 vsix'es, and the 1.1 includes the MS dll's, which it should not do. I have removed them from the next upload to bintray, version 1.1.0.6, hopefully that will do the trick. (I assume you both see this on VS 2012.) Grab it here https://bintray.com/nunit/NUnitAdapter/NUnitAdapter/1.1.0.6/view

There seems to be another issue related to running under command line, and with a setting for KeepAlive, see #39 . I will need to address that next, the workaround for that now would be to ensure the registry setting for that is opposite of what you have now, if that error appears.

OsirisTerje commented 10 years ago

Added version 1.1.0.7 for the exception fix on KeepAlive/EnableShutDown, see #39 for details. Download https://bintray.com/nunit/NUnitAdapter/NUnitAdapter/1.1.0.7/view/files

rmatsick commented 10 years ago

Seems to be the same issue as before where I do not see anything in the Test Explorer pane after uninstalling version 1.0.0.0 and installing version 1.1.0.6:

[cid:image001.png@01CFA58D.D7FFC8B0]

I tried ‘Run All’ as well and nothing is displayed. This is what the test console shows:

[cid:image002.png@01CFA58D.D7FFC8B0]

Rick

From: Terje Sandstrom [mailto:notifications@github.com] Sent: Tuesday, July 22, 2014 6:21 AM To: nunit/nunit-vs-adapter Cc: Matsick, Richard Subject: Re: [nunit-vs-adapter] NUnit version 1.1.0.0 is broken with test class which ran under 1.0.0.0 (#40)

Thanks for testing this out, really appreciate it! As said, I don't have VS2012 available here, so I am working sort of blindly. I did manage to repro some of this on 2013 - the case where the test dll itself is .net fw 3.5. That should be fixed in 1.1.0.5, but obviously not the 2012 issue.

I have now diff'ed the 1.0 and 1.1 vsix'es, and the 1.1 includes the MS dll's, which it should not do. I have removed them from the next upload to bintray, version 1.1.0.6, hopefully that will do the trick. (I assume you both see this on VS 2012.) Grab it here https://bintray.com/nunit/NUnitAdapter/NUnitAdapter/1.1.0.6/view

There seems to be another issue related to running under command line, and with a setting for KeepAlive, see #39https://github.com/nunit/nunit-vs-adapter/issues/39 . I will need to address that next, the workaround for that now would be to ensure the registry setting for that is opposite of what you have now, if that error appears.

— Reply to this email directly or view it on GitHubhttps://github.com/nunit/nunit-vs-adapter/issues/40#issuecomment-49721425.

rmatsick commented 10 years ago

Same issues as previous version: No tests displayed in Test Explorer and the Tests Console does not show any activity after ‘Run All’:

[cid:image001.png@01CFA58E.7AEC7690]

[cid:image002.png@01CFA58E.7AEC7690]

Rick

From: Terje Sandstrom [mailto:notifications@github.com] Sent: Tuesday, July 22, 2014 7:09 AM To: nunit/nunit-vs-adapter Cc: Matsick, Richard Subject: Re: [nunit-vs-adapter] NUnit version 1.1.0.0 is broken with test class which ran under 1.0.0.0 (#40)

Added version 1.1.0.7 for the exception fix on KeepAlive/EnableShutDown, see #39https://github.com/nunit/nunit-vs-adapter/issues/39 for details. Download https://bintray.com/nunit/NUnitAdapter/NUnitAdapter/1.1.0.7/view/files

— Reply to this email directly or view it on GitHubhttps://github.com/nunit/nunit-vs-adapter/issues/40#issuecomment-49725419.

DOMZE commented 10 years ago

Same issue here.

I am using VS2012 Update 4 Test Project is using .NET 4.5

I installed 1.1.0.7 VSIX that you provided from bintray (https://bintray.com/nunit/NUnitAdapter/NUnitAdapter/view)

and i ran vstest.console.exe "PATH.TO.TEST.DLL" /UseVsixExtensions:true and got: Starting test execution, please wait... Warning: No test is available in C:\Projects\Main\NUnitTestProject\bin\Debug \NUnitTestProject.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.

Using NUnit 2.6.3.13283 in the test project

This behavior makes it not work on TFS as well (TFS 2012 update 4)

OsirisTerje commented 10 years ago

I finally got VS2012 onto my vacation laptop, so I could debug the issue. Can you make a check of this version : https://bintray.com/nunit/NUnitAdapter/NUnitAdapter/1.1.0.8/view/files

It worked on my VS2012 now, 1.1.0.x did not.

rmatsick commented 10 years ago

This appears to be showing and executing the tests now. Thanks for your hard work!

Rick

From: Terje Sandstrom [mailto:notifications@github.com] Sent: Thursday, July 24, 2014 8:51 AM To: nunit/nunit-vs-adapter Cc: Matsick, Richard Subject: Re: [nunit-vs-adapter] NUnit version 1.1.0.0 is broken with test class which ran under 1.0.0.0 (#40)

I finally got VS2012 onto my vacation laptop, so I could debug the issue. Can you make a check of this version : https://bintray.com/nunit/NUnitAdapter/NUnitAdapter/1.1.0.8/view/files

It worked on my VS2012 now, 1.1.0.x did not.

— Reply to this email directly or view it on GitHubhttps://github.com/nunit/nunit-vs-adapter/issues/40#issuecomment-50004188.

jimschubert commented 10 years ago

Same here, 1.1.0.8 executes tests for me now on TFS 2012. Thanks!

DOMZE commented 10 years ago

Works for me as well!

Thank you for your work!

ferminho commented 10 years ago

Also fixed here, thank you for your hard work!!

OsirisTerje commented 10 years ago

Thank YOU guys for the rapid and detailed feedback you all gave!

About the last fix: I'll add in a unit test for this missing last thing too - which was that the adapter MUST reference the 2012 OM and not the 2013 OM, I've added unit tests for the other things earlier, all in all this was 3 different things that wasn't right. Having the unit tests there will hopefully prevent these from popping up the next time.

I'll wait a bit to see if something more pops up, and then I'll try to push out an official 1.2 release as soon as possible.

sandshadow commented 10 years ago

Hi Terje, any chance we can get an official 1.2 release soon? We need to consume the TestAdapter through the NuGet package in our build system, rather than as a visix. Thanks, Eric

CharliePoole commented 10 years ago

Hi Eric,

I'm not Terje, but I'll answer anyway. :-)

Terje finished 1.2 while I was on vacation in Italy and I uploaded it (I thought) to the VS gallery and to NuGet.org for him. Apparently not. :-(

@Tjerje: What would you like to do? I can build and upload to NuGet using the V1.2 tag, but I see you have since released a 1.1.0.3 release, which is actually more advanced than 1.2. There are additional changes as well. Probably, we should avoid this in future, perhaps using release branches.

My thinking is that a 1.2 NuGet release should match the 1.2 vsix release. Does that make sense to you? What about 1.1.0.3? It will appear as a lower release than 1.2 even though it has fixes to 1.2. Maybe we should re-upload it as 1.2.0.3 or even just jump to 1.3 if you think the changes justify it.

Charlie

On Tue, Sep 16, 2014 at 4:31 PM, Eric Dettinger notifications@github.com wrote:

Hi Terje, any chance we can get an official 1.2 release soon? We need to consume the TestAdapter through the NuGet package in our build system, rather than as a visix. Thanks, Eric

— Reply to this email directly or view it on GitHub https://github.com/nunit/nunit-vs-adapter/issues/40#issuecomment-55829309 .

OsirisTerje commented 9 years ago

The fix to the issues in 1.1 is in the 1.1.0.8.
I would like to add one more commit before we release, I can get this in today. It can then be released as 1.2, both as vsix and nuget package. (The tag V1.2 is wrong, a typo I guess, just removed it, it was 1.1.0.2, which is at the same commit)
We do have release branches when we do release.

Update: Just released 1.2 here on github. Charlie will push it out to the VS Gallery and Nuget.

OsirisTerje commented 9 years ago

The 1.2 version is now available on NuGet

Working on getting the vsix out on Gallery too

sandshadow commented 9 years ago

Great - Thanks! We've started using the 1.2 package in Team Build.