mirror of
https://github.com/block/buzz.git
synced 2026-11-26 03:01:38 +00:00
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:
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user