UiPath Documentation
uipath-cli
latest
false
UiPath CLI 用户指南
重要 :
请注意,此内容已使用机器翻译进行了本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

UIP TM 等待

“uip tmwait”的语法和选项,用于轮询测试执行,直到它达到最终状态并打印一行摘要。

uip tm wait轮询测试执行,直到它达到最终状态( Passed 、 Failed和Cancelled等),然后打印一行摘要。它将异步uip tm testsets run转变为 CI 管道中的阻止步骤。

wait注册为tm下的顶级动词,而非资源 — 将其作为uip tm wait而非uip tm executions wait进行调用。

大纲​

uip tm wait --execution-id <uuid> (--project-key <key> | --test-set-key <key>)
            [--timeout <seconds>]
uip tm wait --execution-id <uuid> (--project-key <key> | --test-set-key <key>)
            [--timeout <seconds>]

支持全局选项。有关超时时特定于域的行为,请参阅下面的退出代码部分。

UIP TM 等待​

阻止,直到给定执行达到终止状态,每 60 秒轮询一次 Test Manager(固定 — 不可配置)。

参数​

无。

选项​

  • --execution-id <uuid> (必填) — 要等待的执行。从uip tm testsets run获取。
  • --project-key <key> — 拥有项目。此参数或--test-set-key为必填项。
  • --test-set-key <key> — 测试集键(例如DEMO:42 );项目键从前缀派生。
  • --timeout <seconds> — 的最长时间等待,以秒为单位。默认为 1800(30 分钟)。通过 0 可无限期等待。
  • --log-level <level> — debug 、 info 、 warn 、 error 。默认值为Information 。
备注:

此命令没有 --poll-interval 标志。轮询间隔已硬编码为 60 秒,且无法覆盖。

示例​

# wait up to 15 minutes
uip tm wait \
  --execution-id a1b2c3d4-0000-0000-0000-000000000001 \
  --project-key DEMO \
  --timeout 900
# wait up to 15 minutes
uip tm wait \
  --execution-id a1b2c3d4-0000-0000-0000-000000000001 \
  --project-key DEMO \
  --timeout 900

数据形状 — 执行在超时前达到最终状态​

{
  "Code": "WaitComplete",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "Status": "Passed",
    "EndTime": "2025-04-15T10:32:11Z",
    "Duration": "00:02:11"
  }
}
{
  "Code": "WaitComplete",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "Status": "Passed",
    "EndTime": "2025-04-15T10:32:11Z",
    "Duration": "00:02:11"
  }
}

Status可以是任何最终状态 Test Manager 报告(包括Passed 、 Failed和Cancelled )。“已达到最终状态”是wait的成功信号 — 无论执行中的测试通过还是失败,动词都会退出0 。要根据通过/失败进行分支,请在wait返回后读取report get输出。

退出代码​

wait遵循0 、 1和3的标准退出代码,并重用一次特定于域的2 :

退出代码意义
0执行已在超时内达到终止状态。
1轮询失败(重复出现 API 错误、中断、中止)— 有关详细信息,请参阅Message字段。
2已超时。执行达到终止状态前已超时。
3验证错误(标志值错误、缺少必填选项)。

退出代码2是特定于域的。共享 CLI 合同为2保留AuthenticationError ,但wait会在超时时重用它,以便脚本无需解析文本即可区分“耗时过长”和“轮询真正失败”。有关完整模式,请参阅executions上的退出代码行为。

脚本模式​

if ! uip tm wait \
    --execution-id "$id" \
    --project-key DEMO \
    --timeout 1800; then
  case $? in
    2) echo "timed out" >&2; exit 2 ;;
    *) echo "wait failed" >&2; exit 1 ;;
  esac
fi
if ! uip tm wait \
    --execution-id "$id" \
    --project-key DEMO \
    --timeout 1800; then
  case $? in
    2) echo "timed out" >&2; exit 2 ;;
    *) echo "wait failed" >&2; exit 1 ;;
  esac
fi
  • 测试集运行— 生成ExecutionId ,以等待。
  • 报告— 要读取一次的摘要wait返回0 。
  • 结果— JUnit XML 导出。
  • 执行重试— 重新运行已完成执行的失败案例。

另请参阅​

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新