Skip to content
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? #4669

Open
Clumi opened this issue Mar 21, 2024 · 4 comments
Open

.nunit project file with nunit3-console.exe and .net 8.0? #4669

Clumi opened this issue Mar 21, 2024 · 4 comments
Labels
Investigate We will look into this

Comments

@Clumi
Copy link

Clumi commented Mar 21, 2024

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:

.\nunit3-console.exe --list-extensions
NUnit Console 3.17.0+685c5b542b5e9ba632c905f0bd514a773d9758af (Release)
Copyright (c) 2022 Charlie Poole, Rob Prouse
Thursday, 21 March 2024 12:06:27

Runtime Environment
   OS Version: Microsoft Windows 10.0.19045
  Runtime: .NET 8.0.1

Installed Extensions
  Extension Point: /NUnit/Engine/NUnitV2Driver
  Extension Point: /NUnit/Engine/TypeExtensions/IService
  Extension Point: /NUnit/Engine/TypeExtensions/ITestEventListener
  Extension Point: /NUnit/Engine/TypeExtensions/IDriverFactory
  Extension Point: /NUnit/Engine/TypeExtensions/IProjectLoader
  Extension Point: /NUnit/Engine/TypeExtensions/IResultWriter

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?

@OsirisTerje
Copy link
Member

OsirisTerje commented Mar 21, 2024

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 dotnet test instead.

SOME MORE:

If you update the framework from NUnit 2 to NUnit 4, you should not need the NUnitV2Driver.

@OsirisTerje OsirisTerje added Investigate We will look into this awaiting:repro A small repro is needed. Upload here or add PR to nunit.issues labels Mar 21, 2024
@Clumi
Copy link
Author

Clumi commented Mar 21, 2024

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
There are two powershell scripts for each of the variants I described at the top.

Thank you for your time and help!

@OsirisTerje OsirisTerje removed the awaiting:repro A small repro is needed. Upload here or add PR to nunit.issues label Mar 22, 2024
@mikkelbu
Copy link
Member

@Clumi You need to install the "NUnit Project Loader" - https://docs.nunit.org/articles/nunit-engine/extensions/AvailableExtensions.html#nunit-project-loader - to run .nunit files

@Clumi
Copy link
Author

Clumi commented Mar 22, 2024

@Clumi You need to install the "NUnit Project Loader" - https://docs.nunit.org/articles/nunit-engine/extensions/AvailableExtensions.html#nunit-project-loader - to run .nunit files

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:
https://github.com/Clumi/nunit-test/blob/main/NUnit.Console-3.17.0/bin/net8.0/nunit-project-loader.dll
Sadly, this didn't lead to .nunit-files being useable. Are there any further steps I missed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigate We will look into this
Projects
None yet
Development

No branches or pull requests

3 participants