Skip to content

fix(scripts): forward all necessary ports for remote playwright #10606

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

Merged
merged 1 commit into from
Nov 9, 2023
Merged
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
12 changes: 11 additions & 1 deletion scripts/remote_playwright.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,20 @@ main() {
ws_port=${ws_endpoint##*:}
ws_port=${ws_port%/*}

port_args=(
-R "${ws_port}:127.0.0.1:${ws_port}"
-L "${port}:127.0.0.1:${port}"
)

# Also forward prometheus, pprof, and gitauth ports.
for p in 2114 6061 50515 50516; do
port_args+=(-L "${p}:127.0.0.1:${p}")
done

echo
echo "Starting SSH tunnel, run test via \"pnpm run playwright:test\"..."
# shellcheck disable=SC2029 # This is intended to expand client-side.
ssh -t -R "${ws_port}:127.0.0.1:${ws_port}" -L "${port}:127.0.0.1:${port}" coder."${workspace}" "export CODER_E2E_PORT='${port}'; export CODER_E2E_WS_ENDPOINT='${ws_endpoint}'; [[ -d '${coder_repo}/site' ]] && cd '${coder_repo}/site'; exec \"\$(grep \"\${USER}\": /etc/passwd | cut -d: -f7)\" -i -l"
ssh -t "${port_args[@]}" coder."${workspace}" "export CODER_E2E_PORT='${port}'; export CODER_E2E_WS_ENDPOINT='${ws_endpoint}'; [[ -d '${coder_repo}/site' ]] && cd '${coder_repo}/site'; exec \"\$(grep \"\${USER}\": /etc/passwd | cut -d: -f7)\" -i -l"
}

main