Skip to content

Commit 6e9d06b

Browse files
authored
Merge pull request #322 from Latitudes-Dev/shuvcode-dev
fix(ci): use 127.0.0.1 for e2e server
2 parents 36c2cc6 + 87dce4d commit 6e9d06b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/app/script/e2e-local.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const extraArgs = (() => {
5959
return args
6060
})()
6161

62+
const serverHost = process.env.OPENCODE_E2E_SERVER_HOST ?? "127.0.0.1"
6263
const [serverPort, webPort] = await Promise.all([freePort(), freePort()])
6364

6465
const sandbox = await fs.mkdtemp(path.join(os.tmpdir(), "opencode-e2e-"))
@@ -85,9 +86,9 @@ const serverEnv = {
8586

8687
const 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

129130
try {
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

Comments
 (0)