Hi. Today I want show you how resolve errors connect with execute batch file in deploy step before
execute tests.
So in my case I have:
- TFS 2015
- Test Controller 2013
- Test Agent 2013
- Microsoft Test Manager.
This scripts you shouldn't put to test agent!
If you write path: C:\temp\test.bat
You should put to temp folder put test.bat file.
After that you want try execute test, and you see error:
TestOutcome 'Error'; Message 'The setup batch file exited with error code 1
Standard Console Output:
C:\Users\***\AppData\Local\VSEQT\QTAgent\***\***\Deployment>REM ****************************************************************************
C:\Users\***\AppData\Local\VSEQT\QTAgent\***\***\Deployment>REM * Generated by Microsoft Visual Studio
C:\Users\***\AppData\Local\VSEQT\QTAgent\***\***\Deployment>REM * Copyright (c) Microsoft Corporation. All rights reserved.
C:\Users\***\AppData\Local\VSEQT\QTAgent\***\***\Deployment>REM *
C:\Users\***\AppData\Local\VSEQT\QTAgent\***\***\Deployment>REM ****************************************************************************
C:\Users\***\AppData\Local\VSEQT\QTAgent\***\***\Deployment>set DeploymentDirectory=C:\Users\***~1\AppData\Local\VSEQT\QTAgent\***\***-~1.COM\DEPLOY~1
C:\Users\***\AppData\Local\VSEQT\QTAgent\***\***\Deployment>set BuildDirectory=\\X.X.X.X\***
C:\Users\***\AppData\Local\VSEQT\QTAgent\***\***\Deployment>set TestRunDirectory=C:\Users\***~1\AppData\Local\VSEQT\QTAgent\***\***-~1.COM
C:\Users\***\AppData\Local\VSEQT\QTAgent\***\***\Deployment>set TestRunResultsDirectory=C:\Users\***~1\AppData\Local\VSEQT\QTAgent\***\***-~1.COM\Results\***-~1.COM
C:\Users\***\AppData\Local\VSEQT\QTAgent\***\***\Deployment>set TotalAgents=1
C:\Users\***\AppData\Local\VSEQT\QTAgent\***\***\Deployment>set AgentWeighting=100
C:\Users\***\AppData\Local\VSEQT\QTAgent\***\***\Deployment>set AgentLoadDistributor=Mic"
So in my case my batch file execute powershell script:
Powershell.exe -command "C:\Temp\test.ps1" -parameter "someValue"
This issue connect with execution policy. You can add this parameter, and this is fix issue:
Powershell.exe -executionpolicy remotesigned -command "C:\Temp\test.ps1" -parameter "someValue"
i am still getting the error
ReplyDelete