-
Notifications
You must be signed in to change notification settings - Fork 152
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
.nunit project file with nunit3-console.exe and .net 8.0? #1512
Comments
That's a good question. I can't remember that we have deprecated it, so yes, it should work. However, not many uses this anymore, and I can't remember either if we have any tests to verify it works - so it might have been inadvertently "killed". Could you create a small repro project and a script file to run it the way you do manually? Then we can try to check what is causing this. However, if you're stepping up to NUnit 4 it might make sense anyway to move off the this and over to using SOME MORE: If you update the framework from NUnit 2 to NUnit 4, you should not need the NUnitV2Driver. |
I'm using the NUnitV2Driver so I can keep the tests running while updating them all to a more recent framework version. This will take me a while. I created a small test project here: https://github.com/Clumi/nunit-test/tree/main Thank you for your time and help! |
@Clumi You need to install the "NUnit Project Loader" - https://docs.nunit.org/articles/nunit-engine/extensions/AvailableExtensions.html#nunit-project-loader - to run |
The console zip comes with most add-ons preinstalled - I also manually added the dll to the 8.0 folder to be sure as you can see in the repo I uploaded: |
@Clumi Can you check this with the 3.18.1 release of the console ? |
I just checked with the newest Console Release (3.18.1). Unfortunately it does not include a Dotnet Framework 3.5 console, so I could only test it with versions 4.6, 6 and 8. Versions 6 and 8 fail with "File type is not supported", but 4.6 is able to read the .nunit file. This is great news, since it means I can now upgrade our NUnit. Thank you a lot! |
I'm unsure if this is more of a console issue or the project loader, but I'm going to transfer it to the console runner repo as it sounds like it may be unable to load the plug-in. |
Let's deal with your initial problem first. The runner in the net8.0 directory is known as the NUnit NetCore Console Runner and it only runs tests under .NET Core. It won't run tests under any version of the .NET Framework. When you run from the net35 directory (or net462 in later versions) you are running what amounts to an entirely different program, which I have started to call the Standard runner. It's unfortunate that the executables for both of these have the same name, but we're stuck with that until there is a new major version. NOTE: I say it's a different program because we use conditional compilation that gives the two programs entirely different features. When you run the Standard runner (net35 or net462) your tests actually run in a separate process by default. The latest production release (3.18.3) is using a .NET 8.0 agent to run your tests, so no, you are not stuck using old runtimes. :-) The V2 Framework Driver extension is another matter. NUnit V2 didn't support anything but the .NET Framework, since that's all that existed at the time. So, if you are running NUnit V2 tests, then you have to run under .NET Framework, although it can be a newer version. OTOH, once you upgrade to NUnit 3 or 4 (IMO 2 to 4 is a rather big jump and not one I would do in one step) you no longer need the V2 framework driver. For that reason, it's not one of the extensions that will eventually become multi-targeted. Regarding the NUnit Project loader... copying an extension file to the bin directory is not the way to install them. They must be installed correctly using nuget.exe or an equivalent approach. However, it sounds as if your resolved this problem. @Clumi Reading through this, I can't see anything left to fix, so I'd like to close it, but I'll wait for your reply. |
I have a very old project that still runs NUnit 2. I'm trying to update it to NUnit 4. I downloaded the NUnit.Console-3.17.0 zip and added the nunit-extension-nunit-v2-driver.3.9.0 dll's manually. Then I tried to run the NUnit 2 .unit file with the nunit3-console.exe in the net8.0 folder of the console download. However, this fails with "File type is not supported". I checked the loaded dll's and the list looks fine, specifically it includes the IProjectLoader interface:
I then tried to run the same file with the console runner in the net35 folder, and it could read the project file just fine. Is it not possible to use the modern versions of dotnet with a .nunit file or am I doing something wrong?
The text was updated successfully, but these errors were encountered: