2
votes

UPDATE (I have restructured this question with a new and basic solution and build as the same problem exists there)

I'm using the new build system in Tfs 2015 and I'm using Update 1. I have noticed that on the build summary screen, no test results or Code Coverage results are submitted:

enter image description here

I have a test step which runs and contains results and I have a .trx and a .coverage file but the test step log contains the warning:

##[warning]Failed to publish test results: The value for the Build.Id property is not within the permissible values for it.

The Build is very basic, it contains 2 steps and Code Coverage is Enabled on the test step:

enter image description here

Here is the build def as retrieved by the TEST REST API:

    {  
   "build":[  
      {  
         "enabled":true,
         "continueOnError":false,
         "alwaysRun":false,
         "displayName":"Build solution $/IsdDev/SQTestBuild/Main/TestBuildSystem.sln",
         "task":{  
            "id":"71a9a2d3-a98a-4caa-96ab-affca411ecda",
            "versionSpec":"*"
         },
         "inputs":{  
            "solution":"$/IsdDev/SQTestBuild/Main/TestBuildSystem.sln",
            "msbuildArgs":"",
            "platform":"$(BuildPlatform)",
            "configuration":"$(BuildConfiguration)",
            "clean":"false",
            "restoreNugetPackages":"true",
            "vsVersion":"14.0",
            "msbuildArchitecture":"x86",
            "logProjectEvents":"true"
         }
      },
      {  
         "enabled":true,
         "continueOnError":false,
         "alwaysRun":false,
         "displayName":"Test Assemblies **\\$(BuildConfiguration)\\*test*.dll;-:**\\obj\\**",
         "task":{  
            "id":"ef087383-ee5e-42c7-9a53-ab56c98420f9",
            "versionSpec":"*"
         },
         "inputs":{  
            "testAssembly":"**\\$(BuildConfiguration)\\*test*.dll;-:**\\obj\\**",
            "testFiltercriteria":"",
            "platform":"$(BuildPlatform)",
            "configuration":"$(BuildConfiguration)",
            "runSettingsFile":"",
            "overrideTestrunParameters":"",
            "codeCoverageEnabled":"true",
            "vsTestVersion":"14.0",
            "pathtoCustomTestAdapters":"",
            "otherConsoleOptions":""
         }
      }
   ],
   "options":[  
      {  
         "enabled":false,
         "definition":{  
            "id":"7c555368-ca64-4199-add6-9ebaf0b0137d"
         },
         "inputs":{  
            "multipliers":"[]",
            "parallel":"false",
            "continueOnError":"true"
         }
      }
   ],
   "variables":{  
      "BuildConfiguration":{  
         "value":"debug",
         "allowOverride":true
      },
      "BuildPlatform":{  
         "value":"any cpu",
         "allowOverride":true
      }
   },
   "retentionRules":[  
      {  
         "branches":[  
            "+refs/heads/*"
         ],
         "artifacts":[  
            "build.SourceLabel"
         ],
         "daysToKeep":10,
         "deleteBuildRecord":true,
         "deleteTestResults":true
      }
   ],
   "_links":{  
      "self":{  
         "href":"http://removed/343974ee-60a8-40ee-a103-37fa5db37c41/_apis/build/Definitions/71"
      },
      "web":{  
         "href":"http://removed/_permalink/_build/index?collectionId=808a695f-85b6-49db-a2df-ca4aaf8bbb9f&projectId=343974ee-60a8-40ee-a103-37fa5db37c41&definitionId=71"
      }
   },
   "buildNumberFormat":"$(date:yyyyMMdd)$(rev:.r)",
   "createdDate":"2015-11-19T07:43:27.977Z",
   "jobAuthorizationScope":"projectCollection",
   "jobTimeoutInMinutes":60,
   "repository":{  
      "properties":{  
         "labelSources":"0",
         "labelSourcesFormat":"$(build.buildNumber)",
         "tfvcMapping":"{\"mappings\":[{\"serverPath\":\"$/IsdDev\",\"mappingType\":\"map\",\"localPath\":\"\\\\\"},{\"serverPath\":\"$/IsdDev/Drops\",\"mappingType\":\"cloak\",\"localPath\":\"\"}]}"
      },
      "id":"$/",
      "type":"TfsVersionControl",
      "name":"IsdDev",
      "url":"http://removed/",
      "defaultBranch":"$/IsdDev",
      "rootFolder":"$/IsdDev",
      "clean":"undefined",
      "checkoutSubmodules":false
   },
   "quality":"definition",
   "authoredBy":{  
      "id":"7d24caba-6c09-4b78-8ff1-2404e0b0ec64",
      "displayName":"Rod Hall",
      "uniqueName":"ISD-NR\\Rod.Hall",
      "url":"http://removed/_apis/Identities/7d24caba-6c09-4b78-8ff1-2404e0b0ec64",
      "imageUrl":"http://removed/_api/_common/identityImage?id=7d24caba-6c09-4b78-8ff1-2404e0b0ec64"
   },
   "queue":{  
      "pool":{  
         "id":2,
         "name":"Back Office Pool"
      },
      "id":2,
      "name":"Back Office Pool"
   },
   "uri":"vstfs:///Build/Definition/71",
   "type":"build",
   "revision":1,
   "id":71,
   "name":"SQ Test",
   "url":"http://removed/343974ee-60a8-40ee-a103-37fa5db37c41/_apis/build/Definitions/71",
   "project":{  
      "id":"343974ee-60a8-40ee-a103-37fa5db37c41",
      "name":"IsdDev",
      "url":"http://removed/_apis/projects/343974ee-60a8-40ee-a103-37fa5db37c41",
      "state":"wellFormed",
      "revision":7
   }
}

What is the Build.Id that the warning refers to, how can I view it and set it?

This could even be a problem with TFS 2015 Update 1...

UPDATE I'm not sure if it matters but when I go to the Build section of the TFS Admin Console it appears to not be configured:

enter image description here

I have my application tier on 1 server and then I have 3 Agent Pools each with 3 Agents. There are 3 build servers each of which have 1 agent from each pool installed for a total of 9 agents. I set these up using PowerShell and I downloaded the agent from the TFS page. My builds still work Ok, it's just this tests publishing

3
Could you share your detailed configuration of build vNext definition?Cece Dong - MSFT
@Rodders, please check my comment under my reply post.Vicky - MSFT

3 Answers

0
votes

Check the attached vNext build configuration, with which I can get the Test result and Code coverage. Make sure you have specified the solution in Visual Studio Build and select Code Coverage Enabled in Visual Studio Test.

enter image description here

0
votes

Credit to Jesse Houwing for helping me on this one. I had to detach and reattach the Team Project Collection using the TFS Admin Console on the App Server. It seems there is an issue with Update 1 (or perhaps one of the Release Candidates).

For those with the same problem, it will obviously take TFS offline but it took less than 5 minutes.

0
votes

I had a similar issue yesterday: Visual Studio Test using Test Agent step was failing with the "The value for the Build.Id property is not within the permissible values for it" error message when it was trying to execute Coded UI tests on the remote test machine. Detaching project collection and re-attaching it back fixed the issue.