Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update to latest version of testcontainers #135

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ hmac = "0.12"
itertools = "0.13.0"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tempfile = "3.3"
testcontainers = "0.16"
testcontainers = "0.17"
tokio = { version = "1.21", features = ["macros", "fs", "rt-multi-thread"] }
tokio-util = { version = "0.7.4", features = ["compat"] }
52 changes: 41 additions & 11 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2306,8 +2306,14 @@ mod test {
#[cfg(feature = "test-registry")]
#[tokio::test]
async fn test_list_tags() {
let test_container = registry_image_edge().start().await;
let port = test_container.get_host_port_ipv4(5000).await;
let test_container = registry_image_edge()
.start()
.await
.expect("Failed to start registry container");
let port = test_container
.get_host_port_ipv4(5000)
.await
.expect("Failed to get port");
let auth =
RegistryAuth::Basic(HTPASSWD_USERNAME.to_string(), HTPASSWD_PASSWORD.to_string());

Expand Down Expand Up @@ -2638,8 +2644,14 @@ mod test {
#[tokio::test]
#[cfg(feature = "test-registry")]
async fn can_push_chunk() {
let test_container = registry_image().start().await;
let port = test_container.get_host_port_ipv4(5000).await;
let test_container = registry_image()
.start()
.await
.expect("Failed to start registry container");
let port = test_container
.get_host_port_ipv4(5000)
.await
.expect("Failed to get port");

let c = Client::new(ClientConfig {
protocol: ClientProtocol::Http,
Expand Down Expand Up @@ -2682,8 +2694,14 @@ mod test {
#[tokio::test]
#[cfg(feature = "test-registry")]
async fn can_push_multiple_chunks() {
let test_container = registry_image().start().await;
let port = test_container.get_host_port_ipv4(5000).await;
let test_container = registry_image()
.start()
.await
.expect("Failed to start registry container");
let port = test_container
.get_host_port_ipv4(5000)
.await
.expect("Failed to get port");

let mut c = Client::new(ClientConfig {
protocol: ClientProtocol::Http,
Expand Down Expand Up @@ -2719,7 +2737,10 @@ mod test {
#[tokio::test]
#[cfg(feature = "test-registry")]
async fn test_image_roundtrip_anon_auth() {
let test_container = registry_image().start().await;
let test_container = registry_image()
.start()
.await
.expect("Failed to start registry container");

test_image_roundtrip(&RegistryAuth::Anonymous, &test_container).await;
}
Expand All @@ -2737,7 +2758,7 @@ mod test {
.to_str()
.expect("cannot convert htpasswd_path to string"),
);
let test_container = image.start().await;
let test_container = image.start().await.expect("cannot registry container");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "Cannot start registry container"


let auth =
RegistryAuth::Basic(HTPASSWD_USERNAME.to_string(), HTPASSWD_PASSWORD.to_string());
Expand All @@ -2751,7 +2772,10 @@ mod test {
test_container: &testcontainers::ContainerAsync<GenericImage>,
) {
let _ = tracing_subscriber::fmt::try_init();
let port = test_container.get_host_port_ipv4(5000).await;
let port = test_container
.get_host_port_ipv4(5000)
.await
.expect("Failed to get port");

let c = Client::new(ClientConfig {
protocol: ClientProtocol::HttpsExcept(vec![format!("localhost:{}", port)]),
Expand Down Expand Up @@ -2849,8 +2873,14 @@ mod test {
#[cfg(feature = "test-registry")]
async fn test_mount() {
// initialize the registry
let test_container = registry_image().start().await;
let port = test_container.get_host_port_ipv4(5000).await;
let test_container = registry_image()
.start()
.await
.expect("Failed to start registry");
let port = test_container
.get_host_port_ipv4(5000)
.await
.expect("Failed to get port");

let c = Client::new(ClientConfig {
protocol: ClientProtocol::HttpsExcept(vec![format!("localhost:{}", port)]),
Expand Down
Loading