microsoft / microsoft/azure-devops-python-api

How to post Test Results to a test run.

未关闭
#415 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
684
派生
218
平均合并
8 天 10 小时
30 天内合并 PR
1

描述

Does anyone have sample code for posting Test Results to a Test Run? I have built a sample class which is working fine for many operations: get_projects, get_test_plans, get_test_case_list, get_test_runs, get_test_results, create_test_run. But when I try to post results to an existing or newly created test_run I get no errors, but only partial results. What I get is some data fields like: outcome, comment, owner, runBy comes through properly. But most fields, like testCaseTitle is a single title replicated for every test case, inside the test results there are no links to the Test Case or Test Project. I'm not sure if my test_results dictionary is incorrect or there are additional steps to creating a Test Run that I am missing. I have been trying to add 3 test case results like the one below, to a test run.

    test_results = [
            {
                "outcome": "passed",
                "errorMessage": "",
                "comment": "DevOps API Experiment",
                "dateStarted": "/Date(1648507431249)/",
                "dateCompleted": "/Date(1648507525480)/",
                "duration": 915770000,
                "testCaseId": 185,  # 185, 1071
                "configurationId": 6,
                "configurationName": "Windows 10",
                "testPointId": 128,  # 185-128, 1071-867
                "revision": 0,
                "state": "Completed",
                # "owner": "dd174dbe-01ab-6ee7-9aa8-a3ca22944639",  # User 2
                "owner": {"id": "6682ffe6-a175-640e-96a8-a3c8fdb046c7"},  # User 1
                # "runBy": "dd174dbe-01ab-6ee7-9aa8-a3ca22944639",
                "runBy": {"id": "6682ffe6-a175-640e-96a8-a3c8fdb046c7"},  # User 1
                "testCaseTitle": "Login Screen UX Elements",
                "testCaseArea": "",
                "dataRowCount": 0,
                "testCaseRevision": 1,
                "priority": 1,
                "planId": self.plan_id,
                "automatedTestName": "test_sample_azure_testplan.py",
            },

    response = self.harness.test_client.**add_test_results_to_test_run(test_results, self.project, self.run_id)**

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 add_test_results_to_test_run 和 issue 中显示的 test_results payload 开始,比较 testCaseId、testPointId、planId 及其他字段的处理方式。复现针对三个测试用例的调用,并验证每个结果都保留其各自不同的测试用例标题,并链接到预期的 Test Case 和 Test Project。

由索引模型根据 Issue 内容生成。

评估

技术栈
azure, python
领域
api, testing
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。