Skip to content

Commit

Permalink
database-introspection: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aknuds1 committed Jul 26, 2019
1 parent 47d053d commit 0a5330d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Empty file removed db/.placeholder
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use prisma_query::connector::{Queryable, Sqlite as SqliteDatabaseClient};
use std::sync::Arc;
use std::{thread, time};
use std::sync::atomic::{AtomicBool, Ordering};
use std::path::Path;

const SCHEMA: &str = "DatabaseInspectorTest";

Expand Down Expand Up @@ -384,7 +385,9 @@ fn get_sqlite_connector(migration: Migration) -> sqlite::IntrospectionConnector
let server_root = std::env::var("SERVER_ROOT").expect("Env var SERVER_ROOT required but not found.");
let database_folder_path = format!("{}/db", server_root);
let database_file_path = dbg!(format!("{}/{}.db", database_folder_path, SCHEMA));
std::fs::remove_file(database_file_path.clone()).expect("remove database file");
if Path::new(&database_file_path).exists() {
std::fs::remove_file(database_file_path.clone()).expect("remove database file");
}

let full_sql = migration.make::<barrel::backend::Sqlite>();
let conn = rusqlite::Connection::open_in_memory().expect("opening SQLite connection should work");
Expand Down

0 comments on commit 0a5330d

Please sign in to comment.