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

The --teamcity option silently fails if the extension is not installed #1507

Closed
Tracked by #1549
CharliePoole opened this issue Oct 22, 2024 · 7 comments · Fixed by #1517
Closed
Tracked by #1549

The --teamcity option silently fails if the extension is not installed #1507

CharliePoole opened this issue Oct 22, 2024 · 7 comments · Fixed by #1517
Assignees
Labels
Milestone

Comments

@CharliePoole
Copy link
Member

Based on the code as well as my memory, this was intentional. Assuming the user is running interactively, it makes sense to just go ahead and run and hopefully it will be clear that the extension is missing. But of course --teamcity is not normally used interactively but when running on a CI server.

It now seems better to me to give an error message and stop the run if the extension is not available.

@OsirisTerje @veleek @NikolayPianikov Does that make sense to you?

@CharliePoole
Copy link
Member Author

This issue has been resolved in version 3.19.0

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

@Quppa
Copy link

Quppa commented Dec 30, 2024

We're seeing this new Option --teamcity specified but TeamCityEventListener is not installed. exception when we use NUnit.Console 3.19 but I'm a bit confused about why - isn't that DLL bundled again as of 3.18.3 (#1471)? In our case we're using the NUnit Legacy runner and this might be a question for the TeamCity developers.

I've switched back to 3.18.3 for now and everything is working.

@CharliePoole
Copy link
Member Author

@Quppa Are you using the standard runner or the .NET Core (.NET 8.0) runner? Did you install NUnit.Console or NUnit.ConsoleRunner? Are you running under TeamCity? Or did you use the option on the command-line? (The option is assumed if you run under TeamCity?

You could either provide more info in a new issue or provide it here so we can decide if you should create one.

@Quppa
Copy link

Quppa commented Dec 30, 2024

  1. I think the standard runner (shows up as NUnit Legacy in TeamCity). This is for a .NET Framework project, in case that's relevant (we just use dotnet test for .NET projects).
  2. NUnit.Console via the TeamCity agent tools config.
  3. Running under TeamCity.

@CharliePoole
Copy link
Member Author

CharliePoole commented Dec 30, 2024

I believe NUnit Legacy refers to NUnit V2. That's not what you are running, since we know you are using 3.19. Since it's .NET Framework, then it has to be the standard runner.

If you have a way to do it, run nunit3-console --list-extensions in the same environment. In fact, it wouldn't hurt to run it all the time prior to running your actual tests. If the teamcity extension is not installed, that's one problem, if it is we have a different problem.

Note that if 3.18.3 is working for you, it's because it doesn't give an error message when the extension is missing. We have another issue where I'm learning that folks running under teamcity do not always need to use the extension.

@ohnefuenfter
Copy link

I have the same problem and here is my output from nuint3-console --list-extensions command:

C:\TeamCity\buildAgent\tools\NUnit.Console.3.19.0\bin\net462> nunit3-console --list-extensions
NUnit Console Runner 3.19.0 (Release)
Copyright (c) 2022 Charlie Poole, Rob Prouse
Tuesday, December 31, 2024 8:09:32 AM

Runtime Environment
OS Version: Microsoft Windows NT 6.2.9200.0
Runtime: .NET Framework CLR v4.0.30319.42000

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've also tried to 'install' extension with the .addins file described here
https://docs.nunit.org/articles/nunit-engine/extensions/Installing-Extensions.html#the-addins-file

and result is the same - the list of installed extension as above and the error message in teamcity build (Option --teamcity specified but TeamCityEventListener is not installed.).
do you know other method to force-install teamcitylistener extension ?

by the way - if i switch to the 'standard' Nuint runner - i have the same problem with different message:
The TeamCity NUnit runner requires the following NUnit extensions to be installed: NUnit.Engine.Listeners.TeamCityEventListener. Please follow our instructions at: https://www.jetbrains.com/help/teamcity/?NUnit#NUnit-NUnit3Extensions

the link doesn't explain how to install this extension either

@CharliePoole
Copy link
Member Author

Having reviewed the links provided by @ohnefuenfter, I have realized that the term "Legacy NUnit" means something different to JetBrains than it does to the NUnit team. Ignore my earlier comment about that. It also appears that "standard runner" may mean something else to the company than it does to me, so I'll stop using that term in this thread.

From this discussion so far, one thing is clear... the error message is being correctly displayed because the extension is not actually installed. So we have a different problem, which is probably related to the fact that the 3.19 release changed how extensions are located. See issue #1504.

A stated in the issue, .addins files are no longer needed as the runner searches for extensions in a set of standard locations using a built-in algorithm. In fact, any .addins files in the initial directory are now completely ignored. I can imagine that this will cause a problem in some special situations but I don't actually know how TeamCity is set up to use NUnit.

I suggest two steps to resolve this...

  1. Somebody who is affected should create a new issue about the inability of TeamCity to locate the extension. It will help if you are able to explain exactly what steps are taken to install nunit into your TeamCity agent.

  2. Somebody should also create an issue with JetBrains about this problem. It's possible they may need to make some changes and they may be the only folks who can tell us what changes we need to make.

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