TFS Build 2015 未发布测试结果 [英] TFS Build 2015 not publishing test results

查看:26
本文介绍了TFS Build 2015 未发布测试结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新(我用一个新的基本解决方案重新构建了这个问题,并在那里存在同样的问题时进行构建)

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

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

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:

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

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.

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

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

这是由 TEST REST API 检索到的构建定义:

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

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

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

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

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

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

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:

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

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

推荐答案

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

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).

对于那些有同样问题的人,它显然会使 TFS 脱机,但只用了不到 5 分钟.

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

这篇关于TFS Build 2015 未发布测试结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