Skip to main content

Strata-based pytest orchestration, suite manifests, and HTML reporting.

Project description

wn-rack

wn-rack is a packageable test runner built on top of pytest.

It adds a suite model around ordinary pytest tests:

  • ordered strata such as L0_foundation and L1_parsing
  • TOML manifests for suite and subtest metadata
  • durable JSON result artifacts
  • HTML reporting
  • declared source-to-test traceability through code_under_test
  • lightweight scaffolding for new strata and subtests

The distribution name is wn-rack. The CLI command is rack.

Install

pip install wn-rack

For local package development:

uv sync --all-extras
uv run rack --version
uv run rack --help
uv run rack run --all

What Rack Does

Rack does not replace pytest authoring. Tests stay as normal test_*.py files. Rack adds:

  • rack.toml for suite-wide configuration
  • STRATUM.toml for per-stratum manifests
  • subtest tracking at the test-file level
  • persisted results in rack_results/
  • suite status and inventory views
  • HTML reports that merge execution data and manifest metadata

Quick Start

Minimal suite layout:

my_suite/
  rack.toml
  L0_foundation/
    STRATUM.toml
    test_L0_001_smoke.py
    cases/
  L1_parsing/
    STRATUM.toml
    test_L1_001_parser.py
    cases/

Minimal rack.toml:

[rack]
name = "Example Suite"
version = "1.0"
description = "Example Rack suite"

[strata]
order = ["L0_foundation", "L1_parsing"]
default_enabled = ["L0_foundation", "L1_parsing"]

Minimal L0_foundation/STRATUM.toml:

name = "Foundation"
order = 0
description = "Low-level tests"
enabled = true
concerns = ["core"]
objectives = ["Verify the basic behavior works"]

[[subtests]]
file = "test_L0_001_smoke.py"
name = "Smoke"
description = "Basic smoke coverage"
test_case_type = "algorithmic"

[subtests.code_under_test]
module = "example_module"

[subtests.test_functions]
test_smoke = "Basic sanity check"

Minimal test file:

def test_smoke():
    assert True

Run the suite:

rack run
rack status
rack report

Suite Resolution

Rack resolves the active suite root in this order:

  1. RACK_TESTS_DIR
  2. WN_RACK_TESTS_DIR
  3. nearest parent of the current working directory containing rack.toml
  4. current working directory

This supports both package-first usage and legacy wrapper scripts.

Main Commands

  • rack list
  • rack run
  • rack status
  • rack report
  • rack refresh
  • rack inventory
  • rack new stratum
  • rack new subtest
  • rack version

Examples:

rack --version
rack version
rack run
rack run L0
rack run L5_001
rack run L5_001::test_name
rack list --concern svg.text
rack inventory --orphans

Result Artifacts

Rack writes output under <tests_dir>/rack_results/:

  • summary.json
  • source_hashes.json
  • report.html
  • subtests/*.json
  • strata/<stratum>.json
  • strata/<stratum>_pytest.json
  • output/*.json

Python API

Rack exports:

  • RackOutput
  • get_current_output()
  • set_current_output()
  • clear_current_output()

This is the structured-output side channel used by suites that want richer report data such as metrics, timings, comparisons, attachments, or SVG output.

See Python API.

Documentation

Development Standard

Rack now uses the Wavenumber Python baseline in legacy-adoption mode:

  • committed uv.lock
  • Rack self-hosted tests
  • Ruff and Pyright gates
  • HTML design docs and JSON contracts
  • date-based release version 2026.6.4
  • GitHub Release published workflow with PyPI trusted publishing
  • documented legacy exceptions for the current monolithic CLI module

Current Behavior Notes

These are current implementation realities:

  • --all is parsed but does not yet override enabled filtering
  • rack run currently accepts one positional target token
  • rack status can suggest multiple short names in one command string even though the parser takes one positional target
  • validate_code_under_test() checks code_under_test.module directly, while cmd_run() also supports modules for source-hash updates

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

wn_rack-2026.6.4.tar.gz (51.6 kB view details)

Uploaded Source

Built Distribution

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

wn_rack-2026.6.4-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

Details for the file wn_rack-2026.6.4.tar.gz.

File metadata

  • Download URL: wn_rack-2026.6.4.tar.gz
  • Upload date:
  • Size: 51.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wn_rack-2026.6.4.tar.gz
Algorithm Hash digest
SHA256 d80a0be49a27fdca5f4f41e8d5fa2543db987a99947a1a47b662498f1a218a47
MD5 8355897f89a33c6820b52f9517fdcee8
BLAKE2b-256 7d577b28b4de283c722c55f770f18eff01fc6f993036e54abe1e85615b6bf501

See more details on using hashes here.

Provenance

The following attestation bundles were made for wn_rack-2026.6.4.tar.gz:

Publisher: release.yml on wavenumber-eng/wn-rack

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

File details

Details for the file wn_rack-2026.6.4-py3-none-any.whl.

File metadata

  • Download URL: wn_rack-2026.6.4-py3-none-any.whl
  • Upload date:
  • Size: 37.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wn_rack-2026.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fa02e4e5d5c76f61cd12eed46915dced2acfe5f6615804a6f90e085714103788
MD5 d0111bc5f6f9627f100bd0e841f622b9
BLAKE2b-256 91669bb1c5bd25dd6fecbe792b3de83196c2a655955adbbd4e04cf895e38c91b

See more details on using hashes here.

Provenance

The following attestation bundles were made for wn_rack-2026.6.4-py3-none-any.whl:

Publisher: release.yml on wavenumber-eng/wn-rack

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