microsoft / microsoft/azure-devops-python-api

Failed to call method "create_test_run" in azure python api

Đang mở
#520 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Python
Star
684
Fork
218
Merge trung bình
8 ngày 10 giờ
Pull request đã merge (30 ngày)
1

Mô tả

Hi, i have a problem wih azure's python api. I self written function in python which calls official api from microscoft.

def create_test_run(self,
                        a_project_name: str = None,
                        a_comment: str = None,
                        a_test_run_name: str = None,
                        a_error_msg: str = None,
                        a_test_run_points=None,
                        a_test_plan=None
                        ) -> TestRun:
        """create_test_run
        :param str a_project_name: the name of the azure project where your test_plans are located
        :param str a_comment: a comment that shall be added to the newly created test run
        :param str a_test_run_name: the name of the test_run that shall be created
        :param str a_error_msg: an error message for this test_run that can be displayed in azure
        :param str a_test_run_points: a list of point_ids that reference azure TestPlan <-> TestSuite <-> TestCase relation
        :param :class:`ShallowReference <azure.devops.v5_1.microsoft._team_foundation._test_management._web_api.models.ShallowReference>` a_test_plan: the test_plan for which this test_run shall be created
        :rtype: :class:`<TestRun> <azure.devops.v5_1.test_results.models.TestRun>`
        """
        if None in (a_project_name, a_test_run_name, a_test_run_points, a_test_plan):
            raise InputError(
                f"cannot create test_run in azure with a_project_name={a_project_name}, a_test_run_name={a_test_run_name}, a_test_run_points={a_test_run_points}, a_test_plan={a_test_plan}")

self. LOGGER.debug(
            f"[create_test_run] creating create_test_run[{a_test_run_name}]")

test_run = RunCreateModel(automated=False,
                                  comment=a_comment,
                                  name=a_test_run_name,
                                  error_message=a_error_msg,
                                  plan=a_test_plan,
                                  point_ids=a_test_run_points
                                  # build=builds.value[0]            #TODO: check if we can add a build :class:`ShallowReference <azure.devops.v5_1.microsoft._team_foundation._test_management._web_api.models.ShallowReference>`
                                  )
        return self.connection.clients_v5_1.get_test_results_client().create_test_run(test_run=test_run, project=a_project_name)

Every time we send this request, it gives a 404 error back, that the ressource does not exist. After looking carefully into the microscofts python api carefully i saw something. The function create_test_run in https://github.com/microsoft/azure-devops-python-api/blob/dev/azure-devops/azure/devops/v7_1/test_results/test_results_client.py only exists in the branches with a version number like dev5.1 and dev7.1. In the branch which is called dev, this function exists in another location which is https://github.com/microsoft/azure-devops-python-api/blob/dev/azure-devops/azure/devops/v7_1/test/test_client.py and the location ids are not identical. I would be very grateful if you can take a closer look to these source files.

Thank you and best regards,

Daniel

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

So sánh các triển khai create_test_run được đề cập trong azure/devops/v7_1/test_results/test_results_client.py và azure/devops/v7_1/test/test_client.py, tập trung vào location ID và các phương thức client của chúng. Tái hiện yêu cầu với các đối số RunCreateModel đã cho và xác định tại sao yêu cầu trả về 404; hoàn thành khi xác định được thao tác chính xác và làm rõ hành vi hoặc cách sử dụng client.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
azure, python
Lĩnh vực
api
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.