Something went wrong. Try again.
QuickDID is a high-performance AT Protocol identity resolution service written in Rust. It provides handle-to-DID resolution with Redis-back
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536//! Test helper utilities for QuickDID tests
use crate::cache::create_redis_pool;use deadpool_redis::Pool;
/// Helper function to get a Redis pool for testing.////// Returns None if TEST_REDIS_URL is not set, logging a skip message./// This consolidates the repeated Redis test setup code.pub(crate) fn get_test_redis_pool() -> Option<Pool> { match std::env::var("TEST_REDIS_URL") { Ok(url) => match create_redis_pool(&url) { Ok(pool) => Some(pool), Err(e) => { eprintln!("Failed to create Redis pool: {}", e); None } }, Err(_) => { eprintln!("Skipping test: Set TEST_REDIS_URL to run Redis tests"); None } }}
/// Macro to skip Redis tests if pool is not available#[macro_export]macro_rules! require_redis { () => { match $crate::test_helpers::get_test_redis_pool() { Some(pool) => pool, None => return, } };}