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

UIP TM 等待

uip tm wait轮询测试执行,直到它达到最终状态( PassedFailedCancelled等),然后打印一行摘要。它将异步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 <ms>] [--poll-interval <ms>]
uip tm wait --execution-id <uuid> (--project-key <key> | --test-set-key <key>)
            [--timeout <ms>] [--poll-interval <ms>]

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

UIP TM 等待

阻止,直到给定执行达到终止状态,以可配置的间隔轮询 Test Manager。

参数

无。

选项

  • --execution-id <uuid> (必填) — 要等待的执行。从uip tm testsets run获取。
  • --project-key <key> — 拥有项目。此参数或--test-set-key为必填项。
  • --test-set-key <key> — 测试集键(例如DEMO:42 );项目键从前缀派生。
  • --timeout <ms> — 要等待的最长时间,以毫秒为单位。默认为1800000 (30 分钟)。通过0可无限期等待。
  • --poll-interval <ms> — 轮询执行状态的频率(以毫秒为单位)。默认为60000 (60 秒)。
  • -t, --tenant <name> — 覆盖此调用的活动会话的租户。
  • --log-level <level>debuginfowarnerror 。默认值为Information

示例

# wait up to 15 minutes, polling every 30 seconds
uip tm wait \
  --execution-id a1b2c3d4-0000-0000-0000-000000000001 \
  --project-key DEMO \
  --timeout 900000 \
  --poll-interval 30000
# wait up to 15 minutes, polling every 30 seconds
uip tm wait \
  --execution-id a1b2c3d4-0000-0000-0000-000000000001 \
  --project-key DEMO \
  --timeout 900000 \
  --poll-interval 30000

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

{
  "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 报告(包括PassedFailedCancelled )。“已达到最终状态”是wait的成功信号 — 无论执行中的测试通过还是失败,动词都会退出0 。要根据通过/失败进行分支,请在wait返回后读取report get输出。

退出代码

wait遵循013的标准退出代码,并重用一次特定于域的2

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

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

脚本模式

if ! uip tm wait \
    --execution-id "$id" \
    --project-key DEMO \
    --timeout 1800000 \
    --poll-interval 30000; 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 1800000 \
    --poll-interval 30000; 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 论坛

保持更新