Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ exclude = [
]

[tool.pytest.ini_options]
testpaths = ["."]
testpaths = ["tests"]
python_files = "test_*.py"
python_classes = "Test*"
python_functions = "test_*"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,20 @@

from copilot import CopilotClient

from .proxy import CapiProxy

from .proxy import BASE_DIR, CapiProxy

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

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


CLI_PATH = get_cli_path_for_tests()
SNAPSHOTS_DIR = Path(__file__).parents[3] / "test" / "snapshots"
SNAPSHOTS_DIR = BASE_DIR / "test" / "snapshots"


class E2ETestContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""

import os
import pathlib
import platform
import re
import subprocess
Expand All @@ -14,6 +15,9 @@
import httpx


BASE_DIR = pathlib.Path(__file__).parents[4]


class CapiProxy:
"""Manages a replaying proxy server for E2E tests."""

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

# The harness server is in the shared test directory
server_path = os.path.join(
os.path.dirname(__file__), "..", "..", "..", "test", "harness", "server.ts"
BASE_DIR / "test" / "harness" / "server.ts"
)
server_path = os.path.abspath(server_path)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading