Skip to content

Commit

Permalink
test: fix usage of testcontainers
Browse files Browse the repository at this point in the history
Update the code to build with the latest version of the testcontainers
crate.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
  • Loading branch information
flavio committed May 9, 2024
1 parent 47527e4 commit 2e16765
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ doc:

.PHONY: test
test: fmt lint doc
cargo test --workspace
cargo test --workspace --features full-native-tls,test-registry

.PHONY: clean
clean:
Expand Down
8 changes: 3 additions & 5 deletions src/cosign/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ mod tests {
use crate::crypto::SigningScheme;

#[cfg(feature = "test-registry")]
use testcontainers::{clients, core::WaitFor};
use testcontainers::{core::WaitFor, runners::AsyncRunner};

pub(crate) const REKOR_PUB_KEY: &str = r#"-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2G2Y+2tabdTV5BcGiBIx0a9fAFwr
Expand Down Expand Up @@ -566,10 +566,8 @@ TNMea7Ix/stJ5TfcLLeABLE4BNJOsQ4vnBHJ
#[tokio::test]
#[serial_test::serial]
async fn sign_verify_image(#[case] signing_scheme: SigningScheme) {
let docker = clients::Cli::default();
let image = registry_image();
let test_container = docker.run(image);
let port = test_container.get_host_port_ipv4(5000);
let test_container = registry_image().start().await;
let port = test_container.get_host_port_ipv4(5000).await;

let mut client = ClientBuilder::default()
.enable_registry_caching()
Expand Down

0 comments on commit 2e16765

Please sign in to comment.