Build an in-memory `ServerState` for unit tests.
()
| 691 | |
| 692 | /// Build an in-memory `ServerState` for unit tests. |
| 693 | pub async fn test_server_state() -> Arc<ServerState> { |
| 694 | let store = Arc::new( |
| 695 | Store::connect("sqlite::memory:?cache=shared") |
| 696 | .await |
| 697 | .unwrap(), |
| 698 | ); |
| 699 | let compute = new_test_runtime(store.clone()).await; |
| 700 | Arc::new(ServerState::new( |
| 701 | Config::new(None).with_database_url("sqlite::memory:?cache=shared"), |
| 702 | store, |
| 703 | compute, |
| 704 | SandboxIndex::new(), |
| 705 | SandboxWatchBus::new(), |
| 706 | TracingLogBus::new(), |
| 707 | Arc::new(SupervisorSessionRegistry::new()), |
| 708 | None, |
| 709 | )) |
| 710 | } |
| 711 | } |
| 712 | |
| 713 | // --------------------------------------------------------------------------- |
no test coverage detected