configuring-test-provider

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Configuring a Test Provider

配置测试提供商

Configures an available test provider on a DevOps Center pipeline, making its test suites available for assignment to pipeline stages.
Confirmation required: Yes — explicit confirmation before the provider is configured.
在DevOps Center流水线中配置可用的测试提供商,使其测试套件可分配至流水线阶段。
需要确认: 是 — 在配置提供商前需获得用户明确确认。

Prerequisites

前提条件

Load
checking-devops-prerequisites
first — Prerequisites 1–4 (org login, Agentforce DX plugin, DevOps Center org auth, pipeline identified). Prerequisite 5 (stage) is not required: providers are configured at the pipeline level, not the stage level.
VariableSource
doce-org-alias
Established in Prerequisite 1
pipelineId
Identified in Prerequisite 4 (pipeline selection)
testProviderId
Resolved by fetching the pipeline's test providers (below)

首先加载
checking-devops-prerequisites
— 前提条件1–4(组织登录、Agentforce DX插件、DevOps Center组织授权、流水线已确定)。前提条件5(阶段)不需要:提供商是在流水线级别配置,而非阶段级别。
变量来源
doce-org-alias
在前提条件1中确立
pipelineId
在前提条件4(流水线选择)中确定
testProviderId
通过获取流水线的测试提供商(如下)解析得到

Step 1 — Fetch test providers to resolve the provider ID

步骤1 — 获取测试提供商以解析提供商ID

Get all test providers for the pipeline so you can resolve the
testProviderId
and confirm which providers are still available to configure:
bash
sf api request rest \
  "/services/data/v67.0/connect/devopstesting/pipeline/<pipelineId>/testProviders?status=all" \
  --target-org <doce-org-alias>
Each provider entry includes
testProviderId
,
testProviderName
, and a status (Configured vs. Available). Present a short summary grouped by status:
text
Test providers for <pipelineName>:

✓ Configured:
- Code Analyzer (63 suites)
- Apex Unit Tests (5 suites)

Available (not yet configured):
- Flow Tests
  • Only an Available provider can be configured. If the pipeline has no available providers, report that and stop — do NOT fabricate a provider or ID.
获取流水线的所有测试提供商,以便解析
testProviderId
并确认哪些提供商仍可配置:
bash
sf api request rest \
  "/services/data/v67.0/connect/devopstesting/pipeline/<pipelineId>/testProviders?status=all" \
  --target-org <doce-org-alias>
每个提供商条目包含
testProviderId
testProviderName
和状态(已配置 vs 可用)。按状态分组展示简短摘要:
text
Test providers for <pipelineName>:

✓ Configured:
- Code Analyzer (63 suites)
- Apex Unit Tests (5 suites)

Available (not yet configured):
- Flow Tests
  • 仅可用提供商可配置。如果流水线没有可用提供商,需告知用户并停止操作 — 请勿虚构提供商或ID。

If the named provider is already Configured

若指定提供商已配置

Do not present the confirmation gate and do not POST to the configure endpoint (Steps 2–3) — that would create a duplicate
DevopsPipelineTestProvider
. Instead:
  1. State plainly that the provider is already configured, including its synced suite count and last-sync time if returned (e.g. "Flow Tests is already configured on
    <pipelineName>
    with 3 suites synced (last sync 2026-06-23)."
    ).
  2. Diagnose the user's actual goal and redirect by name:
    • If the user says the provider's suites don't appear when assigning tests to a stage, this is a stage-assignment gap, not a provider-configuration gap — the suites already exist at the pipeline level; they just need to be linked to the stage. Redirect to
      managing-suite-assignments
      .
    • If the user expects newly created suites that aren't yet synced, redirect to
      syncing-test-providers
      (re-sync via
      POST /connect/devops/sync
      ) to pull them in.
  3. Do not loop back to configuring — finish cleanly after the explanation and redirect.
请勿展示确认环节,也请勿调用配置端点(步骤2–3)—— 否则会创建重复的
DevopsPipelineTestProvider
记录。请执行以下操作:
  1. 明确告知用户该提供商已配置,若返回同步套件数量和最后同步时间则一并说明(例如:"Flow Tests已在
    <pipelineName>
    上配置,已同步3个套件(最后同步时间2026-06-23)。"
    )。
  2. 判断用户的实际需求并按名称引导至对应技能:
    • 如果用户表示在为阶段分配测试时看不到该提供商的套件,这是阶段分配问题,而非提供商配置问题——套件已在流水线级别存在,只需关联至阶段。引导至**
      managing-suite-assignments
      **。
    • 如果用户希望获取新创建的未同步套件,引导至**
      syncing-test-providers
      **(通过
      POST /connect/devops/sync
      重新同步)以拉取这些套件。
  3. 解释并引导后结束操作,请勿回到配置流程。

Step 2 — Confirmation gate

步骤2 — 确认环节

Required — do not call the API before the user confirms.
"I'll configure
<testProviderName>
on the
<pipelineName>
pipeline. This will make its suites available for assignment to stages. Confirm?"
Do not proceed until the user gives an affirmative response.
必须执行 — 在用户确认前请勿调用API。
"我将在
<pipelineName>
流水线中配置
<testProviderName>
。配置完成后,其套件可分配至各个阶段。请确认是否继续?"
获得用户肯定答复后再继续。

Step 3 — Configure the provider

步骤3 — 配置提供商

On confirmation, call the configure endpoint with the provider ID:
bash
sf api request rest \
  "/services/data/v67.0/connect/devops/pipeline/<pipelineId>/testProvider" \
  --method POST \
  --body '{"testProviderId": "<testProviderId>"}' \
  --target-org <doce-org-alias>
确认后,调用配置端点并传入提供商ID:
bash
sf api request rest \
  "/services/data/v67.0/connect/devops/pipeline/<pipelineId>/testProvider" \
  --method POST \
  --body '{"testProviderId": "<testProviderId>"}' \
  --target-org <doce-org-alias>

On success

成功后

"Provider
<testProviderName>
is now configured on the
<pipelineName>
pipeline. Its suites are available for assignment to stages."
Newly configured suites can then be assigned to stages with
managing-suite-assignments
.

"
<testProviderName>
提供商已在
<pipelineName>
流水线中配置完成。其套件可分配至各个阶段。"
新配置的套件可通过
managing-suite-assignments
分配至阶段。

Critical gotcha

关键注意事项

This
POST .../pipeline/<pipelineId>/testProvider
endpoint creates a new provider configuration record (
DevopsPipelineTestProvider
). Use it ONLY to configure a provider for the first time. To re-sync an already-configured provider for new suites, use
syncing-test-providers
(
POST /connect/devops/sync
) — calling this configure endpoint on an already-configured provider produces duplicate
DevopsPipelineTestProvider
records.
POST .../pipeline/<pipelineId>/testProvider
端点会创建新的提供商配置记录
DevopsPipelineTestProvider
)。仅在首次配置提供商时使用该端点。若要重新同步已配置的提供商以获取新套件,请使用
syncing-test-providers
POST /connect/devops/sync
)—— 对已配置的提供商调用此配置端点会生成重复的
DevopsPipelineTestProvider
记录。

Error Handling

错误处理

Never expose raw API error messages, stack traces, or JSON payloads to the user. Map response status codes to plain-language messages:
StatusUser-facing message
400"The request was invalid. Check that the provider ID and pipeline ID are correct."
403"You don't have permission to configure test providers on this pipeline."
404"The pipeline or test provider was not found."
409"That provider appears to already be configured on this pipeline. To pick up new suites, re-sync it instead."
500"A server error occurred. Try again in a few minutes."

请勿向用户展示原始API错误信息、堆栈跟踪或JSON负载。将响应状态码转换为通俗易懂的提示:
状态码用户提示信息
400"请求无效。请检查提供商ID和流水线ID是否正确。"
403"您没有权限在此流水线上配置测试提供商。"
404"未找到该流水线或测试提供商。"
409"该提供商似乎已在此流水线上配置。若要获取新套件,请重新同步它。"
500"发生服务器错误。请稍后重试。"

Related skills

相关技能

  • checking-devops-prerequisites
    — loaded first to establish org and pipeline context.
  • syncing-test-providers
    — once a provider is configured, use this to re-sync it later and pull in newly added suites.
  • managing-suite-assignments
    — after configuring a provider, use this to assign or map its suites to a pipeline stage.
  • recommending-devops-tests
    — to recommend which of the newly available suites to run.
  • checking-devops-prerequisites
    — 首先加载以确立组织和流水线上下文。
  • syncing-test-providers
    — 提供商配置完成后,可使用此技能重新同步以拉取新增的套件。
  • managing-suite-assignments
    — 配置提供商后,可使用此技能将其套件分配或映射至流水线阶段。
  • recommending-devops-tests
    — 推荐应运行哪些新可用的套件。