Skip to main content

Run behave tests in parallel

Project description

Latest PyPI version

A Python CLI tool for running Gherkin/Behave BDD tests in parallel with comprehensive result aggregation and reporting.

Anubis orchestrates parallel execution of Behave test suites, distributing scenarios across multiple worker processes for faster feedback. It handles test parsing, distribution, aggregation, and generates results in multiple formats (JSON, JUnit XML, console output).

Features

  • Parallel Test Execution: Distribute tests across N worker processes for faster execution

  • Flexible Granularity: Run tests at feature, scenario, or example (scenario outline rows) level

  • Smart Tag Filtering: Leverage Behave’s full tag expression syntax for test selection

  • Result Aggregation: Automatically merge results from all workers into unified reports

  • Multiple Output Formats: JSON, JUnit XML, and formatted console output

  • Dry-run Mode: Parse and validate tests without execution

  • Configurable Pass Thresholds: Set minimum pass rates for CI/CD integration

  • Full Behave Compatibility: Pass any Behave argument through to the runner

Installation

From PyPI:

pip install bpp-anubis

From source:

git clone <repository>
cd anubis
pip install -e .

For development (includes build and documentation tools):

pip install -r requirements-dev.txt

Quick Start

Run all tests in the features directory (default):

anubis

Run tests from a specific path with 4 parallel workers:

anubis --features tests/features --processes 4

Run only tests tagged with @automated, excluding @flaky:

anubis --features tests/features --tags @automated --tags ~@flaky

Dry-run to validate feature files:

anubis --features tests/features --dry-run

Run scenarios with custom Behave definitions:

anubis --features tests/features -D env=staging -D browser=chrome

For detailed usage and all available options, see README.md.

Requirements

Runtime:

  • Python 3.10+

  • behave >= 1.2.6 (dynamically supports all compatible versions)

Development:

See requirements-dev.txt for build, packaging, and documentation tools.

Usage

Anubis is designed to be intuitive for users familiar with Behave. Core concepts:

Granularity (--unit):
  • feature: Each feature file is one test unit

  • scenario: Each scenario (including outlines) is one test unit

  • example: Each row in a scenario outline is a separate test (default, most parallelizable)

Tags (--tags):

Standard Behave tag filtering with support for complex expressions: --tags @automated --tags ~@flaky runs automated tests excluding flaky ones

Processes (--processes):

Number of parallel workers. Default is 1 (sequential). Increase for faster execution on multi-core systems.

User Definitions (-D):

Pass variables to Behave step implementations. Format: -D key=value

Exit Codes

  • 0: Tests passed (pass rate >= threshold) or no tests found with --pass-with-no-tests

  • 1: Tests failed or pass rate below threshold

Output

By default, results are written to the .output directory:

  • results.json - Aggregated test results in JSON format

  • results.xml - JUnit XML format for CI/CD integration

  • logs/anubis.log - Execution log with detailed information

  • json_results/ - Individual worker results (temporary)

Configuration

All behavior is controlled via command-line arguments. See README.md for comprehensive documentation of all options.

Examples

Run tests with verbose logging and custom output directory:

anubis --features tests/features --output ./results --log-std-out

Run tests at scenario level with 80% pass threshold:

anubis --features tests/features --unit scenario --pass-threshold 0.8 --processes 8

Run regression tests, excluding known flaky and slow tests:

anubis --features tests/features --tags @regression --tags ~@flaky --tags ~@slow

Run with cleanup (delete output directory after completion):

anubis --features tests/features --delete-output --processes 4

Contributing

Contributions are welcome. Please ensure code follows project conventions and includes appropriate documentation.

Architecture

See agents.md for detailed architecture documentation, including: - Component descriptions and relationships - Execution flow and data pipelines - Design patterns and extension points - Known limitations

License

MIT

Authors

anubis was written by matthew bahloul.

Support

For issues, questions, or suggestions, please contact the development team or file an issue in the repository.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

bpp_anubis-2026.3.30.3.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

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

bpp_anubis-2026.3.30.3-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file bpp_anubis-2026.3.30.3.tar.gz.

File metadata

  • Download URL: bpp_anubis-2026.3.30.3.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for bpp_anubis-2026.3.30.3.tar.gz
Algorithm Hash digest
SHA256 f4dfc06eed4cc82c9460cf386e120083c1c502f5700c4e51979cc8f17a195c9b
MD5 5d5a1f1296df69d3f52cbdeb255cfa5c
BLAKE2b-256 b427abbc5025d674fa21dd6d073b18b22f29bf1b50366c5211e39b28cb0e0d4d

See more details on using hashes here.

File details

Details for the file bpp_anubis-2026.3.30.3-py3-none-any.whl.

File metadata

File hashes

Hashes for bpp_anubis-2026.3.30.3-py3-none-any.whl
Algorithm Hash digest
SHA256 404a4a425fdee05374d14dc803f5500d3e48c1a55ffad4d63bddfe65cd88f618
MD5 d191490d865260893f5020139c2de782
BLAKE2b-256 ae6d75a1ce16198af434d773caab1129c9867d544d091466aa717ffd86bb951b

See more details on using hashes here.

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