grow-graylog 0.2.0

Rust SDK for Graylog Open by Grow Codes
Documentation
// Generated by sdk-kit 0.3.0 — do not edit; change sdk-kit and run "sdk-kit sync"
//! Test support (feature `testing`): in-memory fakes and the conformance runner (SPEC §6).
//!
//! ```no_run
//! # async fn demo() -> grow_graylog::Result<()> {
//! use grow_graylog::testing::{ConformanceRunner, CoreHandler};
//! use grow_graylog::GraylogClient;
//!
//! let report = ConformanceRunner::new("../conformance/scenarios")
//!     .capabilities(["version"])
//!     .handler(CoreHandler::new(GraylogClient::from_env))
//!     .run()
//!     .await?;
//! report.assert_success();
//! # Ok(())
//! # }
//! ```

mod core_ops;
mod expect;
pub mod runner;
pub mod service;

pub use core_ops::{CoreHandler, CoreTarget};
pub use expect::{check_expectation, json_matches};
pub use runner::{
    load_scenarios, run_id, CategoryHandler, ConformanceReport, ConformanceRunner, Scenario,
    ScenarioResult, ScenarioSession, ScenarioStatus, Step, StepOutput, Vars,
};
/// Service-owned additions (`src/testing/service.rs`).
#[doc(inline)]
#[allow(unused_imports)]
pub use service::*;

pub mod logging;

/// Scenario directory: `$GROW_CONFORMANCE_DIR` when set, else `<dir>/../conformance/scenarios`
/// relative to the given crate directory (pass `env!("CARGO_MANIFEST_DIR")`).
pub fn scenarios_dir(manifest_dir: &str) -> std::path::PathBuf {
    match std::env::var_os("GROW_CONFORMANCE_DIR") {
        Some(dir) if !dir.is_empty() => dir.into(),
        _ => std::path::Path::new(manifest_dir).join("../conformance/scenarios"),
    }
}