dx-devops-test-suite-run
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRun a DevOps Center Test Suite
运行DevOps Center测试套件
Triggers a DevOps Center test suite execution and watches it to completion. Running and polling are two halves of one operation — never poll without first having (or being handed) a .
runIdAPI version: All DevOps testing system calls target Salesforce API v67.0 (minimum required).
Important: All DevOps Center data lives in the Salesforce org — NOT the local repo. Always query the org with or .
sf data querysf api request rest触发DevOps Center测试套件执行并监控直至完成。运行和轮询是同一操作的两个部分——绝不要在未获取(或未被提供)的情况下进行轮询。
runId**API版本:**所有DevOps测试系统调用均针对Salesforce API v67.0(最低要求版本)。
**重要提示:**所有DevOps Center数据均存储在Salesforce组织中——而非本地仓库。请始终使用或查询组织数据。
sf data querysf api request restPrerequisites
前提条件
Run the prerequisite checks in — Prerequisites 1–4 and Prerequisite 5 (stage), since this skill operates on a specific stage. You need the confirmed , , and .
references/prerequisite-checks.mddoce-org-aliaspipelineIdstageId运行中的前提条件检查——前提条件1–4 以及前提条件5(阶段),因为此技能针对特定阶段运行。您需要已确认的、和。
references/prerequisite-checks.mddoce-org-aliaspipelineIdstageIdInputs required
所需输入
| Input | How to obtain |
|---|---|
| Prerequisite 4 (pipeline selection) |
| Prerequisite 5 (pipeline stage confirmation) |
| Confirm with user: |
| Confirmed suite IDs from selection or recommendation |
| Prerequisite 1 |
| 输入项 | 获取方式 |
|---|---|
| 前提条件4(流水线选择) |
| 前提条件5(流水线阶段确认) |
| 与用户确认: |
| 从选择或推荐中获取已确认的套件ID |
| 前提条件1 |
Step 1 — Trigger execution
步骤1 — 触发执行
Confirmation gate
确认环节
This call mutates org state — do not proceed without explicit user confirmation. Before calling the API, show:
"I'm about to run tests with the following configuration:
- Pipeline:
<pipelineName>- Stage:
<stageName>- Event:
<event>- Suite(s):
<suiteName(s)>- Org:
<doce-org-alias>Shall I proceed?"
Do not make the API call until the user confirms.
**此调用会修改组织状态——未获得用户明确确认请勿继续。**调用API前,请展示以下内容:
"我即将按以下配置运行测试:
- 流水线:
<pipelineName>- 阶段:
<stageName>- 事件:
<event>- 测试套件:
<suiteName(s)>- 组织:
<doce-org-alias>是否继续?"
获得用户确认后再进行API调用。
API call
API调用
bash
sf api request rest \
"/services/data/v67.0/connect/devopstesting/pipeline/<pipelineId>/stage/execute" \
--method POST \
--body '{
"stageId": "<stageId>",
"event": "<event>",
"testSuiteIds": ["<suiteId1>", "<suiteId2>"]
}' \
--target-org <doce-org-alias>| Field | Type | Description |
|---|---|---|
| string | The ID of the pipeline stage to execute tests on |
| string | |
| string[] | One or more test suite IDs to execute |
bash
sf api request rest \
"/services/data/v67.0/connect/devopstesting/pipeline/<pipelineId>/stage/execute" \
--method POST \
--body '{
"stageId": "<stageId>",
"event": "<event>",
"testSuiteIds": ["<suiteId1>", "<suiteId2>"]
}' \
--target-org <doce-org-alias>| 字段 | 类型 | 描述 |
|---|---|---|
| 字符串 | 要执行测试的流水线阶段ID |
| 字符串 | |
| 字符串数组 | 要执行的一个或多个测试套件ID |
On success
执行成功
Extract the (execution ID) from the response. Inform the user:
runId"Tests are running in. I'll update you when results are ready."<doce-org-alias>
Then proceed immediately to Step 2 (polling) with the .
runId从响应中提取(执行ID)。告知用户:
runId"测试正在中运行。结果就绪后我会通知您。"<doce-org-alias>
随后立即使用进入步骤2(轮询)。
runIdOn error
执行失败
See . If the org rejects execution (e.g. , or ), read the actual error, explain the root cause and required fix in plain language, and finish cleanly. Do not retry in a loop and do not fabricate a or results.
references/error-handling.mdenvironmentId: nullclassIdList is null or empty — no tests to executerunId请查看。如果组织拒绝执行(例如,或),请读取实际错误信息,用通俗易懂的语言解释根本原因和所需修复措施,然后干净地结束流程。请勿循环重试,也不要伪造或测试结果。
references/error-handling.mdenvironmentId: nullclassIdList is null or empty — no tests to executerunIdStep 2 — Poll until completion
步骤2 — 轮询直至完成
Confirmation required: No — polling is automatic and read-only.
Poll the execution record by at the provider-appropriate interval. Full intervals, timeout behavior, and the poll query are in .
runIdreferences/polling-configuration.mdSummary of the loop (the is a Id — poll that object, not ):
runIdDevopsTestSuiteExecutionDevopsTestExecution- Query by
DevopsTestSuiteExecutioneach interval forrunId.Status, Coverage, SuccessCount, FailureCount, QualityGateStatus - → wait and poll again.
InProgress - /
Passed→ surfaceFailed,Coverage,SuccessCount, andFailureCountinline (no raw JSON). IfQualityGateStatus, fetch the childFailureCount > 0failure rows and hand off toDevopsTestExecution.dx-devops-test-failures-analyze - → the run itself errored (not test failures); surface
Error/ResultDetailsin plain language and offer retry or skip.Message - Timeout → surface the , do NOT auto-retry, wait for user instruction.
runId
**是否需要确认:**否——轮询是自动且只读的。
按供应商指定的间隔通过轮询执行记录。完整的间隔设置、超时行为和轮询查询请参见。
runIdreferences/polling-configuration.md循环流程概述(是的ID——请轮询该对象,而非):
runIdDevopsTestSuiteExecutionDevopsTestExecution- 每隔一个间隔通过查询
runId的DevopsTestSuiteExecution字段。Status, Coverage, SuccessCount, FailureCount, QualityGateStatus - 状态为→ 等待并再次轮询。
InProgress - 状态为/
Passed→ 直接展示Failed、Coverage、SuccessCount和FailureCount(不展示原始JSON)。如果QualityGateStatus,获取子级FailureCount > 0的失败记录并移交至**DevopsTestExecution**。dx-devops-test-failures-analyze - 状态为→ 测试运行本身出错(并非测试用例失败);用通俗易懂的语言展示
Error/ResultDetails,并提供重试或跳过选项。Message - 超时 → 展示,请勿自动重试,等待用户指令。
runId
Retrigger mode (re-running a quality gate)
重新触发模式(重新运行质量门)
Use when a promotion was blocked by a gate failure and the coverage gap has since been addressed. All preconditions, gate, and the retrigger API call are in . Key rule: do not retrigger unless the latest meets or exceeds the threshold. After the retrigger returns a new , hand it to Step 2 (polling).
references/retrigger-mode.mdCoverageDevopsQualityGateRulerunId当推广因质量门失败而被阻止,且覆盖率缺口已得到解决时使用此模式。**所有前置条件、确认环节和重新触发API调用请参见。**核心规则:仅当最新的达到或超过阈值时,才可重新触发。重新触发返回新的后,将其移交至步骤2(轮询)。
references/retrigger-mode.mdCoverageDevopsQualityGateRulerunIdRelated skills
相关技能
- — receives the failure payload on completion; can also create a fix work item.
dx-devops-test-failures-analyze - — recommend which suites to run, or assign a suite to the stage if it isn't linked yet.
dx-devops-test-suite-assignments-configure - — configure a new quality gate or threshold (this skill only re-runs existing gates).
dx-devops-test-pipeline-configure
- — 在测试完成时接收失败负载;还可创建修复工作项。
dx-devops-test-failures-analyze - — 推荐应运行的测试套件,或在测试套件未关联至阶段时将其分配给该阶段。
dx-devops-test-suite-assignments-configure - — 配置新的质量门或阈值(本技能仅重新运行现有质量门)。
dx-devops-test-pipeline-configure