Configure lifecycle fixtures before state construction

Co-authored-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
Signed-off-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
Signed-off-by: Logan Johnson <loganj@squareup.com>
This commit is contained in:
Logan Johnson
2026-08-28 13:36:32 -04:00
parent b637ca1ad6
commit b0740383fd
2 changed files with 2 additions and 5 deletions

View File

@@ -23,11 +23,7 @@ struct Fixture {
}
impl Fixture {
async fn new() -> Self {
let mut state = test_state().await;
Arc::get_mut(&mut state)
.expect("unique state")
.config
.require_auth_token = false;
let state = test_state().await;
let owner = Keys::generate();
let agent = Keys::generate();
let host = format!("wake-{}.example", Uuid::new_v4().simple());

View File

@@ -922,6 +922,7 @@ pub(crate) mod postgres_tests {
pub(crate) async fn test_state() -> Arc<AppState> {
let mut config = crate::config::Config::from_env().expect("default config loads");
config.require_relay_membership = false;
config.require_auth_token = false;
config.redis_url = "redis://127.0.0.1:1".to_string();
let pool = sqlx::PgPool::connect_lazy(&config.database_url).expect("lazy pg pool");
let db = buzz_db::Db::from_pool(pool.clone());