Skip to main content

Crate allure_diesel

Crate allure_diesel 

Source
Expand description

Diesel integration that records executed queries as Allure steps.

This crate plugs into Diesel’s Instrumentation hook, so it is wired up once in test or setup code and never touches production query call sites:

use diesel::prelude::*;
use diesel::sqlite::SqliteConnection;

let mut conn = SqliteConnection::establish(":memory:")?;
conn.set_instrumentation(allure_diesel::AllureInstrumentation::new());
// From here on, every query executed on `conn` is recorded as an Allure step.

Alternatively, install_default registers the instrumentation for every newly established connection process-wide.

§What is captured

Each executed statement becomes a step named with its SQL, and (by default) carries the full SQL as a query.sql attachment. Transactions become transaction steps that nest their inner queries; a query that returns an error marks its step failed with the Diesel error.

§What is not captured

Diesel’s instrumentation exposes the SQL of each statement but not the returned rows — no non-invasive Diesel hook does. This crate therefore records queries and transactions, not result sets. The SQL text may contain sensitive bind values; keep that in mind before publishing reports.

Structs§

AllureInstrumentation
Diesel Instrumentation that records executed queries and transactions as Allure steps.
CaptureOptions
Controls what AllureInstrumentation records.

Functions§

install_default
Registers AllureInstrumentation as the default instrumentation for every newly established Diesel connection in this process.