# Dx Devops Test Suite Run

Runs DevOps Center test suites on a pipeline stage (Pre-Promote, Post-Promote, or...

- Repository: https://github.com/forcedotcom/sf-skills (1134 stars)
- Category: Testing
- License: Apache-2.0
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add forcedotcom/sf-skills --skill dx-devops-test-suite-run -g -a claude-code -y`
Codex: `npx skills add forcedotcom/sf-skills --skill dx-devops-test-suite-run -g -a codex -y`
Cursor: `npx skills add forcedotcom/sf-skills --skill dx-devops-test-suite-run -g -a cursor -y`
Gemini CLI: `npx skills add forcedotcom/sf-skills --skill dx-devops-test-suite-run -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add forcedotcom/sf-skills`

## 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).

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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>
```

The rest: https://github.com/forcedotcom/sf-skills/blob/HEAD/plugins/builder/dx-devops/skills/dx-devops-test-suite-run/SKILL.md
