elv1s42 / NUnitGo

(NO LONGER MAINTAINED, please use https://github.com/GHPReporter/Ghpr.NUnit)
https://github.com/GHPReporter/Ghpr.NUnit
MIT License
11 stars 2 forks source link

NUnit 3 Test Adapter compatibility #5

Open jochenparm opened 7 years ago

jochenparm commented 7 years ago

When I try to add the [NunitGoAction] attribute to either tests or test cases, this test isn't discovered anymore by the NUnit 3 Test Adapter upon building the project. Is this simply not supported?

elv1s42 commented 7 years ago

Hello. Can you please provide more information? 1) Are you using the latest version of NUnitGo nuget package and the latest version of NUnit 3? 2) Are you using two attributes (NunitGoAction with Test or TestCase Attribute), like in this example: https://github.com/elv1s42/NUnitGo#usage-example ?

You can take a look at the examples inside this two foldersL https://github.com/elv1s42/NUnitGo/tree/master/NunitTestsExample https://github.com/elv1s42/NUnitGo/tree/master/NunitTestsExample2

Also I would suggest you to try GHP Report: https://github.com/GHPReporter/Ghpr.NUnit There is no need to write any extra attributes, and the reporter work faster than NUnitGo

jochenparm commented 7 years ago

I am using the latest version of NUnitGo from NuGet (2.1.5), the latest version of NUnit 3 from Nuget (3.4.1), the latest version of the NUnit3TestAdapter from NuGet (3.4.1)

I am using the attributes correctly, as illustrated in the examples. With both Test and TestCases the result is the same: the test isn't discovered anymore by the test adapter. Manually trying to run the test by rightclicking on the test method and choosing 'Run Test' results in the adapter reporting: "No tests found to run."

jochenparm commented 7 years ago

The reason why I want to use NUnitGo is because all other report generators require the user to run the NUnit tests from console, while I want to run them from VS2015 with the Test Adapter

elv1s42 commented 7 years ago

Ok, I think that the reason of this issue is that NuGet package version is not new enough to work correctly with the newest NUnit 3. You can try to build NUnitGo from master branch, this should work fine, but the report will be a little bit different.

You can also create an issue for GHP Report: https://github.com/GHPReporter/Ghpr.NUnit to request support for running tests from VS2015 with the Test Adapter. I am sure it will not be very hard to implement this feature. Basicly, this is a problem of NUnit 3 itself. There are two different ways to extend NUnit 3:

  1. For console we can create NUnit Engine extention, which will not require to write any extra attributes
  2. For test adapter we need to create custom attribute, this is the only way to extend adapter right now

The reason why I decided not to implement the second way inside GHP Reporter is that nobody wanted to write this custom attributes. If you have 100 or even 500 tests in your project, you would not like the idea to add new attribute for all existing tests.

To be honest, I am not sure that I will be able to contribute to this project anymore because I don't have enough time. If you want to contribute, I can add you to this project as a collaborator, and find a way to automatically publish NuGet packages for the next versions of NUnitGo.

jochenparm commented 7 years ago

I'm sorry, but I don't have any time to actively contribute to this project either. Thank you for the information and I'll keep you posted!

elv1s42 commented 7 years ago

Ok, I'll keep this issue opened. For now I think that the best solution is to create an issue for GHP Reporter (if you like the reports). You can take a look at the report here: http://ghpreporter.github.io/report/

Or you can try to use GHP Report with Specflow.

jochenparm commented 7 years ago

Unfortunately, the issue is still present when using the NUnitGo dll built from the master branch. I'll check out GHPReporter when I have the time. Thnx for your quick support.

elv1s42 commented 7 years ago

And can you try to run tests for projects with test examples? These projects are in the same solution.

jochenparm commented 7 years ago

Mmmm, the tests DO work with the test adapter in the test examples... I don't understand, I'm using exactly the same attributes in my project? I'll try some more stuff

jochenparm commented 7 years ago

Yet copying the example test classes to my project and they're suddenly not discovered anymore?

elv1s42 commented 7 years ago

Are there any warnings appear during the build of your project? Can you create a simple project with one test to reproduce this issue?