From 473585de6c3fe243ed573ad8dc4a501093f70376 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Thu, 9 Nov 2023 14:02:46 +0200 Subject: [PATCH] fix(scripts): forward all necessary ports for remote playwright (#10606) --- scripts/remote_playwright.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/remote_playwright.sh b/scripts/remote_playwright.sh index 57f3a4d49f..5d7f35ea58 100755 --- a/scripts/remote_playwright.sh +++ b/scripts/remote_playwright.sh @@ -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