Skip to content
Vegha Docs

vegha run

vegha run executes a collection or a folder of requests and reports the results. It is the verb you use both for quick local runs and for automated test runs in CI.

Terminal window
vegha run <collection-or-folder>

The argument is a path to a collection or a folder of requests in your workspace. Every request in the target is executed, along with any assertions and tests attached to it.

FlagDescription
--env <name>Select the environment to run against.
--name "<request name>"Run only the single request with the given name.
--reporter <fmt>Choose the output format, such as junit for JUnit XML or a JSON reporter.
--out <path>Write the generated report to a file.

Run an entire collection:

Terminal window
vegha run ./collections/orders-api

Run against a specific environment:

Terminal window
vegha run ./collections/orders-api --env staging

Run a single named request:

Terminal window
vegha run ./collections/orders-api --name "Create order"

Produce a JUnit XML report and write it to a file:

Terminal window
vegha run ./collections/orders-api --reporter junit --out results/junit.xml

With --reporter junit, Vegha emits a JUnit XML report that CI systems can parse and display as test results. The process exits with:

  • 0 when all requests and tests pass.
  • A non-zero code when any test fails, which fails the CI job.
name: API tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Vegha collection
run: vegha run ./collections/orders-api --env ci --reporter junit --out results/junit.xml
- name: Publish results
if: always()
uses: actions/upload-artifact@v4
with:
name: junit
path: results/junit.xml