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.
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.
| Flag | Description |
|---|---|
--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. |
Examples
Section titled “Examples”Run an entire collection:
vegha run ./collections/orders-apiRun against a specific environment:
vegha run ./collections/orders-api --env stagingRun a single named request:
vegha run ./collections/orders-api --name "Create order"Produce a JUnit XML report and write it to a file:
vegha run ./collections/orders-api --reporter junit --out results/junit.xmlJUnit XML output and exit codes
Section titled “JUnit XML output and exit codes”With --reporter junit, Vegha emits a JUnit XML report that CI systems can parse and display as test results. The process exits with:
0when all requests and tests pass.- A non-zero code when any test fails, which fails the CI job.
GitHub Actions example
Section titled “GitHub Actions example”name: API testson: [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.xmlRelated
Section titled “Related”- Assertions and tests — define the checks that
vegha runevaluates.