diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-02 21:20:17 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-02 21:20:17 +0000 |
| commit | 72683beea066d066637e747c40dc859fb709babf (patch) | |
| tree | 2db3462ebbcb7501e56491148cc3ffa7aa294071 /grasp-audit/src/lib.rs | |
| parent | 5c10ca008413744b09136618eaa85275c997704c (diff) | |
refactor: rename AuditMode variants and change CLI default to shared
Breaking change: Renamed AuditMode enum variants for clarity:
- AuditMode::CI -> AuditMode::Isolated (fresh fixtures per test)
- AuditMode::Production -> AuditMode::Shared (reuse fixtures across tests)
Config constructors renamed (with deprecated aliases):
- AuditConfig::ci() -> AuditConfig::isolated()
- AuditConfig::production() -> AuditConfig::shared()
CLI default changed from 'ci' to 'shared' mode, which enables
fixture caching across tests. This fixes the issue where fixtures
were being re-created for every test in CLI mode.
Fixture caching behavior:
- Shared mode (CLI default): Uses client's cache, fixtures reused
- Isolated mode (for cargo test): Local cache per TestContext
Diffstat (limited to 'grasp-audit/src/lib.rs')
| -rw-r--r-- | grasp-audit/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/grasp-audit/src/lib.rs b/grasp-audit/src/lib.rs index 6df240f..655ee83 100644 --- a/grasp-audit/src/lib.rs +++ b/grasp-audit/src/lib.rs | |||
| @@ -16,8 +16,8 @@ | |||
| 16 | //! | 16 | //! |
| 17 | //! #[tokio::main] | 17 | //! #[tokio::main] |
| 18 | //! async fn main() -> Result<(), Box<dyn std::error::Error>> { | 18 | //! async fn main() -> Result<(), Box<dyn std::error::Error>> { |
| 19 | //! // Create audit client for CI testing | 19 | //! // Create audit client with shared fixtures (default for CLI) |
| 20 | //! let config = AuditConfig::ci(); | 20 | //! let config = AuditConfig::shared(); |
| 21 | //! let client = AuditClient::new("ws://localhost:7000", config).await?; | 21 | //! let client = AuditClient::new("ws://localhost:7000", config).await?; |
| 22 | //! | 22 | //! |
| 23 | //! // Run smoke tests | 23 | //! // Run smoke tests |