2

I am having some trouble running a build definition on TFS 2015 (I'm working on-prem). I have the same setup on a different project (on a different Collection) and it is working there. Searching for any differences doesn't help finding the error or a solution.

In the build definition I have the 3 steps needed to deploy the testagent to a Test Machine Group:

  • Visual Studio Test Agent Deployment
  • Windows Machine File Copy
  • Visual Studio Test using Test Agent

A Test Machine Group is configured, all selections are set to "Select Machines By Machine Names" and the Filter Criteria are left empty.

The first 2 steps run correct, in the third step I keep getting this error message: "No matching test machines found in machine group. Check the machine filters provided in the task and ensure that DeployTestAgent task was added prior to this task and it had passed."

Not a very helpfull message if the filter is empty. Even in the logs, there are no clues:

2016-03-01T10:30:29.6282513Z Executing the powershell script: C:\TfsBuildAgents\VsoBuildAgent\tasks\RunVisualStudioTestsusingTestAgent\1.0.10\RunDistributedTests.ps1

2016-03-01T10:30:30.1449123Z ##[warning]For troubleshooting, refer http://aka.ms/remotevstest.

2016-03-01T10:30:30.1449123Z ##[error]No matching test machines found in machine group. Check the machine filters provided in the task and ensure that DeployTestAgent task was added prior to this task and it had passed.

By known I've even checked the capabilities of the Agent queue, but cannot find the setting that is causing this.

Any help or things to check?

Community
  • 1
  • 1
Rob Bos
  • 1,320
  • 1
  • 10
  • 25

2 Answers2

0

With the same settings but in different collection, may be the permissions settings.

Please make sure the account used to run Build Agent have access to the TFS project collection. Go to Builds, right-click on one ‘issue’ vnext build definition and select Security…, in the opened TFS Web Access security page, ensure Project Build Service user and Project Collection Build Service user both have required permissions for your vnext build definition.

enter image description here

Also check the Event Log on TFS server and build agent to check whether there was anything valuable.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • I've checked the settings and found in both collections that the 'Project Build Service' user wasn't linked. Adding it didn't change anything. Next step was starting clean within the failing collection and only add the steps to Deploy the agent, copy the neccesary files and run the agent. Guess what? It works in the new build definitiion! Been searching for any differences, but cannot find them yet. – Rob Bos Mar 03 '16 at 16:05
  • 1
    Additional note: No messages in the Event Log – Rob Bos Mar 03 '16 at 19:17
0

Found a difference that shouldn't make a difference, but it seems to fix the issue. Maybe I've found 3 differences, but my guess is on the first :-). Will test now.

TFS Diff on last change

Rob Bos
  • 1,320
  • 1
  • 10
  • 25
  • Looks like this shouldn't be the reason......Unless you forget to pass the values to variable (username) Which one failed ? Guess right failed. – PatrickLu-MSFT Mar 04 '16 at 09:57
  • Thats the strange thing: the left one was failing. I did forget to add a value to the $(Username) once and I did get an error telling that. – Rob Bos Mar 04 '16 at 12:22
  • Reverting back to the old settings doesn't fail the build step anymore! There must be a different reason why it didn't work before, but works now. I'll update when I've found something else that could be the reason. – Rob Bos Mar 04 '16 at 12:23