Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Sep 27, 2024
1 parent 0c31327 commit afa2a0a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/torii/graphql/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ pub async fn model_fixtures(db: &mut Sql) {
pub async fn spinup_types_test() -> Result<SqlitePool> {
let tempfile = NamedTempFile::new().unwrap();
let path = tempfile.path().to_string_lossy();
let options = SqliteConnectOptions::from_str(&path).unwrap().create_if_missing(true).with_regexp();
let options =
SqliteConnectOptions::from_str(&path).unwrap().create_if_missing(true).with_regexp();
let pool = SqlitePoolOptions::new()
.min_connections(1)
.idle_timeout(None)
Expand Down
1 change: 1 addition & 0 deletions crates/torii/grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ dojo-utils.workspace = true
katana-runner.workspace = true
scarb.workspace = true
sozo-ops.workspace = true
tempfile.workspace = true

[target.'cfg(target_arch = "wasm32")'.dependencies]
tonic-web-wasm-client.workspace = true
Expand Down
14 changes: 13 additions & 1 deletion crates/torii/grpc/src/server/tests/entities_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use starknet::core::utils::{get_contract_address, get_selector_from_name};
use starknet::providers::jsonrpc::HttpTransport;
use starknet::providers::{JsonRpcClient, Provider};
use starknet_crypto::poseidon_hash_many;
use tempfile::NamedTempFile;
use tokio::sync::broadcast;
use torii_core::engine::{Engine, EngineConfig, Processors};
use torii_core::executor::Executor;
Expand All @@ -33,7 +34,18 @@ use crate::types::schema::Entity;
#[tokio::test(flavor = "multi_thread")]
#[katana_runner::test(accounts = 10, db_dir = copy_spawn_and_move_db().as_str())]
async fn test_entities_queries(sequencer: &RunnerCtx) {
let pool = setup_sqlite_pool().await.unwrap();
let tempfile = NamedTempFile::new().unwrap();
let path = tempfile.path().to_string_lossy();
let options =
SqliteConnectOptions::from_str(&path).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();
sqlx::migrate!("../migrations").run(&pool).await.unwrap();

let setup = CompilerTestSetup::from_examples("../../dojo-core", "../../../examples/");
let config = setup.build_test_config("spawn-and-move", Profile::DEV);
Expand Down

0 comments on commit afa2a0a

Please sign in to comment.