refactor: Remove redundant task query in test API upload command

- Remove unnecessary API call to fetch tasks
- Simplify test execution flow by eliminating wait_for_task_done call
- Improve code efficiency in the test API upload command
This commit is contained in:
bobo.yang 2025-03-21 21:24:46 +08:00
parent 607ce67792
commit f2f0a10a9e

View File

@ -230,14 +230,6 @@ def main():
api_path_id = get_path_op_id(api_path, method)
with Step("开始查询测试脚本执行结果..."):
while True:
res = session.get(
f"{SERVER_URL}/autotest/projects/{PROJECT_ID}/tasks",
params={"page": 1, "size": 1},
)
ret = res.json()
task = ret["tasks"][0]
task_id = task["id"]
wait_for_task_done(task_id)
testcase = get_testcase(api_path_id)
last_testcode_passed = testcase["last_testcode_passed"]
if last_testcode_passed: