1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Testing utilities for FORGE applications.
//!
//! This module provides comprehensive testing infrastructure for all FORGE function types:
//! - Queries (read-only database access)
//! - Mutations (write operations + job/workflow dispatch)
//! - Actions (external HTTP calls)
//! - Jobs (background processing)
//! - Crons (scheduled tasks)
//! - Workflows (durable multi-step processes)
//!
//! # Philosophy
//!
//! Following sqlx's testing philosophy, we recommend testing against real databases
//! rather than mocks. However, for unit tests that don't need database access,
//! the test contexts can be used without a database connection.
//!
//! # Zero-Config Database
//!
//! When the `embedded-test-db` feature is enabled, `TestDatabase` will automatically
//! download and start an embedded PostgreSQL instance if `DATABASE_URL` is not set.
//!
//! # Example
//!
//! ```ignore
//! use forge::prelude::*;
//!
//! #[tokio::test]
//! async fn test_authenticated_query() {
//! let ctx = TestQueryContext::builder()
//! .as_user(Uuid::new_v4())
//! .with_role("admin")
//! .build();
//!
//! assert!(ctx.auth.is_authenticated());
//! assert!(ctx.auth.has_role("admin"));
//! }
//! ```
pub use *;
pub use *;
pub use ;
pub use ;
pub use ;
use Duration;
/// Default test timeout.
pub const DEFAULT_TEST_TIMEOUT: Duration = from_secs;
/// Default job test timeout.
pub const DEFAULT_JOB_TIMEOUT: Duration = from_secs;
/// Default workflow test timeout.
pub const DEFAULT_WORKFLOW_TIMEOUT: Duration = from_secs;