diff --git a/warehouse/tests/sqlx_meta.rs b/warehouse/tests/sqlx_meta.rs index fba3def62..98077ab2e 100644 --- a/warehouse/tests/sqlx_meta.rs +++ b/warehouse/tests/sqlx_meta.rs @@ -53,35 +53,6 @@ async fn sql_insert_test(pool: Pool) -> anyhow::Result<()> { Ok(()) } -// #[sqlx::test] -// async fn test_migrate_from_file(pool: Pool) -> anyhow::Result<()> { -// // The directory must be relative to the project root (the directory containing Cargo.toml), unlike include_str!() which uses compiler internals to get the path of the file where it was invoked. -// sqlx::migrate!("tests/mock_migrations").run(&pool).await?; - -// let mut conn = pool.acquire().await?; - -// let id = sqlx::query( -// r#" -// INSERT INTO foo (contact_id, first_name) -// VALUES -// (1, "hello"); -// "#, -// ) -// .execute(&mut *conn) -// .await? -// .last_insert_rowid(); - -// assert!(id == 1); - -// let a = sqlx::query("SELECT * FROM foo") -// .fetch_all(&mut *conn) -// .await?; - -// let q = a.first().unwrap().get_unchecked::(0); -// assert!(q == 1); - -// Ok(()) -// } #[tokio::test] @@ -110,6 +81,5 @@ async fn test_migrate_from_file_pg() -> anyhow::Result<()> { let q = a.first().unwrap().get_unchecked::(0); assert!(q == 1); - Ok(()) } diff --git a/warehouse/tests/support/pg_testcontainer.rs b/warehouse/tests/support/pg_testcontainer.rs index 5ed58f796..123e371e3 100644 --- a/warehouse/tests/support/pg_testcontainer.rs +++ b/warehouse/tests/support/pg_testcontainer.rs @@ -1,6 +1,5 @@ use once_cell::sync::Lazy; use sqlx::PgPool; -use std::{thread, time::Duration}; use testcontainers::{clients::Cli, core::WaitFor, Container, GenericImage, RunnableImage}; // need to wrap the docker cli in a once_cell so that the borrow does not cause issues when container is passed along @@ -32,16 +31,14 @@ pub fn start_container<'a>() -> Container<'a, GenericImage> { .with_env_var("POSTGRES_USER".to_owned(), "postgres".to_owned()) .with_env_var("POSTGRES_PASSWORD".to_owned(), "postgres".to_owned()) .with_wait_for(WaitFor::message_on_stdout( - "database system is ready to accept connections", + // "database system is ready to accept connections", + "PostgreSQL init process complete; ready for start up." )); let image = RunnableImage::from(container); // need to wrap the docker cli in a once_cell so that the borrow does not cause issues when container is passed along let container = CLI.run(image); container.start(); - // TODO: not sure why we need a bit of a wait since we have the WaitFor above - // will otherwise get: "unexpected response from SSLRequest: 0x00 (sqlx_postgres::connection::tls:97)" - thread::sleep(Duration::from_millis(500)); container }