JetBrains / teamcity-dotnet-plugin

TeamCity plugin for .NET projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dotnet test - The argument /noconsolelogger is invalid.

schrufygroovy opened this issue · comments

Following error is shown:
[dotnet test] The argument /noconsolelogger is invalid. Please use the /help option to check the list of valid arguments.

I am using the latest .NET SDK 3.1.102 version.

[dotnet test] .NET SDK 3.1.102 C:\Program Files\dotnet\dotnet.exe test C:\BuildAgent\work\a7352c02b7a9ec59\Qata.Tests.Selenium.Wikifolio.WithDatabase.1.101.0-beta0027\Qata.Tests.Selenium.Wikifolio.WithDatabase.Chrome.dll --results-directory results --logger trx @C:\BuildAgent\temp\agentTmp\1.rsp
[08:51:02][dotnet test] Starting: C:\Program Files\dotnet\dotnet.exe test C:\BuildAgent\work\a7352c02b7a9ec59\Qata.Tests.Selenium.Wikifolio.WithDatabase.1.101.0-beta0027\Qata.Tests.Selenium.Wikifolio.WithDatabase.Chrome.dll --results-directory results --logger trx @C:\BuildAgent\temp\agentTmp\1.rsp
[08:51:02][dotnet test] in directory: C:\BuildAgent\work\a7352c02b7a9ec59
[08:51:02][dotnet test]
[08:51:02][dotnet test] Welcome to .NET Core 3.1!
[08:51:02][dotnet test] ---------------------
[08:51:02][dotnet test] SDK Version: 3.1.102
[08:51:02][dotnet test]
[08:51:02][dotnet test] ----------------
[08:51:02][dotnet test] Explore documentation: https://aka.ms/dotnet-docs
[08:51:02][dotnet test] Report issues and find source on GitHub: https://github.com/dotnet/core
[08:51:02][dotnet test] Find out what's new: https://aka.ms/dotnet-whats-new
[08:51:02][dotnet test] Learn about the installed HTTPS developer cert: https://aka.ms/aspnet-core-https
[08:51:02][dotnet test] Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs
[08:51:02][dotnet test] Write your first app: https://aka.ms/first-net-core-app
[08:51:02][dotnet test] --------------------------------------------------------------------------------------
[08:51:02][dotnet test] Microsoft (R) Test Execution Command Line Tool Version 16.3.0
[08:51:02][dotnet test] Copyright (c) Microsoft Corporation. All rights reserved.
[08:51:02][dotnet test]
[08:51:02][dotnet test] vstest.console.exe /noconsolelogger
[08:51:02][dotnet test] /l:TeamCity.MSBuild.Logger.TeamCityMSBuildLogger,C:\BuildAgent\plugins\dotnet.cli\tools\TeamCity.Dotnet.Integration.1.0.8\msbuild15\TeamCity.MSBuild.Logger.dll;TeamCity;verbosity=diagnostic;plain
[08:51:02][dotnet test] /nodeReuse:false
[08:51:02][dotnet test] /p:VSTestLogger=logger%3A%2F%2Fteamcity
[08:51:02][dotnet test] /p:VSTestTestAdapterPath="C%3A%5CBuildAgent%5Cplugins%5Cdotnet%2Ecli%5Ctools%5CTeamCity%2EDotnet%2EIntegration%2E1%2E0%2E8%5Cvstest15;%2E"
[08:51:02][dotnet test] /p:VSTestVerbosity=diagnostic
[08:51:02][dotnet test] /p:FxCopCmdFileVersion=14%2E0%2E23107%2E0
[08:51:02][dotnet test] /p:FxCopRoot=C%3A%5CProgram%20Files%20%28x86%29%5CMicrosoft%20Visual%20Studio%2014%2E0%5CTeam%20Tools%5CStatic%20Analysis%20Tools%5CFxCop
[08:51:02][dotnet test] /p:agent_home_dir=C%3A%5CBuildAgent
[08:51:02][dotnet test] /p:agent_name=WF64
[08:51:02][dotnet test] /p:agent_work_dir=C%3A%5CBuildAgent%5Cwork
[08:51:02][dotnet test] /p:build_number=34
[08:51:02][dotnet test] /p:java_io_tmpdir=C%3A%5CBuildAgent%5Ctemp%5CbuildTmp
[08:51:02][dotnet test] /p:teamcity_agent_cpuBenchmark=673
[08:51:02][dotnet test] /p:teamcity_agent_dotnet_agent_url=http%3A%2F%2Flocalhost%3A9095%2FRPC2
[08:51:02][dotnet test] /p:teamcity_agent_dotnet_build_id=29967
[08:51:02][dotnet test] /p:teamcity_auth_password=*******
[08:51:02][dotnet test] /p:teamcity_auth_userId=TeamCityBuildId%3D29967
[08:51:02][dotnet test] /p:teamcity_build_changedFiles_file=C%3A%5CBuildAgent%5Ctemp%5CbuildTmp%5CchangedFiles4785314064336678690%2Etxt
[08:51:02][dotnet test] /p:teamcity_build_checkoutDir=C%3A%5CBuildAgent%5Cwork%5Ca7352c02b7a9ec59
[08:51:02][dotnet test] /p:teamcity_build_properties_file=C%3A%5CBuildAgent%5Ctemp%5CbuildTmp%5Cteamcity%2Ebuild7583103163480404541%2Eproperties
[08:51:02][dotnet test] /p:teamcity_build_tempDir=C%3A%5CBuildAgent%5Ctemp%5CbuildTmp
[08:51:02][dotnet test] /p:teamcity_build_workingDir=C%3A%5CBuildAgent%5Cwork%5Ca7352c02b7a9ec59
[08:51:02][dotnet test] /p:teamcity_buildConfName=Tests%2ESelenium%2EWithDatabase
[08:51:02][dotnet test] /p:teamcity_buildType_id=Tests%5FInt%5FTestsSeleniumWithDatabase
[08:51:02][dotnet test] /p:teamcity_configuration_properties_file=C%3A%5CBuildAgent%5Ctemp%5CbuildTmp%5Cteamcity%2Econfig1452536392390613425%2Eproperties
[08:51:02][dotnet test] /p:teamcity_dotnet_nunitaddin=C%3A%5CBuildAgent%5Cplugins%5CdotnetPlugin%5Cbin%5CJetBrains%2ETeamCity%2ENUnitAddin%2DNUnit
[08:51:02][dotnet test] /p:teamcity_dotnet_nunitlauncher=C%3A%5CBuildAgent%5Cplugins%5CdotnetPlugin%5Cbin%5CJetBrains%2EBuildServer%2ENUnitLauncher%2Eexe
[08:51:02][dotnet test] /p:teamcity_dotnet_nunitlauncher_msbuild_task=C%3A%5CBuildAgent%5Cplugins%5CdotnetPlugin%5Cbin%5CJetBrains%2EBuildServer%2EMSBuildLoggers%2Edll
[08:51:02][dotnet test] /p:teamcity_dotnet_nunitlauncher1_1=C%3A%5CBuildAgent%5Cplugins%5CdotnetPlugin%5Cbin%5CJetBrains%2EBuildServer%2ENUnitLauncher1%2E1%2Eexe
[08:51:02][dotnet test] /p:teamcity_dotnet_nunitlauncher2_0=C%3A%5CBuildAgent%5Cplugins%5CdotnetPlugin%5Cbin%5CJetBrains%2EBuildServer%2ENUnitLauncher2%2E0%2Eexe
[08:51:02][dotnet test] /p:teamcity_dotnet_nunitlauncher2_0_vsts=C%3A%5CBuildAgent%5Cplugins%5CdotnetPlugin%5Cbin%5CJetBrains%2EBuildServer%2ENUnitLauncher2%2E0%2EVSTS%2Eexe
[08:51:02][dotnet test] /p:teamcity_dotnet_platform=C%3A%5CBuildAgent%5Cplugins%5CdotnetPlugin%5Cbin%5CJetBrains%2ETeamCity%2EPlatformProcessRunner%2E1%2E1%2Eexe
[08:51:02][dotnet test] /p:teamcity_nuget_feed__Root_default_publicUrl=http%3A%2F%2F192%2E168%2E11%2E63%3A8085%2FhttpAuth%2Fapp%2Fnuget%2Ffeed%2F%5FRoot%2Fdefault%2F
[08:51:02][dotnet test] /p:teamcity_nuget_feed__Root_default_url=http%3A%2F%2F192%2E168%2E11%2E63%3A8085%2FhttpAuth%2Fapp%2Fnuget%2Ffeed%2F%5FRoot%2Fdefault%2F
[08:51:02][dotnet test] /p:teamcity_projectName=INT
[08:51:02][dotnet test] /p:teamcity_runner_properties_file=C%3A%5CBuildAgent%5Ctemp%5CbuildTmp%5Cteamcity%2Erunner397799347889773628%2Eproperties
[08:51:02][dotnet test] /p:teamcity_tests_recentlyFailedTests_file=C%3A%5CBuildAgent%5Ctemp%5CbuildTmp%5CtestsToRunFirst3315928639559116332%2Etxt
[08:51:02][dotnet test] /p:teamcity_version=2019%2E2%20%28build%2071499%29
[08:51:02][dotnet test]
[08:51:02][dotnet test] The argument /noconsolelogger is invalid. Please use the /help option to check the list of valid arguments.
[08:51:02][dotnet test]
[08:51:02][dotnet test] Process exited with code 1
[08:51:02][dotnet test] Process exited with code 1

