Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Sep 27, 2024
1 parent 65612fa commit 13b1ba7
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 6 deletions.
24 changes: 21 additions & 3 deletions crates/torii/core/src/sql_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ where
#[katana_runner::test(accounts = 10, db_dir = copy_spawn_and_move_db().as_str())]
async fn test_load_from_remote(sequencer: &RunnerCtx) {
let options = SqliteConnectOptions::from_str("").unwrap().create_if_missing(true);
let pool = SqlitePoolOptions::new().min_connections(1).idle_timeout(None).max_lifetime(None).connect_with(options).await.unwrap();
let pool = SqlitePoolOptions::new()
.min_connections(1)
.idle_timeout(None)
.max_lifetime(None)
.connect_with(options)
.await
.unwrap();
sqlx::migrate!("../migrations").run(&pool).await.unwrap();

let setup = CompilerTestSetup::from_examples("../../dojo-core", "../../../examples/");
Expand Down Expand Up @@ -219,7 +225,13 @@ async fn test_load_from_remote(sequencer: &RunnerCtx) {
#[katana_runner::test(accounts = 10, db_dir = copy_spawn_and_move_db().as_str())]
async fn test_load_from_remote_del(sequencer: &RunnerCtx) {
let options = SqliteConnectOptions::from_str("").unwrap().create_if_missing(true);
let pool = SqlitePoolOptions::new().min_connections(1).idle_timeout(None).max_lifetime(None).connect_with(options).await.unwrap();
let pool = SqlitePoolOptions::new()
.min_connections(1)
.idle_timeout(None)
.max_lifetime(None)
.connect_with(options)
.await
.unwrap();
sqlx::migrate!("../migrations").run(&pool).await.unwrap();

let setup = CompilerTestSetup::from_examples("../../dojo-core", "../../../examples/");
Expand Down Expand Up @@ -321,7 +333,13 @@ async fn test_load_from_remote_del(sequencer: &RunnerCtx) {
#[katana_runner::test(accounts = 10, db_dir = copy_spawn_and_move_db().as_str())]
async fn test_update_with_set_record(sequencer: &RunnerCtx) {
let options = SqliteConnectOptions::from_str("").unwrap().create_if_missing(true);
let pool = SqlitePoolOptions::new().min_connections(1).idle_timeout(None).max_lifetime(None).connect_with(options).await.unwrap();
let pool = SqlitePoolOptions::new()
.min_connections(1)
.idle_timeout(None)
.max_lifetime(None)
.connect_with(options)
.await
.unwrap();
sqlx::migrate!("../migrations").run(&pool).await.unwrap();

let setup = CompilerTestSetup::from_examples("../../dojo-core", "../../../examples/");
Expand Down
8 changes: 7 additions & 1 deletion crates/torii/graphql/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,13 @@ pub async fn model_fixtures(db: &mut Sql) {
pub async fn spinup_types_test() -> Result<SqlitePool> {
// change sqlite::memory: to sqlite:~/.test.db to dump database to disk
let options = SqliteConnectOptions::from_str("")?.create_if_missing(true).with_regexp();
let pool = SqlitePoolOptions::new().min_connections(1).idle_timeout(None).max_lifetime(None).connect_with(options).await.unwrap();
let pool = SqlitePoolOptions::new()
.min_connections(1)
.idle_timeout(None)
.max_lifetime(None)
.connect_with(options)
.await
.unwrap();
sqlx::migrate!("../migrations").run(&pool).await.unwrap();

let setup = CompilerTestSetup::from_paths("../../dojo-core", &["../types-test"]);
Expand Down
8 changes: 7 additions & 1 deletion crates/torii/grpc/src/server/tests/entities_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ use crate::types::schema::Entity;
#[katana_runner::test(accounts = 10, db_dir = copy_spawn_and_move_db().as_str())]
async fn test_entities_queries(sequencer: &RunnerCtx) {
let options = SqliteConnectOptions::from_str("").unwrap().create_if_missing(true).with_regexp();
let pool = SqlitePoolOptions::new().min_connections(1).idle_timeout(None).max_lifetime(None).connect_with(options).await.unwrap();
let pool = SqlitePoolOptions::new()
.min_connections(1)
.idle_timeout(None)
.max_lifetime(None)
.connect_with(options)
.await
.unwrap();
sqlx::migrate!("../migrations").run(&pool).await.unwrap();

let setup = CompilerTestSetup::from_examples("../../dojo-core", "../../../examples/");
Expand Down
8 changes: 7 additions & 1 deletion crates/torii/libp2p/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,13 @@ mod test {
let options = <SqliteConnectOptions as std::str::FromStr>::from_str("")
.unwrap()
.create_if_missing(true);
let pool = SqlitePoolOptions::new().min_connections(1).idle_timeout(None).max_lifetime(None).connect_with(options).await.unwrap();
let pool = SqlitePoolOptions::new()
.min_connections(1)
.idle_timeout(None)
.max_lifetime(None)
.connect_with(options)
.await
.unwrap();
sqlx::migrate!("../migrations").run(&pool).await.unwrap();

let sequencer = KatanaRunner::new().expect("Failed to create Katana sequencer");
Expand Down

0 comments on commit 13b1ba7

Please sign in to comment.