Skip to content

Comments

chore(e2e): add manual override for networking in Linux#1552

Open
robertwilde wants to merge 2 commits intosiemens:mainfrom
robertwilde:chore/e2e-networking-manual
Open

chore(e2e): add manual override for networking in Linux#1552
robertwilde wants to merge 2 commits intosiemens:mainfrom
robertwilde:chore/e2e-networking-manual

Conversation

@robertwilde
Copy link

@robertwilde robertwilde commented Feb 19, 2026

When setting up Playwright tests in Windows using WSL, I found that the docker container has trouble connecting to localhost:4200. To be able to pass another address a slight change needs to be made to e2e-local.sh


@robertwilde robertwilde requested a review from a team as a code owner February 19, 2026 12:30
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to allow overriding network settings for e2e tests, particularly for WSL users. The change in e2e-local.sh attempts to set default values for LOCAL_ADDRESS and NETWORK_MODE on Linux only if they are not already set. However, the current implementation has a flaw that causes it to break the existing configuration for Linux. I've left a comment with a suggested fix to correctly implement the intended behavior while staying within the scope of the change.

e2e-local.sh Outdated
Comment on lines 39 to 44
if [ -z "$LOCAL_ADDRESS" ]; then
LOCAL_ADDRESS=localhost
fi
if [ -z "$NETWORK_MODE" ]; then
NETWORK_MODE=host
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The current logic for setting default values for LOCAL_ADDRESS and NETWORK_MODE on Linux is not working as intended. These variables are initialized on lines 33-34, so the [ -z ... ] checks on lines 39 and 42 will always evaluate to false. This results in the Linux configuration incorrectly using the default bridge network mode and $BRIDGE_ADDRESS instead of host and localhost, which is a regression from the previous behavior.

To correctly allow overrides while setting Linux-specific defaults, you could instead check if the variables still hold the initial non-Linux default values and then replace them. This ensures that user-provided overrides are respected.

Suggested change
if [ -z "$LOCAL_ADDRESS" ]; then
LOCAL_ADDRESS=localhost
fi
if [ -z "$NETWORK_MODE" ]; then
NETWORK_MODE=host
fi
if [ "$LOCAL_ADDRESS" = "$BRIDGE_ADDRESS" ]; then
LOCAL_ADDRESS=localhost
fi
if [ "$NETWORK_MODE" = "bridge" ]; then
NETWORK_MODE=host
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant