dx-devops-test-suite-run
forcedotcom/sf-skills
Run DevOps Center test suites on pipeline stages and poll to completion.
What is dx-devops-test-suite-run?
Executes test suites on a Salesforce DevOps Center pipeline stage (Pre-Promote, Post-Promote, or Review) via the Connect API, polls by runId until completion, and surfaces results or hands failures to analysis. Use this when you need to run tests on a stage, re-run a quality gate after fixes, or watch an in-progress execution.
- Triggers async test suite execution on a specified pipeline stage after explicit user confirmation
- Polls execution status by runId at provider-specific intervals until completion, failure, or timeout
- Surfaces test results inline: coverage, success count, failure count, and quality gate status
- Hands failure payloads to dx-devops-test-failures-analyze for detailed failure analysis
- Retriggers a quality gate after fixes, but only once coverage meets the threshold
How to install dx-devops-test-suite-run
npx skills add https://github.com/forcedotcom/sf-skills --skill dx-devops-test-suite-run- Salesforce CLI v2.67.0 or later
- DevOps Center enabled in the target org (API v67.0 minimum)
- Confirmed doce-org-alias, pipelineId, and stageId from prerequisite checks
- At least one test suite assigned to the pipeline stage
How to use dx-devops-test-suite-run
- 1.Confirm the pipeline, stage, event type (Pre-Promote, Post-Promote, or Review), and test suite(s) with the user
- 2.Display the confirmation gate showing pipeline name, stage name, event, suite names, and org alias
- 3.Call the stage execute API with stageId, event, and testSuiteIds after user confirms
- 4.Extract the runId from the response and proceed immediately to polling
- 5.Poll DevopsTestSuiteExecution by runId at provider intervals until Status is Passed, Failed, or Error
- 6.Surface coverage, success count, failure count, and quality gate status inline when complete
- 7.If failures exist, fetch child DevopsTestExecution rows and hand off to dx-devops-test-failures-analyze
- 8.For retrigger mode, verify coverage meets the quality gate threshold before re-running the gate
Use cases
- Run pre-promotion or post-promotion test suites to validate code before or after deployment
- Re-run a quality gate after addressing coverage gaps to unblock a blocked promotion
- Poll and watch an in-progress test execution to completion without manual refresh
- Execute review-event tests on a pipeline stage to validate pull request changes
- Verify test coverage meets thresholds before allowing promotion to proceed
- Salesforce developers managing DevOps Center pipelines
- Release managers validating test suites before promotion
- CI/CD engineers automating quality gates in Salesforce deployments
dx-devops-test-suite-run FAQ
Use this skill to run test suites on a DevOps Center pipeline stage (Pre-Promote, Post-Promote, or Review). Use platform-apex-test-run to run sf apex run test directly in an org.
A runId is the execution ID returned by the stage execute API. It identifies the specific test run and is used to poll for results. Never poll without first triggering execution and obtaining a runId.
No. The retrigger API will only succeed if the latest coverage meets or exceeds the DevopsQualityGateRule threshold. Check coverage first before attempting a retrigger.
The skill surfaces the runId and does not auto-retry. Wait for user instruction on whether to retry, skip, or investigate the timeout.
No. This skill only runs and re-runs existing gates. Use dx-devops-test-pipeline-configure to set up a new gate or threshold.
Full instructions (SKILL.md)
Source of truth, from forcedotcom/sf-skills.
name: dx-devops-test-suite-run description: "Runs DevOps Center test suites on a pipeline stage (Pre-Promote, Post-Promote, or Review event) end to end: triggers async execution via the Connect API after an explicit confirmation gate, then polls by runId at provider-specific intervals until it completes, fails, or times out, and hands results to failure analysis. Also retriggers a quality gate after fixes, but only once coverage meets the threshold. Use this skill when a user wants to run, kick off, or launch test suites on a stage, re-run a quality gate, or watch an in-progress run to completion. TRIGGER when: the user wants to run/launch suites on a stage, execute tests before or after promotion, re-run a quality gate after fixing failures, unblock a blocked promotion after adding tests, or poll/watch an in-progress run. DO NOT TRIGGER when: running sf apex run test directly (use platform-apex-test-run), or configuring a NEW gate or threshold (use dx-devops-test-pipeline-configure)." metadata: version: "1.0" domains: ["Developer Experience"] minApiVersion: "67.0" relatedSkills: - "dx-devops-test-failures-analyze" - "dx-devops-test-pipeline-configure" - "dx-devops-test-suite-assignments-configure" - "platform-apex-test-run" cliTools: - tool: ["sf"] semver: ">=2.67.0"
Run a DevOps Center Test Suite
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 runId.
API 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 sf data query or sf api request rest.
Prerequisites
Run the prerequisite checks in references/prerequisite-checks.md — Prerequisites 1–4 and Prerequisite 5 (stage), since this skill operates on a specific stage. You need the confirmed doce-org-alias, pipelineId, and stageId.
Inputs required
| Input | How to obtain |
|---|---|
pipelineId | Prerequisite 4 (pipeline selection) |
stageId | Prerequisite 5 (pipeline stage confirmation) |
event | Confirm with user: Pre-Promote, Post-Promote, or Review |
testSuiteIds | Confirmed suite IDs from selection or recommendation |
doce-org-alias | Prerequisite 1 |
Step 1 — Trigger execution
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 call
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 |
|---|---|---|
stageId | string | The ID of the pipeline stage to execute tests on |
event | string | Pre-Promote, Post-Promote, or Review |
testSuiteIds | string[] | One or more test suite IDs to execute |
On success
Extract the runId (execution ID) from the response. Inform the user:
"Tests are running in
<doce-org-alias>. I'll update you when results are ready."
Then proceed immediately to Step 2 (polling) with the runId.
On error
See references/error-handling.md. If the org rejects execution (e.g. environmentId: null, or classIdList is null or empty — no tests to execute), 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 runId or results.
Step 2 — Poll until completion
Confirmation required: No — polling is automatic and read-only.
Poll the execution record by runId at the provider-appropriate interval. Full intervals, timeout behavior, and the poll query are in references/polling-configuration.md.
Summary of the loop (the runId is a DevopsTestSuiteExecution Id — poll that object, not DevopsTestExecution):
- Query
DevopsTestSuiteExecutionbyrunIdeach interval forStatus, Coverage, SuccessCount, FailureCount, QualityGateStatus. InProgress→ wait and poll again.Passed/Failed→ surfaceCoverage,SuccessCount,FailureCount, andQualityGateStatusinline (no raw JSON). IfFailureCount > 0, fetch the childDevopsTestExecutionfailure rows and hand off todx-devops-test-failures-analyze.Error→ the run itself errored (not test failures); surfaceResultDetails/Messagein plain language and offer retry or skip.- Timeout → surface the
runId, do NOT auto-retry, wait for user instruction.
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 references/retrigger-mode.md. Key rule: do not retrigger unless the latest Coverage meets or exceeds the DevopsQualityGateRule threshold. After the retrigger returns a new runId, hand it to Step 2 (polling).
Related skills
dx-devops-test-failures-analyze— receives the failure payload on completion; can also create a fix work item.dx-devops-test-suite-assignments-configure— recommend which suites to run, or assign a suite to the stage if it isn't linked yet.dx-devops-test-pipeline-configure— configure a new quality gate or threshold (this skill only re-runs existing gates).
Related skills
More from forcedotcom/sf-skills and the wider catalog.

dx-devops-work-item-manage
Manage DevOps Center work items—create, update, commit changes, and create pull requests.

dx-org-devhub-configure
Enable Dev Hub on a Salesforce org and view scratch org allocation limits.

dx-org-manage
Execute Salesforce org operations immediately: create, list, delete, and open scratch orgs via sf CLI.

dx-org-permission-set-assign
Assign permission sets to Salesforce org users via sf org assign permset command.

dx-org-switch
Switch the active Salesforce org for CLI commands using the Salesforce CLI.

dx-org-trial-expiration-check
Check Salesforce org trial expiration dates and days remaining across one or all authenticated orgs.