@@ -59,6 +59,7 @@ const extraArgs = (() => {
5959 return args
6060} ) ( )
6161
62+ const serverHost = process . env . OPENCODE_E2E_SERVER_HOST ?? "127.0.0.1"
6263const [ serverPort , webPort ] = await Promise . all ( [ freePort ( ) , freePort ( ) ] )
6364
6465const sandbox = await fs . mkdtemp ( path . join ( os . tmpdir ( ) , "opencode-e2e-" ) )
@@ -85,9 +86,9 @@ const serverEnv = {
8586
8687const runnerEnv = {
8788 ...process . env ,
88- PLAYWRIGHT_SERVER_HOST : "localhost" ,
89+ PLAYWRIGHT_SERVER_HOST : serverHost ,
8990 PLAYWRIGHT_SERVER_PORT : String ( serverPort ) ,
90- VITE_OPENCODE_SERVER_HOST : "localhost" ,
91+ VITE_OPENCODE_SERVER_HOST : serverHost ,
9192 VITE_OPENCODE_SERVER_PORT : String ( serverPort ) ,
9293 PLAYWRIGHT_PORT : String ( webPort ) ,
9394} satisfies Record < string , string >
@@ -116,7 +117,7 @@ const server = Bun.spawn(
116117 "--port" ,
117118 String ( serverPort ) ,
118119 "--hostname" ,
119- "127.0.0.1" ,
120+ serverHost ,
120121 ] ,
121122 {
122123 cwd : opencodeDir ,
@@ -127,7 +128,7 @@ const server = Bun.spawn(
127128)
128129
129130try {
130- await waitForHealth ( `http://localhost :${ serverPort } /global/health` , server )
131+ await waitForHealth ( `http://${ serverHost } :${ serverPort } /global/health` , server )
131132
132133 const runner = Bun . spawn ( [ "bun" , "test:e2e" , ...extraArgs ] , {
133134 cwd : appDir ,
0 commit comments