Skip to content
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.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cargo-credential-macos-keychain = { version = "0.4.21", path = "credential/cargo
cargo-credential-wincred = { version = "0.4.21", path = "credential/cargo-credential-wincred" }
cargo-platform = { path = "crates/cargo-platform", version = "0.3.3" }
cargo-test-macro = { version = "0.4.10", path = "crates/cargo-test-macro" }
cargo-test-support = { version = "0.10.1", path = "crates/cargo-test-support" }
cargo-test-support = { version = "0.11.0", path = "crates/cargo-test-support" }
cargo-util = { version = "0.2.28", path = "crates/cargo-util" }
cargo-util-schemas = { version = "0.13.0", path = "crates/cargo-util-schemas" }
cargo_metadata = "0.23.1"
Expand Down
2 changes: 1 addition & 1 deletion crates/cargo-test-support/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-test-support"
version = "0.10.1"
version = "0.11.0"
edition.workspace = true
rust-version = "1.93" # MSRV:1
license.workspace = true
Expand Down
17 changes: 0 additions & 17 deletions crates/cargo-test-support/src/containers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ pub struct Container {
pub struct ContainerHandle {
/// The name of the container.
name: String,
/// The IP address of the container.
///
/// NOTE: This is currently unused, but may be useful so I left it in.
/// This can only be used on Linux. macOS and Windows docker doesn't allow
/// direct connection to the container.
pub ip_address: String,
/// Port mappings of `container_port` to `host_port` for ports exposed via EXPOSE.
pub port_mappings: HashMap<u16, u16>,
}
Expand Down Expand Up @@ -69,22 +63,11 @@ impl Container {
self.copy_files(&name);
self.start_container(&name);
let info = self.container_inspect(&name);
let ip_address = if cfg!(target_os = "linux") {
info[0]["NetworkSettings"]["IPAddress"]
.as_str()
.unwrap()
.to_string()
} else {
// macOS and Windows can't make direct connections to the
// container. It only works through exposed ports or mapped ports.
"127.0.0.1".to_string()
};
let port_mappings = self.port_mappings(&info);
self.wait_till_ready(&port_mappings);

ContainerHandle {
name,
ip_address,
port_mappings,
}
}
Expand Down