Showing posts with label lab management. Show all posts
Showing posts with label lab management. Show all posts

Wednesday, August 8, 2012

TFS 2012 RC - Test Controller is shown as offline

If you go to Microsoft Test Manager->Lab Center->Controllers and see the Test Controller as offline, check the event logs on the same machine.
If you see the below error:
The description for Event ID 0 from source VSTTExecution cannot be found. Either the component that raises this event is not installed on your local computer
or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
(mtm.exe, PID 2968, Thread 13) ControllerConnectionManager : InternalConnect : System.Net.Sockets.SocketException (0x80004005): The requested name is valid,
but no data of the requested type was found
Server stack trace:
   at System.Net.Dns.GetAddrInfo(String name)
   at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
   at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
   at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
   at System.Runtime.Remoting.Channels.RemoteConnection.GetSocket()
   at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream,

ITransportHeaders& responseHeaders, Stream& responseStream)
   at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.VisualStudio.TestTools.Execution.IControllerAccessManager.get_ControllerVersion()
   at Microsoft.VisualStudio.TestTools.Execution.ExecutionUtilities.GetControllerVersion(IControllerAccessManager accessManager, Boolean

tolerateOldControllers)
   at Microsoft.VisualStudio.TestTools.Controller.ControllerConnectionManager.InternalConnect(ControllerConnectionInfo controllerConnectionInfo)

the message resource is present but the message is not found in the string/message table

Find out the exact machine name for the test controller by running the following query:
USE [Tfs_DefaultCollection]
GO

SELECT [PartitionId]
      ,[InternalId]
      ,[Name]
      ,[Description]
      ,[GroupId]
      ,[LastHeartbeat]
  FROM [dbo].[tbl_TestController]
GO


Then make sure that you are able to ping the full computer name which is present in the [Name] column (exclude the port number) .
The issue I was facing was that I was able to ping the computer name but not the full computer name. Once you are able to ping the full computer name, reconfiguring the test controller should fix the issue.

Thursday, October 20, 2011

TFS 2010 - Lab Build Definition appends the configuration to build output path $(BuildLocation)

Consider you have two build definitions:
  • DailyBuild - Uses DefaultTemplate.xaml
  • CIBuild - Uses LabDefaultTemplate.xaml
If you do not specify any configurations explicitly in DailyBuild, the CIBuild would work fine and you will be able to run the Build-Deploy-Test workflow smoothly.

However, as soon as you explicitly specify a configuration in DailyBuild, the CIBuild would start failing because it wont be able to find the binaries in the build drop.
This is because it appends the configuration to build output path in $(BuildLocation)

The solution is to modify the LabDefaultTemplate.xaml
Before:
<If Condition="[LabWorkflowParameters.BuildDetails.IsTeamSystemBuild = True]" DisplayName="Compute build location needed" sap:VirtualizedContainerService.HintSize="858,201">
       <If.Then>
         <Assign DisplayName="Compute build path" sap:VirtualizedContainerService.HintSize="291,100">
           <Assign.To>
             <OutArgument x:TypeArguments="x:String">[BuildLocation]</OutArgument>
           </Assign.To>
           <Assign.Value>
             <InArgument x:TypeArguments="x:String">[If(LabWorkflowParameters.BuildDetails.Configuration Is Nothing, BuildLocation, If(LabWorkflowParameters.BuildDetails.Configuration.IsEmpty Or (SelectedBuildDetail.Information.GetNodesByType(Microsoft.TeamFoundation.Build.Common.InformationTypes.ConfigurationSummary, True)).Count = 1, BuildLocation, If(LabWorkflowParameters.BuildDetails.Configuration.IsPlatformEmptyOrAnyCpu, BuildLocation + "\" + LabWorkflowParameters.BuildDetails.Configuration.Configuration, BuildLocation + "\" + LabWorkflowParameters.BuildDetails.Configuration.Platform + "\" + LabWorkflowParameters.BuildDetails.Configuration.Configuration)))]</InArgument>
           </Assign.Value>
         </Assign>
       </If.Then>
     </If>
 After:
 <If Condition="[LabWorkflowParameters.BuildDetails.IsTeamSystemBuild = True]" DisplayName="Compute build location needed" sap:VirtualizedContainerService.HintSize="858,201">
       <If.Then>
         <Assign DisplayName="Compute build path" sap:VirtualizedContainerService.HintSize="291,100">
           <Assign.To>
             <OutArgument x:TypeArguments="x:String">[BuildLocation]</OutArgument>
           </Assign.To>
           <Assign.Value>
             <InArgument x:TypeArguments="x:String">[BuildLocation]</InArgument>
           </Assign.Value>
         </Assign>
       </If.Then>
     </If>

Monday, September 12, 2011

TFS 2010 Lab Management - There are no test cases matching the criteria specified

Have you seen the below error while running the Build-Deploy-Test worklow using Lab Managemnt in TFS 2010. "There are no test cases matching the criteria specified. Use Microsoft Test Manager to view the test cases."

Following are the possible causes for this error:
  • You are not building the test projects in the Build. Hence the test binaries are missing in TestDirectory.
  • You have not selected the correct Test Plan or Test Suite in the Test section of the Lab Build Definition which has the automated test cases .
  • The Test Confirugation selected in the Test section of the Lab Build Definition does not match the Configuration selected for the automated test case in Microsoft Test Manager.

Sunday, March 27, 2011

TFS 2010 - hexadecimal value 0x07 is an invalid character

I recently encountered an issue where my tests in lab management were getting aborted. I really had a hard time figuring out what was really going wrong. I looked into the test run log in the Test Manager->Analyze Test Runs but nothing obvious showed up. I also enabled diagnostic logging in my lab build definition but again nothing showed up.
I then used tcm.exe and created a new test run using "tcm run /create". Then I executed the run using "tcm run /execute" and I got the error: "hexadecimal value 0x07 is an invalid character"
Then I looked into the intellitrace logs in "%localappdata%"\VSEQT\QTController. Here I found that there was an invalid xml in my Assert statement.
Fixing the xml in the Assert solved my problem.