Run one folder or one request in CI, not the whole collection

A collection grows. After a year it has 200 requests: smoke checks, slow reports, admin endpoints, a few experiments. Running all of it on every push makes the pipeline slow and noisy. Run the part that matters for that pipeline instead.

One folder

Terminal
requestarium run-collection "Users API" --folder "Smoke" --env Staging
requestarium run-collection "Users API" --folder "Orders/Refunds" --env Staging

Nested folders are named by path. Folder scripts and folder auth still apply, and so do the collection's scripts, so the folder runs exactly as it would inside the full run.

One request

Terminal
requestarium run "Users API/Auth/Login" --env Staging
requestarium run "Get user" --env Staging --var userId=42

A bare name works when it's unique in your workspace. When two collections have a "Get user", use the full path, or the id from requestarium collections.

One request is handy as a health check before a deploy step, or to debug a failing request from the CI machine itself.

A suite across collections

When the checks you want live in several collections, make a test suite in Tests: pick requests or folders from any collection, in the order you need. Then:

Terminal
requestarium run --suite "Release checks" --env Staging

The suite keeps the list in Requestarium, so adding a request to the release gate doesn't need a change to the pipeline file.

Lay out folders for CI

The --folder option works best when folders mean something to a pipeline:

FolderRunsTime
Smokeevery pushseconds
Regressionmerge to the main brancha few minutes
Slownightlyas long as it takes
Manualnever in CI

Put a request in one folder only. If a request is in both Smoke and Regression in spirit, keep it in Smoke and run Smoke in the regression job too:

Terminal
requestarium run-collection "Users API" --folder Smoke --env Staging
requestarium run-collection "Users API" --folder Regression --env Staging

Login requests

If the folder relies on a token that the full run gets from a Login request elsewhere in the collection, running the folder alone fails with a 401. Two fixes:

  • Move the login into the folder's (or the collection's) pre-request script, so every run gets its own token. See pre-request script examples.
  • Or set the token from CI with --env-var API_TOKEN when your pipeline already has one.

With the GitHub Action

YAML
      - uses: ./.github/actions/requestarium-run
        with:
          token: ${{ secrets.REQUESTARIUM_TOKEN }}
          collection: Users API
          folder: Smoke
          environment: Staging