MSTest does not fire up in build step

Greetings,

In an effort to understand my issue with the code coverage in my development environment, as mentioned in another post, I setup a completely clean machine with TC 6.0.2 and created a configuration that replicates my current one.

However the MSTest step fails (although it reports the build as success).

Here's the execution log:

[07:39:23]: [Step 3/4] Using runner: MSTest 
[07:39:23]: [Step 3/4] Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe #TeamCityImplicit
[07:39:23]: [Step 3/4] in directory: C:\TC\wrk\debug
[07:39:25]: [Step 3/4] 2011-03-06 07:39:25,753 [2580] ERROR JetBrains.BuildServer.NAntLoggers.NUnitLauncher2 - Failed to start process. Access is denied. Path: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE, arguments: /runconfig:C:\TC\wrk\debug\TeamCity.testrunconfig "/testmetadata:C:\TC\wrk\debug\Portal Clientes.vsmdi" /resultsfile:C:\TC\tmp\buildTmp\tmp290.tmp.teamcity.trx "/testlist:Prosper.TestLibrary
[07:39:25]: [Step 3/4] Prosper.MicroFramework", at C:\TC\wrk\debug
[07:39:25]: [Step 3/4] System.Exception: Failed to start process. Access is denied. Path: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE, arguments: /runconfig:C:\TC\wrk\debug\TeamCity.testrunconfig "/testmetadata:C:\TC\wrk\debug\Portal Clientes.vsmdi" /resultsfile:C:\TC\tmp\buildTmp\tmp290.tmp.teamcity.trx "/testlist:Prosper.TestLibrary
[07:39:25]: [Step 3/4] Prosper.MicroFramework", at C:\TC\wrk\debug ---> System.ComponentModel.Win32Exception: Access is denied
[07:39:25]: [Step 3/4]    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
[07:39:25]: [Step 3/4]    at System.Diagnostics.Process.Start()
[07:39:25]: [Step 3/4]    at JetBrains.TeamCity.Utils.ProcessRunnerBase.Run(ProcessStartInfo psi) in c:\Agent\work\2f9f8fe94ae5352e\src\Utils\src\ProcessRunnerBase.cs:line 61
[07:39:25]: [Step 3/4]    --- End of inner exception stack trace ---
[07:39:25]: [Step 3/4]    at JetBrains.TeamCity.Utils.ProcessRunnerBase.Run(ProcessStartInfo psi) in c:\Agent\work\2f9f8fe94ae5352e\src\Utils\src\ProcessRunnerBase.cs:line 65
[07:39:25]: [Step 3/4]    at JetBrains.TeamCity.Utils.Runtime.ProcessRun.Execute(IRunProcess proc) in c:\Agent\work\2f9f8fe94ae5352e\src\Utils\src\Runtime\ProcessRun.cs:line 107
[07:39:25]: [Step 3/4]    at JetBrains.TeamCity.Utils.Runtime.ProcessRun.Run(String executable, PlatformVersion env, PlatformType platform, EnvironmentArg[] envKeys, String[] args) in c:\Agent\work\2f9f8fe94ae5352e\src\Utils\src\Runtime\ProcessRun.cs:line 51
[07:39:25]: [Step 3/4]    at JetBrains.TeamCity.Utils.Runtime.ProcessRun.RunWithCommandLine(PlatformVersion env, PlatformType platform, String assembly, EnvironmentArg[] additionalEnvironment, String[] args) in c:\Agent\work\2f9f8fe94ae5352e\src\Utils\src\Runtime\ProcessRun.cs:line 42
[07:39:25]: [Step 3/4]    at JetBrains.TeamCity.Utils.Runtime.ProcessRun.RunWithCommandLine(PlatformVersion env, PlatformType platform, String assembly, String[] args) in c:\Agent\work\2f9f8fe94ae5352e\src\Utils\src\Runtime\ProcessRun.cs:line 34
[07:39:25]: [Step 3/4]    at JetBrains.TeamCity.Utils.Runtime.RunInRuntime.ForkInRuntime(PlatformVersion version, PlatformType type, String executable, String[] args) in c:\Agent\work\2f9f8fe94ae5352e\src\Utils\src\Runtime\RunInRuntime.cs:line 50
[07:39:25]: [Step 3/4]    at JetBrains.TeamCity.NUnitCommon.PlugableRunFactory.RunProcessAsPlugable.Run() in c:\Agent\work\2f9f8fe94ae5352e\src\TestRunnerCommon\src\PlugableRunFactory.cs:line 31
[07:39:25]: [Step 3/4]    at JetBrains.BuildServer.NAntLoggers.NUnitLauncher2.ExecuteTasks(ITestRunArguments arguments, IPlugableTestRunner[] plugRuns) in c:\Agent\work\2f9f8fe94ae5352e\src\NUnitBootstrap\src\NUnitLauncher2.cs:line 121
[07:39:25]: [Step 3/4]    at JetBrains.BuildServer.NAntLoggers.NUnitLauncher2.Run2(String[] args) in c:\Agent\work\2f9f8fe94ae5352e\src\NUnitBootstrap\src\NUnitLauncher2.cs:line 101
[07:39:25]: [Step 3/4]    at JetBrains.BuildServer.NAntLoggers.NUnitLauncher2.Run(String[] args) in c:\Agent\work\2f9f8fe94ae5352e\src\NUnitBootstrap\src\NUnitLauncher2.cs:line 50
[07:39:25]: [Step 3/4] Failed to start process. Access is denied. Path: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE, arguments: /runconfig:C:\TC\wrk\debug\TeamCity.testrunconfig "/testmetadata:C:\TC\wrk\debug\Portal Clientes.vsmdi" /resultsfile:C:\TC\tmp\buildTmp\tmp290.tmp.teamcity.trx "/testlist:Prosper.TestLibrary
Prosper.MicroFramework", at C:\TC\wrk\debug
   at JetBrains.TeamCity.Utils.ProcessRunnerBase.Run(ProcessStartInfo psi) in c:\Agent\work\2f9f8fe94ae5352e\src\Utils\src\ProcessRunnerBase.cs:line 65
   at JetBrains.TeamCity.Utils.Runtime.ProcessRun.Execute(IRunProcess proc) in c:\Agent\work\2f9f8fe94ae5352e\src\Utils\src\Runtime\ProcessRun.cs:line 107
   at JetBrains.TeamCity.Utils.Runtime.ProcessRun.Run(String executable, PlatformVersion env, PlatformType platform, EnvironmentArg[] envKeys, String[] args) in c:\Agent\work\2f9f8fe94ae5352e\src\Utils\src\Runtime\ProcessRun.cs:line 51
   at JetBrains.TeamCity.Utils.Runtime.ProcessRun.RunWithCommandLine(PlatformVersion env, PlatformType platform, String assembly, EnvironmentArg[] additionalEnvironment, String[] args) in c:\Agent\work\2f9f8fe94ae5352e\src\Utils\src\Runtime\ProcessRun.cs:line 42
   at JetBrains.TeamCity.Utils.Runtime.ProcessRun.RunWithCommandLine(PlatformVersion env, PlatformType platform, String assembly, String[] args) in c:\Agent\work\2f9f8fe94ae5352e\src\Utils\src\Runtime\ProcessRun.cs:line 34
   at JetBrains.TeamCity.Utils.Runtime.RunInRuntime.ForkInRuntime(PlatformVersion version, PlatformType type, String executable, String[] args) in c:\Agent\work\2f9f8fe94ae5352e\src\Utils\src\Runtime\RunInRuntime.cs:line 50
   at JetBrains.TeamCity.NUnitCommon.PlugableRunFactory.RunProcessAsPlugable.Run() in c:\Agent\work\2f9f8fe94ae5352e\src\TestRunnerCommon\src\PlugableRunFactory.cs:line 31
   at JetBrains.BuildServer.NAntLoggers.NUnitLauncher2.ExecuteTasks(ITestRunArguments arguments, IPlugableTestRunner[] plugRuns) in c:\Agent\work\2f9f8fe94ae5352e\src\NUnitBootstrap\src\NUnitLauncher2.cs:line 121
   at JetBrains.BuildServer.NAntLoggers.NUnitLauncher2.Run2(String[] args) in c:\Agent\work\2f9f8fe94ae5352e\src\NUnitBootstrap\src\NUnitLauncher2.cs:line 101
   at JetBrains.BuildServer.NAntLoggers.NUnitLauncher2.Run(String[] args) in c:\Agent\work\2f9f8fe94ae5352e\src\NUnitBootstrap\src\NUnitLauncher2.cs:line 50
   [07:39:25]: [Step 3/4] Process exited with code -1


