在为ADO Test Plans构建OData查询时,是否可以建立TestPoints和TestResults之间的引用关系?

问题描述 投票:0回答:0

本质上,我希望能够从

TestResults
中收集一些与特定
TestCaseWorkItems 
相关的字段,但似乎无法找到任何关于 OData v4.0 预览版目前是否可行的确认信息。

我的特定查询正在为 Power BI 报告 ADO 测试计划而构建,我想拉回与

TestRuns
相关的
TestCases 
列表,属于
TestSuites 
驻留在特定 ADO
AreaPath
中,以及有许多字段值。

从 MS 文档here,我看到以下对象列表可用于建立彼此的关系:

  • TestSuites
  • TestConfiguration
  • TestPoints
  • TestCaseWorkItem

While

TestPoints 
do have fields like
LastResultOutcome
, multiple Tests can be run for the same
TestPoint
, and each Test has its own timestamp, outcome, and run details that I can't seem to use in reference to the
TestCase
他们属于。还有第二个对象列表,它们都相互关联,但我找不到它们与
TestSuite
/
TestPoint 
层次结构的关系。他们是:

  • TestResults
  • TestRuns
  • Tests
  • Pipelines
  • PipelineRuns

在 ADO 界面中,双击

TestPoint
TestCase
将打开该测试用例的执行历史记录,这表明这些
TestCase
项目能够以某种方式逻辑引用它们的运行,但是到目前为止我没有找到可以成功使用的字段。

测试项目确实有一个

TestCaseReferenceId
字段,但是这个字段不匹配
TestCaseId
中的
TestPoints
WorkItemId
TestCaseWorkItem
。从参考资料来看,这个字段显然是测试用例编号,而不是 ID。

我的查询目前看起来像这样:

https://analytics.dev.azure.com/{organization}/{project}/_odata/v4.0-preview/TestPoints? 
    $apply=filter(TestSuite/TestPlanWorkItem/Area/AreaPath eq '{areapath}') 
    &$select= 
        LastResultState,LastResultOutcome,ChangedDate,AnalyticsUpdatedDate, 
        TestPlanId,TestSuiteId,TestPointId,TestCaseId,Priority,AutomationStatus 
    &$expand=
        TestSuite( 
            $select= 
                TestPlanTitle,Title, 
                IdLevel1,TitleLevel1,IdLevel2,TitleLevel2, 
                IdLevel3,TitleLevel3,IdLevel4,TitleLevel4, 
                IdLevel5,TitleLevel5,Depth;
            $expand=TestPlanWorkItem($expand=Area($select=AreaPath))), 
        AssignedTo($select=UserName), 
        Tester($select=UserName), 
        TestCase(
            $select= 
                WorkItemId,InProgressDate,CompletedDate, 
                Revision,Title,WorkItemType,ChangedDate, 
                CreatedDate,State,Reason,ClosedDate,ResolvedDate, 
                Priority,StateCategory,StateChangeDate; 
            $expand= 
                ChangedBy($select=UserName), 
                ActivatedBy($select=UserName), 
                ClosedBy($select=Username), 
                ResolvedBy($select=Username)
                )

有没有办法将它与我缺少的 TestResults 联系起来?

azure-devops powerbi odata
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.