fix: use separate thread to not override DATABASE_URL
This commit is contained in:
parent
a3d17179d6
commit
c1eeff81d5
1 changed files with 13 additions and 6 deletions
|
@ -68,12 +68,19 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_db_env_override() {
|
fn test_db_env_override() {
|
||||||
let init_settings = crate::settings::Settings::new().unwrap();
|
let init_settings = crate::settings::Settings::new().unwrap();
|
||||||
env_helper!(
|
std::thread::spawn(move || {
|
||||||
init_settings,
|
env_helper!(
|
||||||
"DATABASE_URL",
|
init_settings,
|
||||||
"postgres://test_db_env_override",
|
"DATABASE_URL",
|
||||||
database.url
|
"postgres://test_db_env_override",
|
||||||
);
|
database.url
|
||||||
|
);
|
||||||
|
|
||||||
|
assert!(true);
|
||||||
|
})
|
||||||
|
.join()
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
env_helper!(init_settings, "VANIKAM_database_POOL", 99, database.pool);
|
env_helper!(init_settings, "VANIKAM_database_POOL", 99, database.pool);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue