Skip to main content
skill CX Codex

dx-devops-test-suite-run — Claude Code skill: what it does & setup

Triggers DevOps Center test suites on Salesforce pipeline stages and polls execution until finished. Useful for pre-promotion gates and re-running checks after code coverage fixes.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add forcedotcom/sf-skills --skill dx-devops-test-suite-run -a claude-code
Open on GitHub

What dx-devops-test-suite-run does

This skill triggers asynchronous test suite execution in DevOps Center for Pre-Promote, Post-Promote, or Review pipeline events. Calls target the Salesforce Connect API endpoint /services/data/v67.0/connect/devopstesting/pipeline/<pipelineId>/stage/execute. Before firing the POST request, the agent asks for confirmation because the call mutates org state.

Once triggered, polling begins automatically. The agent monitors the DevopsTestSuiteExecution object by runId at provider-specific intervals. It reads test coverage, failure counts, and gate status. If failures occur, the skill extracts failing DevopsTestExecution rows and sends them to dx-devops-test-failures-analyze.

All DevOps Center data lives in the Salesforce org. The local repository holds none of it. You need the sf CLI version >=2.67.0 and API v67.0. Retriggering a quality gate will abort unless code coverage meets or exceeds the rule threshold.

What it helps with

  • trigger DevOps Center test suites on a pipeline stage
  • poll asynchronous test execution until completion using runId
  • rerun a quality gate after code coverage fixes meet the threshold
  • hand over failing execution rows to dx-devops-test-failures-analyze

Example prompts for the agent

  • Run DevOps Center test suites on the Pre-Promote stage
  • Watch the in-progress test run using the runId
  • Retrigger the quality gate after fixing test coverage

How to install dx-devops-test-suite-run

1Skills CLI (Vercel)

npx skills add forcedotcom/sf-skills --skill dx-devops-test-suite-run -a claude-code

2Manually: put the files in place

~/.claude/skills/dx-devops-test-suite-run/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/dx-devops-test-suite-run/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about dx-devops-test-suite-run

How to install dx-devops-test-suite-run in Claude Code?

Run npx skills add forcedotcom/sf-skills --skill dx-devops-test-suite-run -a claude-code.

What does dx-devops-test-suite-run do?

It triggers DevOps Center stage test suites through the Connect API and polls execution progress until the run finishes or times out.

What are the prerequisites before executing this skill?

You need sf CLI version >=2.67.0, Salesforce API v67.0, and confirmed values for pipelineId, stageId, and doce-org-alias.

Source text

SKILL.md · Apache-2.0
---
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

```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 |
|---|---|---|
| `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 `DevopsTestSuiteExecution` by `runId` each interval for `Status, Coverage, SuccessCount, FailureCount, QualityGateStatus`.
- `InProgress` → wait and poll again.
- `Passed` / `Failed` → surface `Coverage`, `SuccessCount`, `FailureCount`, and `QualityGateStatus` inline (no raw JSON). If `FailureCount > 0`, fetch the child `DevopsTestExecution` failure rows and hand off to **`dx-devops-test-failures-analyze`**.
- `Error` → the run itself errored (not test failures); surface `ResultDetails`/`Message` in 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).

© forcedotcom · Apache-2.0 · forcedotcom/sf-skills

Similar skills

Everything for DevOps and infrastructure →

From the same set167

platform-trust-archive-manage A skill for Salesforce Archive work through the Archive Connect API: search, unarchive, mask and erase archived records. CX Codex +1 5,100installs integration-eventing-cdc-configure Generates Salesforce Change Data Capture metadata for standard and custom objects. Useful when configuring change event subscriptions and channels. CX Codex +1 5,100installs experience-cms-brand-apply Finds a brand in Salesforce CMS, pulls its guidelines, and applies voice, tone and style to whatever the agent writes. CX Codex +1 5,000installs experience-ui-bundle-agentforce-client-generate Embeds the Agentforce Conversation Client in React and Angular UI Bundle apps: detects the framework, validates agentId, wires the component into a page. CX Codex +1 5,000installs dx-devops-test-suite-assignments-configure Picks the test suites that match a commit and maps them onto DevOps Center pipeline stages. Useful when you don't know what to run after a change. CX Codex +1 5,000installs dx-devops-test-pipeline-configure Configures DevOps Center pipeline testing: enables a test provider so its suites show up, re-syncs a configured provider, or sets a quality gate on a stage. CX Codex +1 5,000installs experience-ui-bundle-site-generate Generates Salesforce Digital Experience Site infrastructure for hosting React UI bundles. Useful when setting up thin site containers, guest access, and locale configs. CX Codex +1 5,000installs data360-schema-get Pulls the list of Data Lake and Data Model objects from Salesforce Data Cloud, plus field-level schema for one object. Handy before you write a query. CX Codex +1 5,000installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor