Skip to main content

bud_runner

bud_runner is the command-line execution agent for Bud TMP. It runs trusted Python test suites, emits CI-friendly reports, uploads results to Bud, and can operate as a long-lived registered runner daemon.

Creator: Amine El Omari

bud_runner is designed for machines you manage, including dedicated lab hosts and self-hosted CI runners.

What it does

  • Runs test case lists from local automation or CI.
  • Produces JUnit XML, JSON, or text output.
  • Creates and updates Bud test runs.
  • Uploads test results and artifacts to Bud.
  • Runs work the backend has queued for a test station.
  • Registers persistent runner identities.
  • Runs a heartbeat and local control daemon.
  • Spools failed result uploads for later retry.

Compatibility

bud_runner Intended budtestlibrary pairing Notes
1.0.3 1.0.3 Backend-queued runs, --artifact uploads, optional addr on FlashEvent
1.0.2 1.0.2 Multipart artifact uploads and formatting fixes
1.0.1 1.0.1 Timeout fixes and PyPI release structure

Installation

python -m pip install bud-runner budtestlibrary

Requirements:

  • Python 3.9 or later;
  • budtestlibrary;
  • a Bud backend for registration, test-run creation, or result upload.

The package can execute tests and generate local reports without Bloom. Bloom is not a direct dependency of bud_runner.

Trusted-code execution model

bud_runner imports and executes Python test code from the selected local workspace. Only run test modules you trust. Test code can access files, the network, subprocesses, and any credentials available to the runner account.

Each discovered test class runs in a separate spawned operating-system process. Per-test and global suite timeouts limit hangs, but process isolation is not a security sandbox.

The daemon control socket binds to 127.0.0.1 by default. Do not expose it to an untrusted network. Non-loopback binding requires an external protection layer.

Quick start

Run tests locally

python -m bud_runner run-tests \
  --test-case-list <Module.ClassName> \
  --output report_junit.xml \
  --no-upload

Run and upload results

python -m bud_runner run-tests \
  --test-case-list <Module.ClassName> \
  --backend-url "https://<your-bud-instance-url>" \
  --username "ci-user@example.com" \
  --password "<bud-password>" \
  --upload

If an upload returns 401 Unauthorized and credentials were supplied, bud_runner logs in again through the Bud authentication API, refreshes the cached user token, and retries once.

Upload artifacts with the results

--artifact (-A) takes a file path or glob and is repeatable. Matching files are uploaded alongside the results, so logs, captures, and reports stay attached to the run:

python -m bud_runner run-tests \
  --test-case-list <Module.ClassName> \
  --artifact "logs/*.log" \
  --artifact capture.png \
  --upload

A file that fails to upload is reported but does not fail the run.

Run work queued by Bud

claim-run asks the backend for this station's next queued run and executes it through the same path as any other run. With --interval 0 (the default) it claims once and exits, which suits a cron entry or a one-shot CI job; a non-zero interval polls continuously:

python -m bud_runner claim-run \
  --backend-url "https://<your-bud-instance-url>" \
  --username "station-01@example.com" \
  --workspace ./tests \
  --interval 30 \
  --artifact "logs/*.log"

--workspace points at the directory holding this station's test modules and defaults to the current directory. --test-timeout and --suite-timeout cap a single test and the full suite, at 300 and 1800 seconds respectively.

Create a Bud test run

python -m bud_runner add-test-run \
  --test-case-list <Module.ClassName> \
  --test-suite-name "Nightly Automated Tests" \
  --url-test-software https://github.com/org/tests.git \
  --ref-test-software main \
  --sw-under-test https://github.com/org/product.git \
  --ref-sw-under-test release-2026.07

Register a runner

export RUNNER_API_KEY="<registration-secret>"
export BUD_BACKEND_URL="https://<your-bud-instance-url>"

python -m bud_runner register \
  --username "lab-station-01" \
  --socket-port 53035

