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

Use IPv6 in integration tests #884

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- `libcnb-test`:
- The host returned by `TestContext::start_container` will now use IPv6 `::1` rather than IPv4 `127.0.0.1`. If you are using `ContainerContext::address_for_port` to assemble a URL, you may need to wrap the parsed `ip` in brackets `http://[{ip}]` ([]())

## [0.26.0] - 2024-11-18

Expand Down
6 changes: 3 additions & 3 deletions libcnb-test/src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl From<DockerRunCommand> for Command {
}

for port in &docker_run_command.exposed_ports {
command.args(["--publish", &format!("127.0.0.1::{port}")]);
command.args(["--publish", &format!("[::1]::{port}")]);
}

for (source, target) in &docker_run_command.bind_mounts {
Expand Down Expand Up @@ -355,9 +355,9 @@ mod tests {
"--env",
"FOO=1",
"--publish",
"127.0.0.1::12345",
"[::1]::12345",
"--publish",
"127.0.0.1::55555",
"[::1]::55555",
"--mount",
"type=bind,source=./test-cache,target=/cache",
"--mount",
Expand Down
Loading