Example of Allure Report usage with
cargo testand Rust.
- Learn more about Allure Report at https://allurereport.org
- Documentation - discover official documentation for Allure Report
- Questions and Support - get help from the team and community
- Official announcements - stay up to date with the latest updates
- General Discussion - share ideas with the community
This example shows the minimal configuration required to use allure-cargotest
with cargo test.
The project keeps the setup intentionally small:
- one Rust package
- one Allure dev-dependency
- one test annotated with
#[allure_test] - one helper function annotated with
#[step]
Add the Allure integration as a test dependency:
[dev-dependencies]
allure-cargotest = "1.0.2"allure-cargotest writes results to target/allure-results by default.
To use a custom results directory instead:
ALLURE_RESULTS_DIR=./allure-results cargo testExecute the tests:
cargo testGenerate and open the report with Allure:
allure generate ./target/allure-results --output ./target/allure-report --clean
allure open ./target/allure-reportIf you use a custom ALLURE_RESULTS_DIR, replace ./target/allure-results
with that path in the report commands.