Use host network for running tests on Podman#269
Use host network for running tests on Podman#269jonkoops wants to merge 1 commit intokeycloak:mainfrom
Conversation
Closes keycloak#268 Signed-off-by: Jon Koops <jonkoops@gmail.com>
There was a problem hiding this comment.
Pull request overview
Updates the Playwright integration-test harness to run the Keycloak test container on the host network so localhost/IPv6 loopback behavior is consistent (per #268).
Changes:
- Switch Podman Keycloak container startup to use
--network=host(removing explicit port publishing). - Update test documentation to reflect the new Podman command.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/playwright.config.ts | Runs the Keycloak test container with host networking for loopback/IPv6 behavior. |
| test/README.md | Documents the updated Podman command used by Playwright to start Keycloak. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| fullyParallel: true, | ||
| webServer: [{ | ||
| command: `podman run -p 8080:8080 -p 9000:9000 -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin -e KC_HEALTH_ENABLED=true --pull=newer quay.io/keycloak/keycloak:${KEYCLOAK_VERSION} start-dev`, | ||
| command: `podman run --network=host -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin -e KC_HEALTH_ENABLED=true --pull=newer quay.io/keycloak/keycloak:${KEYCLOAK_VERSION} start-dev`, |
There was a problem hiding this comment.
podman run --network=host is not supported / does not behave as expected on Podman Machine (macOS/Windows) and can break local test runs because ports are no longer published back to the host. Consider making the network mode configurable (e.g., via an env var) or using --network=host only on Linux while keeping -p 8080:8080 -p 9000:9000 as the fallback for other environments.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
|
|
||
| ```sh | ||
| podman run -p 8080:8080 -p 9000:9000 -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin -e KC_HEALTH_ENABLED=true --pull=newer quay.io/keycloak/keycloak:latest start-dev | ||
| podman run --network=host -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin -e KC_HEALTH_ENABLED=true --pull=newer quay.io/keycloak/keycloak:latest start-dev |
There was a problem hiding this comment.
The docs now recommend podman run --network=host, but this is Linux-specific and typically won’t expose ports correctly when using Podman Machine on macOS/Windows. Please add a short note (or an alternative command using -p 8080:8080 -p 9000:9000) so developers on those platforms aren’t blocked from running the test suite.
|
Superseded by #270 |
Uses the
--network=hostoption for Podman when running the tests to force usage of the host network. This allows IPv6 loopbacks to resolve properly.Closes #268