An Allure reporter plugin for tanu that emits Allure-compatible JSON for every executed test. The reporter implements tanu_core::Reporter and stores results in a directory you control, ready to be rendered with the Allure CLI.
Add the crate to your workspace alongside tanu:
[dependencies]
tanu-allure = "0.4"- Build your test runner with
tanu. - Install the reporter on your app before running the suite.
- Point the reporter to the directory where you want Allure JSON artifacts written.
#[tanu::main]
#[tokio::main]
async fn main() -> tanu::eyre::Result<()> {
let runner = run();
let mut app = tanu::App::new();
app.install_reporter(
"allure",
tanu_allure::AllureReporter::with_results_dir("allure-results"),
);
app.run(runner).await
}Once the plugin is installed, select it when invoking your suite (for example cargo run test --reporters allure,list) so tanu includes the Allure reporter alongside any other reporters you use.
AllureReporter::new() uses allure-results/ in the current working directory; with_results_dir lets you target another location (for example, inside your CI artifacts directory). Each completed test produces a *-result.json file containing the full execution trace, including checks and HTTP calls captured by tanu.
-
Run your
tanusuite so the reporter can populateallure-results/. -
Install the Allure CLI:
- Follow the official installation instructions: https://allurereport.org/docs/install/
- Or build it in a container using the provided example/Dockerfile.
-
Turn the JSON into HTML assets:
allure generate allure-results --clean -o allure-report
Use
allure serve allure-resultsfor an ad-hoc preview that spins up a temporary web server.
A ready-to-use GitHub Actions workflow lives at .github/workflows/publish-report.yml. It builds the example project, generates allure-report/, and publishes the site to GitHub Pages. The live report produced by that workflow is available at https://tanu-rs.github.io/tanu-allure/.
Adapt the workflow to your repository by replacing the example build/run steps with the commands your project requires.
This repository ships a runnable example that fetches https://httpbin.org/get and records the steps:
cargo run --manifest-path example/Cargo.toml test --reporters allure,listRunning it regenerates allure-results/ with fresh output. Open the directory with the Allure CLI to inspect the resulting test case.
