at First im New to automated Tests with TFS, so i try actual many Things with try on Error. But I Hope you can give me some Ideas What i perhaps do wrong.
I have set up a Environment in Microsoft Test Manager like described in serveral Blogs from MSDN. http://msdn.microsoft.com/en-us/library/hh873102.aspx#Prerequisites for example.
My Infrastructure is as follows: The Build Server and Test Controller are on the Same Machine (Win2012) but my Test Agent(Win2008R2) is an other Machine. Everything is TFS 2013 or VS 2013 Update 3.
I have a Build definition which builds the Tests on the Buildserver into a specified Dropfolder. This is working fine. And a Second Build Definition which uses the LabDefaultTemplate.11 for working with the Environment. Within i specified the Environment, the other Build Definiton a Deployment Script and also my Testplan with the associated Automated Tests.
But if i try to Start my Build-Deploy-Test Workflow i have got two outcomes. First, without specifed a Deploment Script the Workflow Reaches Test Run and the Workflow became endless (It runs 16 Hours) then i aborted it. And Second i specified the Deployment Script and now it seems i get the same but on the Deployment Step. I let it Run for almost 20 Minutes and i watched my Agent on VM Console. All i saw is that he sometimes Disconnected for a short moment and then was Online again.
Now I'm Asking, why this Build Workflow could becomes endless?
The Tests would be CodedUiTests.
Here the Log of the last Run i stopped:
20:37 Overall Build Process
20:37 Application Deployment Workflow
00:00 Update Build Number
00:00 Get Build Details
01:00 If Build is needed
01:00 Do Build
00:00 Start Build Workflow
01:00 Wait For Build To Complete
00:00 Set Build Location
00:00 Get Build Location And Build Number
00:00 Compute build location needed
00:00 Compute build path
00:00 If user selected stored environment
00:00 Get Lab Environment Uri
00:00 Get Lab Environment
00:00 If Restore Snapshot
00:00 No Clean Snapshot
00:00 If Virtual Environment
00:00 If deployment or test needed
00:00 Wait For Environment To Be Ready
19:36 If deployment needed
19:36 Do deployment
00:00 Reserve Environment For Deployment
19:36 Deploy Build on Environment
19:36 Deploying Build
19:36 Run Deployment scripts
19:36 Run Deployment Task Deployment Task Logs for Machine: Win2008R2
00:00 Release Environment From Deployment
If you would need more specific informations please leave a Answer with the needed Things, and i will care about it, but i actual do not know what you could need and don't want to overfill this Question
Edit Dec 16th 2014:
Here the requested Details:
Deploying Build 00:30:00
Run Deployment scripts 00:30:00
Inputs
Values: Win2008R2TA02 | $(BuildLocation)\Uitest\deploymentScript.cmd $(BuildLocation)
Run Deployment Task00:30:00
Inputs
UseRoleForDeployment: False
MaxWaitTime: 00:30:00
ThrowOnError: True
BuildLocation: \\BuildServer\TFS Build\UiTest.Dev.Build\UiTest.Dev.Build_20141216.1
LabEnvironmentUri: vstfs:///LabManagement/LabEnvironment/11
DeploymentScriptDetails: Win2008R2TA02 | $(BuildLocation)\Uitest\deploymentScript.cmd $(BuildLocation)
The Deployment Script i found in the Internet, but i thought this could be working.
REM set build path
set buildlocation=%1
REM set deployment path
set targetdir="C:\deploy"
REM create deployment directory
if not exist %targetdir% (cmd /c mkdir %targetdir%)
REM copy build to the deployment directory
xcopy /c /y /e %buildlocation%\*.* %targetdir%
REM if you are using a deployment package you can run it here, after you copy it to your deployment directory
And i Call it as follows:
$(BuildLocation)\Uitest\deploymentScript.cmd $(BuildLocation)
In the Eventlog of the Test Controller there are some Errors Repeating while the Build is running: Service Control Managar:
The Visual Studio Test Controller service terminated unexpectedly. It has done this 1 time(s). The following corrective action will be taken in 0 milliseconds: Restart the service.
.Net Runtime:
Application: QTController.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.NullReferenceException Stack: at Microsoft.TeamFoundation.TestManagement.Controller.BuildDropDownloadManager.GetLocalSharePath(System.String) at Microsoft.VisualStudio.QualityTools.Controller.DeploymentTaskMonitor.IsUsingServerDrop(Microsoft.VisualStudio.TestTools.Execution.DeploymentTask) at Microsoft.VisualStudio.QualityTools.Controller.DeploymentTaskMonitor.ProvisionBuildSharePermision(Microsoft.VisualStudio.TestTools.Execution.DeploymentTask) at Microsoft.VisualStudio.QualityTools.Controller.DeploymentTaskMonitor.ProcessNewDeploymentTasks() at Microsoft.VisualStudio.QualityTools.Controller.DeploymentTaskMonitor.Poll(System.Object) at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Threading.ThreadHelper.ThreadStart(System.Object)
I tried this solution but i does not helping and related to the Link i have no "Web Access" Folder to clear the Cache out. https://social.msdn.microsoft.com/Forums/vstudio/en-US/c1ba09a8-5b8a-4c6d-8635-83085593647b/tfs-2013-deploy-to-testlab-is-failing-labdefaulttemplate11?forum=tfsbuild
I realy stuck on that Problem. Any Help would be very appreciated.