A more detailed log of this step is attached to this post.



Attachment(s):
teamCity.Log.zip
4 comments
Comment actions Permalink

Please check path to MSTest that you have specified. It could contain an mistake path.
Please also check you have properly installed Visual studio on the build agent machine.

0
Comment actions Permalink

Same here.  I can run the MSTests from the command line with what TeamCity reports it is trying to run.  I've given every permission possible to the dir it's trying to work.  Still get this damn error.

0
Comment actions Permalink

Please provide your logs too.

Does the logged path exist on the build agent machine?

What user account is used to run build agent windows service?

0
Comment actions Permalink

Yes the path exists.  I can run MSTest from the comand line with the arguements that were in the log.

I tried every account thinkable to run the service, still got the same error.

I did end up figuring it out.  No thanks to the awful and misleading error message.  Somewhere TeamCity understood what I had entered since I used the arguments it generated to run MSTest.  But the NUnitLauncher did not and would fail:  ERROR JetBrains.BuildServer.NAntLoggers.NUnitLauncher2 - Failed to parse arguments

It ended up being the wild card path I entered to say which test dll's to run.  It didn't like *.dll but did work with  **/bin/Release/*.Test.dll   Yet both produced the same arguments listed in the logs.  The worst part is the error is extremely misleading.  I didn't figure it out until I ran C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe #TeamCityImplicit from the command line and Googled the error it posted.

0

Please sign in to leave a comment.