Skip to content

Add Allure reporting for Diesel queries#21

Merged
baev merged 2 commits into
mainfrom
diesel
Jul 1, 2026
Merged

Add Allure reporting for Diesel queries#21
baev merged 2 commits into
mainfrom
diesel

Conversation

@baev

@baev baev commented Jul 1, 2026

Copy link
Copy Markdown
Member

Context

allure-diesel lets Diesel users capture database activity in Allure reports without changing individual query call sites. Add it as a dev dependency, then either attach instrumentation to a specific connection or install it globally for connections created by the code under test:

conn.set_instrumentation(allure_diesel::AllureInstrumentation::new());
allure_diesel::install_default()?;

The integration can also be tuned for different reporting needs. For example, users can disable transaction grouping, include connection events, omit full SQL attachments, or shorten long SQL step names:

let options = CaptureOptions::default()
    .without_transactions()
    .with_connection_events()
    .without_sql_attachment()
    .with_max_sql_preview(256);

let instrumentation = AllureInstrumentation::with_options(options);

In the report, each executed statement appears as an ordered step with the rendered SQL attached as query.sql. Transactions are grouped as nested transaction steps, so a successful flow looks like transaction (depth 1) containing BEGIN, insert into users ..., and COMMIT; failed queries, failed commits, and failed transaction starts are marked as failed steps with the Diesel error message.

Checklist

@baev baev added the pr:new feature Pull requests that add new user-facing functionality. label Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Allure Report Summary

Name Duration Stats New Flaky Retry Report
Allure Rust – Pull request #21 26m 44s Passed tests 222 0 0 0 View

@baev
baev merged commit 7413739 into main Jul 1, 2026
10 checks passed
@baev
baev deleted the diesel branch July 1, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:new feature Pull requests that add new user-facing functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant