Skip to main content

Dependency-graph based test runner in Rust that supports Rust, Python, and JavaScript.

Project description

Headlamp

Headlamp is a Rust-powered test UX CLI: smarter test selection, cleaner output, and a unified workflow across jest, Rust tests (headlamp runner), cargo test, cargo nextest, and pytest.

Headlamp is useful when you want a consistent way to run tests across different projects and keep feedback fast as your repo grows. It can select tests based on what changed, surface failures in a readable format, and keep common defaults (like runner args and coverage settings) in a single config file so your team doesn’t have to remember a long list of flags.

Why Headlamp

  • One CLI, many runners: --runner=headlamp|jest|cargo-nextest|cargo-test|pytest
  • Selection that scales: run what changed (--changed) and what’s related (dependency-graph driven)
  • Coverage-first UX: coverage output you can actually read
  • Fast: Rust core + caching

Installation

npm (Node.js projects)

Requirements:

  • Node >= 18

Install:

npm i -D headlamp

Run:

npx headlamp --help

Cargo (Rust projects)

Install from crates.io:

cargo install headlamp

Python (pytest projects)

Install:

pip install headlamp
headlamp --runner=pytest

Peer dependencies (system requirements)

Headlamp is a wrapper around your project’s runners. It does not vendor the runners themselves, so you need the runner executables available in your environment for the features you’re using.

Common (all runners)

  • Git: required for --changed=... modes (e.g. --changed=branch).

Jest runner (--runner=jest)

  • Node.js: required.
  • Jest installed in the repo: Headlamp expects Jest to be runnable from your project (typically ./node_modules/.bin/jest).
  • Coverage (--coverage): requires Jest coverage support (standard Jest --coverage + reporters). Headlamp formats/prints coverage from generated reports.

Pytest runner (--runner=pytest)

  • Python 3: required.
  • pytest: must be on PATH (pytest / pytest.exe).
  • Coverage (--coverage): requires pytest-cov (Headlamp enables coverage and passes --cov flags; branch coverage uses --cov-branch).

Headlamp (native Rust runner) (--runner=headlamp)

  • Rust toolchain: cargo + rustc.
  • Per-test timings: requires a preinstalled nightly toolchain (Headlamp enables libtest JSON + --report-time only when nightly is available).
    • Install via: rustup toolchain install nightly

Cargo test runner (--runner=cargo-test)

  • Rust toolchain: cargo + rustc.
  • Coverage (--coverage): collected via LLVM tools from rustup (no cargo-llvm-cov dependency).
    • Install via: rustup component add llvm-tools-preview

Cargo nextest runner (--runner=cargo-nextest)

  • Rust toolchain: cargo + rustc.
  • nextest: requires cargo-nextest (cargo install cargo-nextest).
  • Coverage (--coverage): collected via LLVM tools from rustup (no cargo-llvm-cov dependency).
    • Install via: rustup component add llvm-tools-preview

Quickstart

Jest

npx headlamp --runner=jest

Forward runner args after -- (unknown args are forwarded):

npx headlamp --runner=jest -- --runInBand

Cargo nextest / cargo test

headlamp --runner=cargo-nextest
headlamp --runner=cargo-test

Requirements:

  • --runner=cargo-nextest: requires cargo-nextest to be installed.
    • Install via: cargo install cargo-nextest (or your preferred installer)

CLI

Run headlamp --help to see the up-to-date flags list.

Highlights:

  • runners: --runner=headlamp|jest|pytest|cargo-nextest|cargo-test
  • changed selection: --changed=all|staged|unstaged|branch|lastCommit|lastRelease
    • lastRelease selects changes since the previous stable SemVer release tag
  • coverage: --coverage plus --coverage-ui, --coverage-detail, thresholds, etc.
  • artifacts (default: none): --keep-artifacts to keep runner artifacts on disk

Legacy aliases (still accepted, but not recommended):

  • --keepArtifacts
  • --coverage.detail

Configuration

Headlamp discovers config from your repo root. Supported file names:

  • headlamp.toml (highest precedence)
  • headlamp.config.ts
  • headlamp.config.js
  • headlamp.config.mjs
  • headlamp.config.cjs
  • headlamp.config.json
  • headlamp.config.json5
  • headlamp.config.jsonc
  • headlamp.config.yaml
  • headlamp.config.yml
  • .headlamprc plus .headlamprc.* variants (.json, .json5, .jsonc, .yaml, .yml, .js, .cjs, .mjs, .ts)

Headlamp also supports embedded TOML config (lower precedence than explicit config files):

  • pyproject.toml under [tool.headlamp]
  • Cargo.toml under [package.metadata.headlamp]

Example: headlamp.toml (recommended for Rust + Python)

# Run tests sequentially (useful for very heavy integration tests)
sequential = true

[coverage]
abort_on_failure = true
mode = "auto"
page_fit = true
keep_artifacts = false

[changed]
depth = 20

Example: headlamp.config.ts

Rules:

  • Must have a default export
  • Only relative imports are supported inside the config file (./ and ../)
export default {
  // Runner defaults
  jestArgs: ["--runInBand"],

  // Run once before tests (npm script name or a shell command)
  bootstrapCommand: "test:jest:bootstrap",

  // Global toggles
  ci: false,
  verbose: false,
  noCache: false,
  keepArtifacts: false,

  // Coverage defaults
  coverage: true,
  coverageUi: "both",
  coverage: {
    abortOnFailure: true,
    mode: "auto",
    pageFit: true,
  },

  // Changed selection defaults
  changed: { depth: 2 },
};

Artifacts (coverage, caches, temp files)

By default, headlamp runs artifact-free: it uses an ephemeral per-run workspace and does not leave files behind in your repo (e.g. coverage/, .coverage, .pytest_cache, target/) or OS temp.

