Skip to content

Commit dec5e95

Browse files
committed
Support test DB host on a different port
1 parent 4a9b71f commit dec5e95

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tests/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,15 @@ impl TestContext {
4343
// There does not seem to be a way to turn the config back into a connection
4444
// string, so construct it manually.
4545
let test_db_url = format!(
46-
"postgresql://{}:{}@{}/{}",
46+
"postgresql://{}:{}@{}:{}/{}",
4747
config.get_user().unwrap(),
4848
String::from_utf8(config.get_password().unwrap().to_vec()).unwrap(),
4949
match &config.get_hosts()[0] {
5050
Host::Tcp(host) => host,
5151
Host::Unix(_) =>
5252
panic!("Unix sockets in Postgres connection string are not supported"),
5353
},
54+
&config.get_ports()[0],
5455
db_name
5556
);
5657
let pool = ClientPool::new(test_db_url.clone());

0 commit comments

Comments
 (0)