From 382b0a4d2265c1ff7252f0fd10c2fbb5935b4988 Mon Sep 17 00:00:00 2001 From: Tim Lucas Date: Mon, 18 Mar 2024 11:31:08 +1100 Subject: [PATCH] again --- vscode/src/configuration.ts | 2 +- vscode/test/e2e/helpers.ts | 2 +- vscode/test/fixtures/.vscode/settings.json | 1 - vscode/test/fixtures/mock-server.ts | 5 ++--- vscode/test/fixtures/multi-root.code-workspace | 1 - 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/vscode/src/configuration.ts b/vscode/src/configuration.ts index 0fb5e4ac491b..d96af3529e86 100644 --- a/vscode/src/configuration.ts +++ b/vscode/src/configuration.ts @@ -187,7 +187,7 @@ export const getFullConfig = async (): Promise => const config = getConfiguration() const isTesting = process.env.CODY_TESTING === 'true' const serverEndpoint = - localStorage?.getEndpoint() || (isTesting ? 'http://localhost:49300/' : DOTCOM_URL.href) + localStorage?.getEndpoint() || (isTesting ? `http://localhost:4930${process.env.VITEST_POOL_ID || 0}/` : DOTCOM_URL.href) const accessToken = (await getAccessToken()) || null return { ...config, accessToken, serverEndpoint } } diff --git a/vscode/test/e2e/helpers.ts b/vscode/test/e2e/helpers.ts index f1bbb38b220b..58ac35f3d340 100644 --- a/vscode/test/e2e/helpers.ts +++ b/vscode/test/e2e/helpers.ts @@ -258,7 +258,7 @@ async function buildWorkSpaceSettings( extraSettings: WorkspaceSettings ): Promise { const settings = { - 'cody.serverEndpoint': 'http://localhost:49300', + 'cody.serverEndpoint': `http://localhost:4930${process.env.VITEST_POOL_ID || 0}`, 'cody.commandCodeLenses': true, 'cody.editorTitleCommandIcon': true, ...extraSettings, diff --git a/vscode/test/fixtures/.vscode/settings.json b/vscode/test/fixtures/.vscode/settings.json index ae7a78ff4270..0e28aad4e503 100644 --- a/vscode/test/fixtures/.vscode/settings.json +++ b/vscode/test/fixtures/.vscode/settings.json @@ -1,5 +1,4 @@ { - "cody.codebase": "http://localhost:49300", "cody.debug.enable": true, "cody.debug.verbose": true, } diff --git a/vscode/test/fixtures/mock-server.ts b/vscode/test/fixtures/mock-server.ts index 6886fdc0e285..e003a0bdbcda 100644 --- a/vscode/test/fixtures/mock-server.ts +++ b/vscode/test/fixtures/mock-server.ts @@ -18,9 +18,8 @@ interface MockRequest { } } -const SERVER_PORT = 49300 - -export const SERVER_URL = 'http://localhost:49300' +const SERVER_PORT = Number(`4930${process.env.VITEST_POOL_ID || 0}`) +export const SERVER_URL = `http://localhost:${SERVER_PORT}` export const VALID_TOKEN = 'sgp_1234567890123456789012345678901234567890' const responses = { diff --git a/vscode/test/fixtures/multi-root.code-workspace b/vscode/test/fixtures/multi-root.code-workspace index 9b10eac4494b..641d861ef7d3 100644 --- a/vscode/test/fixtures/multi-root.code-workspace +++ b/vscode/test/fixtures/multi-root.code-workspace @@ -10,7 +10,6 @@ "settings": { // Settings that should also apply to the single-root workspace tests should also be // included in fixtures\workspace\.vscode\settings.json! - "cody.serverEndpoint": "http://localhost:49300", "cody.commandCodeLenses": true, "cody.editorTitleCommandIcon": true, "cody.experimental.symfContext": false,