@schrufygroovy try using the command vstest instead as workaround

We should support a testing assembly as target for dotnet test command since 3.1.100

@schrufygroovy, which version of TeamCity do you have installed?

@schrufygroovy, which version of TeamCity do you have installed?

TeamCity Professional 2019.2.1 (build 71758)
I ensured I am using the latest version before I submitted the report.

@schrufygroovy It's brilliant and you could try the latest plugin

@NikolayPianikov thx. works now

awesome work!

Hey there -

We just upgraded to .NET 6.0 - we're seeing the similar following error.


Step 4/11: Running Unit Tests (.NET)
  dotnet test
    Starting: .NET SDK 6.0.300 "C:\Program Files\dotnet\dotnet.exe" test C:\BuildAgent\work\54ed349e18c2d874\UnitTests\UnitTests.csproj --settings C:\BuildAgent\work\54ed349e18c2d874\testSettings.runsettings @C:\BuildAgent\temp\agentTmp\2.rsp
    in directory: C:\BuildAgent\work\54ed349e18c2d874
    Microsoft (R) Test Execution Command Line Tool Version 17.2.0 (x64)
    Copyright (c) Microsoft Corporation.  All rights reserved.
    
    The argument /noconsolelogger is invalid. Please use the /help option to check the list of valid arguments.
    Process exited with code 1
    Process exited with code 1 (Step: Running Unit Tests (.NET))
  Step Running Unit Tests (.NET) failed
  Error message: Step Running Unit Tests (.NET) failed

