Skip to content

Commit 473585d

Browse files
authored
fix(scripts): forward all necessary ports for remote playwright (#10606)
1 parent e71c53d commit 473585d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/remote_playwright.sh

+11-1
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,20 @@ main() {
7474
ws_port=${ws_endpoint##*:}
7575
ws_port=${ws_port%/*}
7676

77+
port_args=(
78+
-R "${ws_port}:127.0.0.1:${ws_port}"
79+
-L "${port}:127.0.0.1:${port}"
80+
)
81+
82+
# Also forward prometheus, pprof, and gitauth ports.
83+
for p in 2114 6061 50515 50516; do
84+
port_args+=(-L "${p}:127.0.0.1:${p}")
85+
done
86+
7787
echo
7888
echo "Starting SSH tunnel, run test via \"pnpm run playwright:test\"..."
7989
# shellcheck disable=SC2029 # This is intended to expand client-side.
80-
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"
90+
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"
8191
}
8292

8393
main

0 commit comments

Comments
 (0)