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, 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=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).

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

  • Rust toolchain: cargo + rustc.
  • Coverage (--coverage): requires cargo-llvm-cov to generate Rust lcov.info (cargo install cargo-llvm-cov; you may also need rustup component add llvm-tools-preview depending on your toolchain).

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

  • Rust toolchain: cargo + rustc.
  • nextest: requires cargo-nextest (cargo install cargo-nextest).
  • Coverage (--coverage): requires cargo-llvm-cov (same as cargo-test coverage above).

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

CLI

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

Highlights:

  • runners: --runner=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.59.tar.gz (6.3 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.59-py3-none-win_amd64.whl (2.5 MB view details)

Uploaded Python 3Windows x86-64

headlamp-0.1.59-py3-none-musllinux_1_2_x86_64.whl (2.7 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

headlamp-0.1.59-py3-none-musllinux_1_2_aarch64.whl (2.4 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

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

Uploaded Python 3manylinux: glibc 2.28+ x86-64

headlamp-0.1.59-py3-none-manylinux_2_28_aarch64.whl (2.4 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

headlamp-0.1.59-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.59.tar.gz.

File metadata

  • Download URL: headlamp-0.1.59.tar.gz
  • Upload date:
  • Size: 6.3 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.59.tar.gz
Algorithm Hash digest
SHA256 8e05fa13eb553b4ff1a0d3104a61249959b24c0e2a3d67d127fc17f4b36e093b
MD5 688642308c834624565be7300d240c40
BLAKE2b-256 cef826bc50ba1159c86b54a35425eaf2163ef91ae6db3a8e778aea55499f5817

See more details on using hashes here.

Provenance

The following attestation bundles were made for headlamp-0.1.59.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.59-py3-none-win_amd64.whl.

File metadata

  • Download URL: headlamp-0.1.59-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.59-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9d13c69e5889b652738db5c8843f1cd4d112a607772e796e88bc50bead8b01ff
MD5 2658fc9798ad63302ab870c16aa193a5
BLAKE2b-256 5e906279606ad46fff6edcb667432fac56558c0b5a2e902a88837345af21f937

See more details on using hashes here.

Provenance

The following attestation bundles were made for headlamp-0.1.59-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.59-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for headlamp-0.1.59-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 cffac8de50fd0d87d51cc8a61def2894a4fa09d347c05e054a51da6f3eb8ee1e
MD5 38c92e906dd46b9e71fdc6786171c02d
BLAKE2b-256 ea08c7cf499ab86393d83fc777931fd27445e3043189ee71bcc23af667033292

See more details on using hashes here.

Provenance

The following attestation bundles were made for headlamp-0.1.59-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.59-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for headlamp-0.1.59-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 d8a484ae603ad7f7cb18782914ab6cb4c68fcc1b1c3146a2cf700866897171b0
MD5 74267e572fd63d41941bb5825dcc0107
BLAKE2b-256 4d80b16421e12e279a326d704c2c24e32650c08236b0ae96023d8fe579da7e7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for headlamp-0.1.59-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.59-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for headlamp-0.1.59-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 25f9de700e802b21eea1846e5cda49e821f593219da17a6e4fd9ab3a596f41f2
MD5 159bafb97292798289348fee33927c97
BLAKE2b-256 ed24074e3c34bd9587b5f63835675bb89930160ab22d86f8ae1dff60e1c04b57

See more details on using hashes here.

Provenance

The following attestation bundles were made for headlamp-0.1.59-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.59-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for headlamp-0.1.59-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6f6ac22a3a209e76d2c1dda63cfc9437d12a35c41e1086c3fafbcaaf3b41230e
MD5 e126c322729547366a1dff95a97887f1
BLAKE2b-256 fd07995477aca246806d0304f745cca9ab3b48b09f8c5ed524ac8b460bfdb87d

See more details on using hashes here.

Provenance

The following attestation bundles were made for headlamp-0.1.59-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.59-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for headlamp-0.1.59-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0a91bc21b80567379dbee7b001896b9d8f120739c0280beb3e87597ee360a9bf
MD5 d7e45ada3262a6dde80f4820aa285da9
BLAKE2b-256 4f6e004dbc32495013a29f9db71135e64d790a0ccc0229ffd8ac4a3ffe940f7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for headlamp-0.1.59-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.59-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for headlamp-0.1.59-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c94847dee14033698ee4f5813dfec09f7ab8e88fb973e09da7219a9582458b82
MD5 8d5c937213a78e64e247ba300fd13d49
BLAKE2b-256 fb7783b334fdf3f10320be059c16caea9d28c1afb6fea4f43b39253a6b8603d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for headlamp-0.1.59-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