I'm on
TeamCity Professional 2022.04 (build 108502)

Going into C:\BuildAgent\work\54ed349e18c2d874 and manually running "C:\Program Files\dotnet\dotnet.exe" test C:\BuildAgent\work\54ed349e18c2d874\UnitTests\UnitTests.csproj --settings C:\BuildAgent\work\54ed349e18c2d874\testSettings.runsettings works as expected.

The problem appears to be that the first line of C:\BuildAgent\temp\agentTmp\2.rsp is \noconsolelogger , which is invalid syntax for dotnet test afaik.

The output for me of manually typing:

λ  "C:\Program Files\dotnet\dotnet.exe" test C:\BuildAgent\work\54ed349e18c2d874\UnitTests\UnitTests.csproj --settings C:\BuildAgent\work\54ed349e18c2d874\testSettings.runsettings
  Determining projects to restore...
  All projects are up-to-date for restore.
  [... snip ...]
Test run for C:\BuildAgent\work\54ed349e18c2d874\UnitTests\bin\Debug\net6.0\UnitTests.dll (.NETCoreApp,Version=v6.0)
Microsoft (R) Test Execution Command Line Tool Version 17.2.0 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.

Passed!  - Failed:     0, Passed:   255, Skipped:     0, Total:   255, Duration: 14 s - UnitTests.dll (net6.0)```

We are having the same issue with a temp file called 11.rsp. The first line in this file is /noconsolelogger. This is causing builds to fail with strange errors. The error appears to be related to the line directly after /noconsolelogger being injected into the dotnet test command without a preceding space.

So if before it would have been dotnet test proj.csproj /noconsolelogger <line2>, it looks like it's now dotnet test proj.csproj<line2> or something similar. It's hard to tell.

The new issue is different from the one described in this ticket. We have other ticket for the issue related to SDK 6.0.300: https://youtrack.jetbrains.com/issue/TW-76189