Skip to content

Commit b10ed89

Browse files
committed
fix(showcase): Have the test-setup schema reset talk to Proxy directly
... to avoid the problem where running the schema setup against the DB directly results in the Proxy not being able to see it within the same test run.
1 parent 732b399 commit b10ed89

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

packages/showcase/src/common.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ pub const PG_V17_TLS: u16 = 5617;
1414

1515
static INIT: Once = Once::new();
1616

17-
pub async fn reset_schema_to(schema: &'static str) {
18-
let port = std::env::var("CS_DATABASE__PORT")
19-
.map(|s| s.parse().unwrap())
20-
.unwrap_or(PG_LATEST);
21-
17+
pub async fn reset_schema_to(schema: &'static str, port: u16) {
2218
let client = connect_with_tls(port).await;
2319
client.simple_query(schema).await.unwrap();
2420
}

packages/showcase/src/schema.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use crate::common::reset_schema_to;
1+
use crate::common::{reset_schema_to, PROXY};
22

33
const SCHEMA: &str = include_str!("./schema.sql");
44

55
pub async fn setup_schema() {
6-
reset_schema_to(SCHEMA).await
6+
reset_schema_to(SCHEMA, PROXY).await
77
}

0 commit comments

Comments
 (0)