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

Console output is unclear about which console build is running #1467

Closed
Tracked by #1547
CharliePoole opened this issue Aug 31, 2024 · 5 comments · Fixed by #1481
Closed
Tracked by #1547

Console output is unclear about which console build is running #1467

CharliePoole opened this issue Aug 31, 2024 · 5 comments · Fixed by #1481
Assignees
Labels
Milestone

Comments

@CharliePoole
Copy link
Member

CharliePoole commented Aug 31, 2024

We have three different builds of the console runner, all producing the executable nunit3-console.exe:

  1. The "standard" console built with .NET Framework 4.6.2, which has full functionality.
  2. The "netcore" runner built with .NET Core 6.0, with limited functionality.
  3. A second "netcore" runner, with the same limited functionality, built against .NET Core 8.0.

Often, users don't actually remember which console they installed, resulting in a lot of confusion both for them and for the team when bugs are reported. For example, if the user says they are using .NET 6.0, that may mean they are using either the standard runner with a .NET6.0 agent or the .NET 6.0 runner or even the .NET 8.0 runner!

Ideally, we should not have three different programs with the same name. However, changing the executable name is a breaking change and will need to be postponed until the 4.0 release.

To mitigate the problem, the initial header in the console output should clearly state which of the three is being run. We might even consider a one-line notice like "Bugs should be reported against XXX."

It might also be useful to have a page somewhere, which describes the limitations of the .NET Core builds.

@OsirisTerje
Copy link
Member

OsirisTerje commented Aug 31, 2024

I believe we have a lack of documentation here. There is next to nothing in the docs.nunit.org. The wiki here is also lacking in information. Also, I cant find any docs about the difference in functionality between the framework version and .net core version so we need to improve this too.

In order to figure out what you have, there are a few steps:

where nunit.exe

This command tells me where the dotnet core version is located, which was installed as a dotnet tool:
image

One can see that this tool is installed, and is located in the dotnet folder as expected for a dotnet tool.

If we now run

dotnet tool list -g

image

We here see I have it installed as version 3.18.1

Now, I'll go look for any other installations using:

where nunit3-console.exe

And, it finds 2 installations, one obviously done using chocolatey:
image

Since these are .net framework based tools, I can use a powershell command to figure out what version they are:

powershell -NoProfile -command "[System.Reflection.AssemblyName]::GetAssemblyName('C:\path\to\yourapp.exe').Version.ToString()"

which gives the following versions:
image

So you can use the command nunit which will start the net core dotnet tool version. If you use the command nunit3-console, it will start the first one found in the `where`` command list.

@WindingWinter
Copy link

@CharliePoole , is it even possible to install a different nunit console runner other than the standard ( .net framework) one? Because when I get my nunit console from nuget, I can only get one version-- the .net framework version.

@CharliePoole
Copy link
Member Author

@WindingWinter Well it depends on which package you install. NUnit.ConsoleRunner is what I'm referring to as the "standard" runner, NUnit.ConsoleRunner.NetCore is the netcore runner.

@CharliePoole
Copy link
Member Author

@WindingWinter Just looking back at this exchange and wanting to clear up a point. You may already know this, but for the benefit of anyone who doesn't, here goes...

The "standard" runner, which runs under .NET Framework, is still able to run tests under .NET Core using agents. In version 3.18.1, it comes with agents for .NET Framework 4.6.2, .NET Core 3.1, .NET 6.0, .NET 7.0 and .NET 8.0. If you use all defaults on the command-line, the runner selects the best agent for each test assembly.

OTOH the .NET Core runner runs one assembly at a time, in process, under .NET 6.0 or under a higher-level framework if you have set up your config to do that.

@CharliePoole
Copy link
Member Author

This issue has been resolved in version 3.18.2

The release is available on:
GitHub.
NuGet packages are also available NuGet.org and
Chocolatey Packages may be found at Chocolatey.org

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

Successfully merging a pull request may close this issue.

3 participants