feature: Respect TEST_DELOREAN_DB_DIR in the end-to-end test

pull/24376/head
Jake Goulding 2020-03-06 15:48:24 -05:00 committed by Carol (Nichols || Goulding)
parent 97d11633b8
commit f77d28367d
1 changed files with 7 additions and 4 deletions

View File

@ -343,12 +343,15 @@ struct TestServer {
dir: TempDir,
}
// TODO: if TEST_DELOREAN_DB_DIR is set, create a temporary directory in that directory or
// otherwise isolate the database used in this test with the database used in other tests, rather
// than always ignoring TEST_DELOREAN_DB_DIR
impl TestServer {
fn new() -> Result<Self> {
let dir = tempfile::Builder::new().prefix("delorean").tempdir()?;
let _ = dotenv::dotenv(); // load .env file if present
let root = env::var_os("TEST_DELOREAN_DB_DIR").unwrap_or_else(|| env::temp_dir().into());
let dir = tempfile::Builder::new()
.prefix("delorean")
.tempdir_in(root)?;
let server_process = Command::cargo_bin("delorean")?
.stdout(Stdio::null())