Why am I getting "File type is not supported" on TeamCity 9 when using NUnit 3?
Asked Answered
T

1

5

I'm using TeamCity Enterprise 9.1.5 (build 37377).

I have created a Build Configuration.

I have created an NUnit Build Step.

For NUnit Runner I selected NUnit 3.

For Path to NUnit Console Runner I entered: packages\NUnit.ConsoleRunner.3.7.0\tools\nunit3-console.exe

In my Visual Studio solution I have installed the NUnit.Runner package.

When I run the Build Configuration I get the following error in the logs: File type is not supported

How do I get my NUnit tests to run in TeamCity?

Touraco answered 4/12, 2017 at 14:31 Comment(0)
T
11

What worked for me:

I uninstalled NUnit.Runner and installed the following packages:

  • NUnit.ConsoleRunner
  • NUnit.Extension.NUnitProjectLoader
  • NUnit.Extension.TeamCityEventListener (not sure if this is needed, or not)

Why is the error being generated?

The ConsoleRunner can't handle .nunit files. That ability is part of NUnit.Extension.NUnitProjectLoader. The directory that extension is in will need to be listed as part of the .addins file. (I can't find the GitHub links where I found that information.)

How I troubleshooted:

TeamCity generated an .nunit file. I copied that file from the agent to my development machine to troubleshoot and run nunit3-console.exe myself. Once it ran on my development machine, TeamCity worked, too.

Touraco answered 4/12, 2017 at 14:32 Comment(2)
I realize this is fairly old, but without NUnit.Extension.TeamCityEventListener, TeamCity ran the tests, but did not notice when any failed and the tests did not show up in the TeamCity Tests tab.Debug
I got an error from nunit3-console, which I installed with Chocolatey, of which the version was 3.12. In version from 3.09, nunit3-console --list-extensions format is changed and TeamCity does not parse correctly installed extensions, thinking that the NUnit3 project loader is missing. So the solution of mine to avoid "File type is supported" for .nunit files was to downgrade to 3.08 of NUnit. You can of course also via admin in Team City install the plugin and I did this. Now I see my tests are churned again and processed ! I hope Jetbrains fix this issueGahnite

© 2022 - 2024 — McMap. All rights reserved.