TFS Build 2015 未发布测试结果

TFS Build 2015 not publishing test results

UPDATE(我用新的基本解决方案重组了这个问题,并构建了同样的问题)

我使用的是 Tfs 2015 中的新构建系统,我使用的是 Update 1。我注意到在构建摘要屏幕上,没有提交任何测试结果或代码覆盖率结果:

我有一个运行并包含结果的测试步骤,我有一个 .trx 和一个 .coverage 文件,但测试步骤日志包含警告:

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

构建非常基础,它包含 2 个步骤并且在测试步骤中启用了代码覆盖率:

这是 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
   }
}

warning指的Build.Id是什么,如何查看和设置?

这甚至可能是 TFS 2015 Update 1 的问题...

更新 我不确定它是否重要,但是当我转到 TFS 管理控制台的构建部分时,它似乎没有配置:

我的应用程序层位于 1 台服务器上,然后我有 3 个代理池,每个代理池有 3 个代理。有 3 个构建服务器,每个服务器从每个池安装 1 个代理,总共 9 个代理。我使用 PowerShell 进行了设置,并从 TFS 页面下载了代理。我的构建仍然有效 好的,只是这个测试发布

检查附加的 vNext 构建配置,通过它我可以获得测试结果和代码覆盖率。确保您在 Visual Studio Build 中指定了 解决方案 并且在 Visual Studio Test 中指定了 select 代码覆盖启用

感谢 Jesse Houwing 在这方面的帮助。我必须使用 App Server 上的 TFS 管理控制台分离并重新附加团队项目集合。 Update 1(或者可能是发布候选版本之一)似乎存在问题。

有同样问题的朋友,明明会把TFS下线,不过用了不到5分钟。

我昨天遇到了类似的问题:Visual Studio Test using Test Agent step was failed 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机器。分离项目集合并将其重新附加回去解决了这个问题。