About
choreo is an executable Domain-Specific Language (DSL) for writing automated, behaviour-driven tests for command-line
applications and system interactions. It uses a structured, human-readable format inspired by Gherkin to define test
scenarios that are easy to write, read, and maintain.
The goal of choreo is to provide the power and expressiveness of a BDD framework like Cucumber, but in a self-contained, executable format specifically designed for testing the shell.
Key Features
- Human-Readable BDD Syntax: Uses a
given-when-thenstructure withintestblocks to create clear, self-documenting tests. - Executable Scripts:
.chorfiles are complete, runnable tests. No separate "step definition" or "glue code" files are required. - Stateful Scenarios: Capture variables from command output and reuse them in subsequent steps to test complex workflows.
- Multi-Actor System: Interact with and assert against multiple parts of your system in a single test.
- Terminal: Control an interactive pseudo-terminal, check
stdout,stderr, and command exit codes. - FileSystem: Create, delete, and verify files and directories as part of your test setup and assertions.
- Terminal: Control an interactive pseudo-terminal, check
- Configurable Test Runner: Control test behavior with a settings block for features like timeouts and custom shell paths.
- CI-Friendly Reporting: Generates standard JSON reports for easy integration with CI/CD pipelines.
Example Usage
See web_health_check.chor for the above example in text format. There are many more examples in the examples directory.
Full Documentation
For a complete guide to all keywords, actions, conditions, and features, please see the official Choreo DSL Reference.
Getting Started
Prerequisites
You need Rust and Cargo installed.
Installing from crates.io
The easiest way to install choreo is to download it from crates.io. You can do it
using the following command:
If you want to update choreo to the latest version, execute the following command:
Building from source
Alternatively you can build medi from source using Cargo:
# The binary will be located at target/release/choreo
# Optionally, you can add it to your PATH
# Or, install it system-wide
Command-Line Usage
Create a new test file
Use the init command to generate a new example .chor file. This is a great starting point for a new test suite.
# Create a new test file with default name "test.chor"
# Create a new test file
Validate a test file
Use the validate command to check the syntax and structure of a .chor file without executing it.
# Validate the default test.chor file
# Validate a specific file
Lint a test file
Use the lint command to both check syntax and semantics of a .chor file without executing it.
# Validate and run linting on the default test.chor file
# Lint a specific file
Run a script
Use the run command to execute a .chor file. Use the --verbose flag for detailed debug output.
# Run a test script
# Run with verbose logging
Parse a JSON report
Use the helper script to summarize a report or show failing steps. Requires only Python 3 (no external dependencies).
# Parse the latest report in ./reports
# Parse a specific report
# Output as structured JSON (for CI pipelines)
Status & Roadmap
choreo is currently in the beta stage. The core engine is functional, but more to add before production-ready.
The journey ahead includes:
- A dedicated editor with syntax highlighting and linting.
Contributing
Contributions are welcome! Please feel free to open an issue or submit a pull request.