If you need artifacts on disk (for example, to upload coverage reports in CI), opt out:

  • CLI: --keep-artifacts
  • Config: keepArtifacts: true

Contributing

Pull requests are welcome. For large changes, open an issue first to align on direction.

Support

  • Bug reports and feature requests: GitHub Issues

License

MIT — see LICENSE.

Project details


Download files

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

Source Distribution

headlamp-0.1.60.tar.gz (6.5 kB view details)

Uploaded Source

Built Distributions

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

headlamp-0.1.60-py3-none-win_amd64.whl (2.5 MB view details)

Uploaded Python 3Windows x86-64

headlamp-0.1.60-py3-none-musllinux_1_2_x86_64.whl (2.8 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

headlamp-0.1.60-py3-none-musllinux_1_2_aarch64.whl (2.5 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

headlamp-0.1.60-py3-none-manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

headlamp-0.1.60-py3-none-manylinux_2_28_aarch64.whl (2.5 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

headlamp-0.1.60-py3-none-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

headlamp-0.1.60-py3-none-macosx_10_12_x86_64.whl (2.6 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file headlamp-0.1.60.tar.gz.

File metadata

  • Download URL: headlamp-0.1.60.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for headlamp-0.1.60.tar.gz
Algorithm Hash digest
SHA256 45114ad97f59800c8a14c14c74d8929905c1aba958591717af75a3e77d01bf32
MD5 b3964b8d734089ae3f6d35905d0b19eb
BLAKE2b-256 7d4224a6c35aa814c6a24eb6e843cd14ada61ff7238ac747ad692aac9b3b5b89

See more details on using hashes here.

Provenance

The following attestation bundles were made for headlamp-0.1.60.tar.gz:

Publisher: release.yml on dbpiper/headlamp

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

File details

Details for the file headlamp-0.1.60-py3-none-win_amd64.whl.

File metadata

  • Download URL: headlamp-0.1.60-py3-none-win_amd64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for headlamp-0.1.60-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9d9ef0b3cb9965b184ac51ce2b806bee5b19edab5ae4c37326704c8b4cdb99b6
MD5 87147325ba6e51ee817580a22d5ca7b7
BLAKE2b-256 79526d734acf849bfcb3270da86c0af6d66abf05706d3d27f17f54777c6eb0ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for headlamp-0.1.60-py3-none-win_amd64.whl:

Publisher: release.yml on dbpiper/headlamp

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

File details

Details for the file headlamp-0.1.60-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for headlamp-0.1.60-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3fda70843931bf8a61ad51ad4452b9d714b37f5c50d760e1994bab500b3e7a37
MD5 867a56241e6590e47aabb82d06960d91
BLAKE2b-256 f15a5ffa70205eb9f9dcad42e09adc2c4b7f2fcf5645a468dd18deca2b90f4ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for headlamp-0.1.60-py3-none-musllinux_1_2_x86_64.whl:

Publisher: release.yml on dbpiper/headlamp

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

File details

Details for the file headlamp-0.1.60-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for headlamp-0.1.60-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 f219e117127dfaac47c71f38396bb4c9b18eddac3c03eeeafd133e5ad4b5d537
MD5 0ee7f96a6efa3dfcab4ff7c37f289171
BLAKE2b-256 eb414f78557f722a6af130c243679c98166a51a4f04b15267d61be050e063450

See more details on using hashes here.

Provenance

The following attestation bundles were made for headlamp-0.1.60-py3-none-musllinux_1_2_aarch64.whl:

Publisher: release.yml on dbpiper/headlamp

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

File details

Details for the file headlamp-0.1.60-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for headlamp-0.1.60-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5875d60948354bc533b32a71471abbd3114f150ff5fd8e86dc9df8773616ef43
MD5 0c3228b4feb49add56932c4120856744
BLAKE2b-256 e2dcdf7f3833b0a06abba7469b2e3c4b5ce595a46de93700ecf336f2e0b81c2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for headlamp-0.1.60-py3-none-manylinux_2_28_x86_64.whl:

Publisher: release.yml on dbpiper/headlamp

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

File details

Details for the file headlamp-0.1.60-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for headlamp-0.1.60-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c156ef62790ce470a646031b0e28255f52fcd7de776e183a118cad3b25f28113
MD5 d63a90bb211bb539efbb8b34e0fcd01a
BLAKE2b-256 f9539a9e649e861eae649c615cc0a226a2ba270fdd997f4b536df6832273c62c

See more details on using hashes here.

Provenance

The following attestation bundles were made for headlamp-0.1.60-py3-none-manylinux_2_28_aarch64.whl:

Publisher: release.yml on dbpiper/headlamp

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

File details

Details for the file headlamp-0.1.60-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for headlamp-0.1.60-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4b2968a2664765f51152bc8c7d51e5f81c0da86ea9cffde3025ebfbece1bd1d5
MD5 af84dd7cf573224691abba9dafcf79ad
BLAKE2b-256 806f375df6af5fb8b7da494343446f33053a0f75e5517d8699d5fa534bdf8f1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for headlamp-0.1.60-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on dbpiper/headlamp

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

File details

Details for the file headlamp-0.1.60-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for headlamp-0.1.60-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 921d344afb68bb392f19d51c8c4071657aca5727a65ce8c41611ae2020f8e749
MD5 1cef8e84a077ffa0a89da3a7861b3c26
BLAKE2b-256 269609e9b2fcfed83cd37e783dca2aea09e21c49d8da521db7c00ae6e97a5ee8

See more details on using hashes here.

Provenance

The following attestation bundles were made for headlamp-0.1.60-py3-none-macosx_10_12_x86_64.whl:

Publisher: release.yml on dbpiper/headlamp

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 Pingdom Monitoring Sentry Error logging StatusPage Status page