microsoft / microsoft/azure-devops-python-api
Failed to call method "create_test_run" in azure python api
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 684
- フォーク
- 218
- 平均マージ
- 8日 10時間
- マージ済み PR(30日)
- 1
説明
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
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
azure/devops/v7_1/test_results/test_results_client.py と azure/devops/v7_1/test/test_client.py にある、言及されている create_test_run 実装を比較し、それぞれの location ID とクライアントメソッドに注目してください。示されている RunCreateModel 引数でリクエストを再現し、なぜ 404 が返されるのかを特定してください。正しい操作が特定され、クライアントの動作または使用方法が明らかになれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- azure, python
- 領域
- api
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100