Azure:无法更新测试用例结果:无法读取未定义的属性“length”

zpgglvta  于 2023-01-27  发布在  其他
关注(0)|答案(1)|浏览(91)

运行带有“发布JUnit测试和附件”任务的Maven管道时出现以下错误。
后台-通过使用Azure管道,将测试运行附件上传到测试用例中。
该任务由以下脚本中的“测试用例Map类型”组成

[
{
"className": "main.java.com.Tests.DMA_Smoke_SimpleLogin",
"methodName": "simpleLogin",
"testSuiteId": 5729,
"testCaseId": 5730
},
{
"className": "main.java.com.Tests.DMA_Regression_VerifyRequiredCode",
"methodName": "verifyRequiredCode",
"testSuiteId": 5729,
"testCaseId": 5731
}
]

错误详细信息-

Starting: Publish Results w Attch: 2702 Clone
==============================================================================
Task         : Publish JUnit Tests with Attachments (MetLife Cornerstone)
Description  : Publish test results with attachments tied to Azure Test Plan Test Cases
Version      : 1.4.2
Author       : MetLife Cornerstone
Help         : 
==============================================================================
Parsing JSON mapping: [
{
"className": "main.java.com.Tests.DMA_Smoke_SimpleLogin",
"methodName": "simpleLogin",
"testSuiteId": 5729,
"testCaseId": 5730,
"length":3534
},
{
"className": "main.java.com.Tests.DMA_Regression_VerifyRequiredCode",
"methodName": "verifyRequiredCode",
"testSuiteId": 5729,
"testCaseId": 5731,
"length":3535
}
]
Parsing JUnit Test Results file: D:\AzDOAgents\Agent1-MetLife-US-POC\_work\25\s\test-output\testng-results.xml
Creating test run entry.
200
Retrieved test run results
Unable to update test case results: Cannot read property 'length' of undefined
Completing testrun 1001010
200
{ id: 1001010,
  name: 'TestRun_QE framework mobile test_20221114.7',
  url: 'https://dev.azure.com/MetLife-US-POC/TechQA/_apis/test/Runs/1001010',
  build: { id: '2947' },
  isAutomated: true,
  owner: 
   { displayName: 'TechQA Build Service (MetLife-US-POC)',
     id: '81631c3a-706c-47af-bfee-a028667511b8' },
  project: { id: '8f053f76-b7f0-477f-9998-6a342ed0963d', name: 'TechQA' },
  startedDate: '2022-11-14T21:43:19.89Z',
  completedDate: '2022-11-14T21:43:20.603Z',
  state: 'Aborted',
  plan: { id: '5728' },
  totalTests: 2,
  incompleteTests: 0,
  notApplicableTests: 0,
  passedTests: 0,
  unanalyzedTests: 2,
  revision: 4,
  webAccessUrl: 'https://dev.azure.com/MetLife-US-POC/TechQA/_TestManagement/Runs?runId=1001010&_a=runCharts',
  pipelineReference: 
   { pipelineId: 2947,
     stageReference: {},
     phaseReference: {},
     jobReference: {} } }
Completed test run
##[error]Cannot read property 'length' of undefined

尝试了不同的方法来识别问题。但仍然无法获得解决方案。

yquaqz18

yquaqz181#

我能够通过合并xml文件并传递文件以更新测试用例来解决这个问题。

相关问题