(self)
| 32 | self._client: CopilotClient | None = None |
| 33 | |
| 34 | async def setup(self): |
| 35 | from .testharness.context import get_cli_path_for_tests |
| 36 | |
| 37 | self.cli_path = get_cli_path_for_tests() |
| 38 | self.home_dir = tempfile.mkdtemp(prefix="copilot-token-config-") |
| 39 | self.work_dir = tempfile.mkdtemp(prefix="copilot-token-work-") |
| 40 | |
| 41 | self._proxy = CapiProxy() |
| 42 | self.proxy_url = await self._proxy.start() |
| 43 | |
| 44 | github_token = ( |
| 45 | "fake-token-for-e2e-tests" if os.environ.get("GITHUB_ACTIONS") == "true" else None |
| 46 | ) |
| 47 | |
| 48 | self._client = CopilotClient( |
| 49 | connection=RuntimeConnection.for_tcp(path=self.cli_path, connection_token=self.token), |
| 50 | working_directory=self.work_dir, |
| 51 | env=self.get_env(), |
| 52 | github_token=github_token, |
| 53 | ) |
| 54 | |
| 55 | # Trigger the spawn + connect handshake so the server is listening. |
| 56 | await self._client.start() |
| 57 | |
| 58 | async def teardown(self): |
| 59 | if self._client: |
no test coverage detected