-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade testcontainers to 0.16 (#3063)
- Loading branch information
1 parent
d5c04d6
commit 9eee050
Showing
15 changed files
with
375 additions
and
280 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -556,16 +556,16 @@ mod tests { | |
use crate::{ | ||
aggregator::http_handlers::test_util::take_response_body, | ||
binary_utils::{ | ||
database_pool, register_database_pool_status_metrics, zpages_handler, | ||
CommonBinaryOptions, | ||
database_pool, initialize_rustls, register_database_pool_status_metrics, | ||
zpages_handler, CommonBinaryOptions, | ||
}, | ||
config::DbConfig, | ||
}; | ||
use clap::CommandFactory; | ||
use janus_aggregator_core::datastore::test_util::ephemeral_datastore; | ||
use janus_core::test_util::{ | ||
install_test_trace_subscriber, | ||
testcontainers::{container_client, Postgres, Volume}, | ||
testcontainers::{Postgres, Volume}, | ||
}; | ||
use opentelemetry::metrics::MeterProvider as _; | ||
use opentelemetry_sdk::{ | ||
|
@@ -574,7 +574,7 @@ mod tests { | |
testing::metrics::InMemoryMetricsExporter, | ||
}; | ||
use std::{collections::HashMap, fs}; | ||
use testcontainers::RunnableImage; | ||
use testcontainers::{core::Mount, runners::AsyncRunner, RunnableImage}; | ||
use tokio::task::spawn_blocking; | ||
use tracing_subscriber::{reload, EnvFilter}; | ||
use trillium::Status; | ||
|
@@ -654,8 +654,8 @@ mod tests { | |
#[tokio::test] | ||
async fn postgres_tls_connection() { | ||
install_test_trace_subscriber(); | ||
initialize_rustls(); | ||
|
||
let client = container_client(); | ||
// We need to be careful about providing the certificate and private key to the Postgres | ||
// container. The key must have '-rw-------' permissions, and both must be readable by the | ||
// postgres user, which has UID 70 inside the container at time of writing. Merely mounting | ||
|
@@ -680,16 +680,16 @@ mod tests { | |
.to_string(), | ||
]), | ||
)) | ||
.with_volume(( | ||
.with_mount(Mount::bind_mount( | ||
fs::canonicalize("tests/tls_files") | ||
.unwrap() | ||
.into_os_string() | ||
.into_string() | ||
.unwrap(), | ||
"/etc/ssl/postgresql_host", | ||
)) | ||
.with_volume((volume.name(), "/etc/ssl/postgresql")); | ||
let setup_container = client.run(setup_image); | ||
.with_mount(Mount::volume_mount(volume.name(), "/etc/ssl/postgresql")); | ||
let setup_container = setup_image.start().await; | ||
drop(setup_container); | ||
|
||
let image = RunnableImage::from(( | ||
|
@@ -703,10 +703,10 @@ mod tests { | |
"ssl_key_file=/etc/ssl/postgresql/127.0.0.1-key.pem".to_string(), | ||
]), | ||
)) | ||
.with_volume((volume.name(), "/etc/ssl/postgresql")); | ||
let db_container = client.run(image); | ||
.with_mount(Mount::volume_mount(volume.name(), "/etc/ssl/postgresql")); | ||
let db_container = image.start().await; | ||
const POSTGRES_DEFAULT_PORT: u16 = 5432; | ||
let port = db_container.get_host_port_ipv4(POSTGRES_DEFAULT_PORT); | ||
let port = db_container.get_host_port_ipv4(POSTGRES_DEFAULT_PORT).await; | ||
|
||
let db_config = DbConfig { | ||
url: format!("postgres://[email protected]:{port}/postgres?sslmode=require") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ allow = [ | |
"Unicode-DFS-2016", | ||
"OpenSSL", | ||
"Unlicense", | ||
"CC0-1.0", | ||
] | ||
|
||
[[licenses.clarify]] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.