8000 Use host network for running tests on Podman by jonkoops · Pull Request #269 · keycloak/keycloak-js · GitHub
[go: up one dir, main page]

Skip to content
Closed
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 test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ npm test -- --debug
By default, the tests will run against a Keycloak server that is running the latest version. This server is started by Playwright using Podman by running the following command:

```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
Copilot AI Feb 17, 2026
Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
```

Alternatively, if you want to run the Keycloak server straight from the distribution (or your local development instance), without using Podman you can run it as follows:
Expand Down
2 changes: 1 addition & 1 deletion test/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const KEYCLOAK_VERSION = 'latest'
export default defineConfig<TestOptions>({
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`,
Copilot AI Feb 17, 2026
Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

url: 'http://localhost:9000/health/live',
stdout: 'pipe',
reuseExistingServer: true,
Expand Down
0