Runner identity, tokens, and daemon state are stored under ~/.bud/. Keep that directory private to the runner account and never commit it.

Start the daemon

python -m bud_runner daemon \
  --username "lab-station-01" \
  --location "Hardware Lab" \
  --bind-host 127.0.0.1

Run the daemon under a service manager such as systemd, launchd, or a Windows service wrapper.

Configuration

Environment variables:

export BUD_BACKEND_URL="https://<your-bud-instance-url>"
export BUD_TOKEN="<user-token>"
export BUD_RUNNER_ACCOUNT="lab-station-01"
export BUD_RUNNER_TOKEN="<runner-token>"
export RUNNER_API_KEY="<registration-secret>"

Project-level, non-secret context can be stored in app.properties:

budBackend=https://<your-bud-instance-url>
budRunnerAccount=lab-station-01

Do not put passwords, user tokens, runner tokens, or registration secrets in app.properties.

Main commands

Command Purpose
run-tests Execute tests, generate reports, and optionally upload results
claim-run Run work the backend has queued for this test station
list-tests Resolve and list discovered tests without executing them
add-test-run Create a Bud test run
register Register or re-register a runner identity
daemon Run heartbeat and local control services
status Show local configuration, versions, and Bud health
version Print the installed package version

Run python -m bud_runner <command> --help for complete options.

CI example

name: Run tests

on:
  push:
    branches: [main]

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 bud-runner budtestlibrary
      - name: Execute tests
        env:
          BUD_BACKEND_URL: ${{ secrets.BUD_BACKEND_URL }}
          BUD_TOKEN: ${{ secrets.BUD_TOKEN }}
        run: |
          python -m bud_runner run-tests \
            --test-case-list <Module.ClassName> \
            --ref-test-software ${{ github.sha }} \
            --output report_junit.xml
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: test-results
          path: report_junit.xml

Licence

bud_runner is permanent free and open-source software licensed under the GNU Affero General Public License v3.0 only (AGPL-3.0-only).

No paid EmbedLabs licence is required to use bud_runner, including for commercial use, provided the AGPL terms are followed. Accepted community contributions remain publicly available under AGPL-3.0-only and will not become proprietary-only.

Bud and Bloom are separate source-available applications. Commercial licensing, deployment, integration, and support offered through sales@embedlabs.de applies to those applications and services—not to the bud_runner package licence.

Technical, security, and contribution questions: dev@embedlabs.net.

Copyright (C) 2026 Mohamed Amine El Omari Alaoui, operating under the name EmbedLabs.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bud_runner-1.0.3.tar.gz (44.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bud_runner-1.0.3-py3-none-any.whl (44.1 kB view details)

Uploaded Python 3

File details

Details for the file bud_runner-1.0.3.tar.gz.

File metadata

  • Download URL: bud_runner-1.0.3.tar.gz
  • Upload date:
  • Size: 44.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bud_runner-1.0.3.tar.gz
Algorithm Hash digest
SHA256 ade1cd251a74bb9f5722371408abfbc9bec81632d838299ba2587d22f1f842c6
MD5 274bd0544fefae06e87727845333667f
BLAKE2b-256 ea98df6243af91076e7e88a9b66f2383143a9c57432ca86fd8cfc926c1fb00e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for bud_runner-1.0.3.tar.gz:

Publisher: ci-cd.yml on MbedLabs/bud-runner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bud_runner-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: bud_runner-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 44.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bud_runner-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a47a9c01694123ca4b25aeb185171547b1148a6f0ca2a62e0744261781409256
MD5 2a0484d6d2c4b7348e9d171b171cf1ba
BLAKE2b-256 0d877e2bc48228c50a8b2f10e57d3558b6989ef1588188adcaebd09c11359a87

See more details on using hashes here.

Provenance

The following attestation bundles were made for bud_runner-1.0.3-py3-none-any.whl:

Publisher: ci-cd.yml on MbedLabs/bud-runner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page