refactor tests

main
Ziyang Hu 2 years ago
parent d7899e0cb4
commit edc89d2f87

@ -5,9 +5,9 @@
* If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#![cfg(feature = "storage-tikv")]
#![cfg(feature = "graph-algo")]
use std::env;
use std::str::FromStr;
use std::time::Instant;
@ -16,13 +16,18 @@ use env_logger::Env;
use lazy_static::lazy_static;
use serde_json::json;
use cozo::{new_cozo_tikv, Db, TiKvStorage};
use cozo::DbInstance;
lazy_static! {
static ref TEST_DB: Db<TiKvStorage> = {
static ref TEST_DB: DbInstance = {
env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();
let creation = Instant::now();
let db = new_cozo_tikv(vec!["127.0.0.1:2379".to_string()], true).unwrap();
let path = "_test_air_routes";
_ = std::fs::remove_file(path);
_ = std::fs::remove_dir_all(path);
let db_kind = env::var("COZO_TEST_DB_KIND").unwrap_or("mem".to_string());
let db = DbInstance::new(&db_kind, path, Default::default()).unwrap();
dbg!(creation.elapsed());
let init = Instant::now();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save