Skip to content

Commit 5c64e41

Browse files
committed
Fix some lingering path issues
1 parent a8c457d commit 5c64e41

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

python/tests/e2e/testharness/context.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,20 @@
1313

1414
from copilot import CopilotClient
1515

16-
from .proxy import CapiProxy
17-
16+
from .proxy import BASE_DIR, CapiProxy
1817

1918
def get_cli_path_for_tests() -> str:
2019
"""Get CLI path for E2E tests. Uses node_modules CLI during development."""
2120
# Look for CLI in sibling nodejs directory's node_modules
22-
base_path = Path(__file__).parents[3]
23-
full_path = base_path / "nodejs" / "node_modules" / "@github" / "copilot" / "index.js"
21+
full_path = BASE_DIR / "nodejs" / "node_modules" / "@github" / "copilot" / "index.js"
2422
if full_path.exists():
2523
return str(full_path.resolve())
2624

2725
raise RuntimeError("CLI not found for tests. Run 'npm install' in the nodejs directory.")
2826

2927

3028
CLI_PATH = get_cli_path_for_tests()
31-
SNAPSHOTS_DIR = Path(__file__).parents[3] / "test" / "snapshots"
29+
SNAPSHOTS_DIR = BASE_DIR / "test" / "snapshots"
3230

3331

3432
class E2ETestContext:

python/tests/e2e/testharness/proxy.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77

88
import os
9+
import pathlib
910
import platform
1011
import re
1112
import subprocess
@@ -14,6 +15,9 @@
1415
import httpx
1516

1617

18+
BASE_DIR = pathlib.Path(__file__).parents[4]
19+
20+
1721
class CapiProxy:
1822
"""Manages a replaying proxy server for E2E tests."""
1923

@@ -28,7 +32,7 @@ async def start(self) -> str:
2832

2933
# The harness server is in the shared test directory
3034
server_path = os.path.join(
31-
os.path.dirname(__file__), "..", "..", "..", "test", "harness", "server.ts"
35+
BASE_DIR / "test" / "harness" / "server.ts"
3236
)
3337
server_path = os.path.abspath(server_path)
3438

0 commit comments

Comments
 (0)