CI
Run bud-runner in a self-hosted CI pipeline, check Bloom metadata, and publish the JUnit report.
The intended model is self-hosted CI, where you control the runner host, the installed test code, and local machine secrets. bud_runner imports and executes your test code, so only run trusted test code on a host you manage. See Trusted-code execution.
Install both packages, run your suite, and publish the JUnit report. Here on GitHub Actions:
jobs: test: runs-on: self-hosted steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: "3.12" - run: python -m pip install budtestlibrary bud-runner - name: Check Bloom metadata run: budtestlibrary check tests/ - name: Run tests env: BUD_BACKEND_URL: ${{ secrets.BUD_BACKEND_URL }} BUD_TOKEN: ${{ secrets.BUD_TOKEN }} run: | python -m bud_runner run-tests \ --test-case-list tests.smoke.SMOKE_TEST_LIST \ --url-test-software https://github.com/my-org/tests \ --ref-test-software ${{ github.sha }} \ --output report_junit.xml - uses: mikepenz/action-junit-report@v4 if: always() with: { report_paths: report_junit.xml }What each step does
Section titled “What each step does”- Check Bloom metadata.
budtestlibrary checkimports the test modules and exits non-zero on duplicate test case IDs, so the job stops before any result is uploaded. Add--strictto also fail on missing metadata. See Check Bloom metadata. - Run tests.
run-testswrites the JUnit report and uploads the results to Bud, since uploads are enabled by default. If the upload fails, it exits non-zero and spools the payload under~/.bud/spool/results/for replay on the next successful run. - Publish the report. The JUnit step runs
if: always(), so the report is published even when tests fail.
Secrets
Section titled “Secrets”Keep the Bud URL and token in the CI system’s secrets, as above. Never commit budRunnerToken, runnerApiKey, budToken, or passwords. app.properties is for project metadata only. See Identity and secrets.
Timeouts and errors
Section titled “Timeouts and errors”run-tests bounds each test with --test-timeout (default 300 seconds) and the full suite with --suite-timeout (default 1800 seconds). Choose --continue-on-error or --stop-on-error for how the run treats an error. See the Command reference.
Artifacts
Section titled “Artifacts”Attach logs and other files to the run with --artifact, which takes a path or a glob and is repeatable, or let the tests write into bud-artifacts, which is uploaded when it exists. See Uploading artifacts.
Claiming queued runs from CI
Section titled “Claiming queued runs from CI”A CI job can also execute work scheduled in Bud. claim-run --interval 0 claims once and exits: the form to use from cron or a CI job.
python -m bud_runner claim-run --interval 0See Backend-queued runs.



