- Allowing debugging server while debugging extension tests

- Preventing mocha timeouts due to hitting breakpoints
This commit is contained in:
Kirill Dubovitskiy 2023-08-07 16:34:02 -07:00
parent bf41d986c9
commit bc99a4402a
4 changed files with 2839 additions and 6263 deletions

14
.vscode/launch.json vendored
View file

@ -11,6 +11,14 @@
"Server",
"Extension (VSCode)"
]
},
{
"name": "Server + Tests (VSCode)",
"stopAll": true,
"configurations": [
"Server",
"Tests (VSCode)"
]
}
],
"configurations": [
@ -46,6 +54,7 @@
"CONTINUE_SERVER_URL": "http://localhost:8001"
}
},
// Has to be run after starting the server (separately or using the compound configuration)
{
"name": "Tests (VSCode)",
"type": "extensionHost",
@ -66,6 +75,11 @@
],
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "vscode-extension:tests:build",
"env": {
"CONTINUE_SERVER_URL": "http://localhost:8001",
// Avoid timing out when stopping on breakpoints during debugging in VSCode
"MOCHA_TIMEOUT": "0",
},
}
]
}

File diff suppressed because it is too large Load diff

View file

@ -3,10 +3,14 @@ import Mocha from "mocha";
import * as glob from "glob";
export function run() {
// Avoid timing out when stopping on breakpoints during debugging in VSCode
const timeoutOption = process.env.MOCHA_TIMEOUT ? parseInt(process.env.MOCHA_TIMEOUT) : undefined;
// Create the mocha test
const mocha = new Mocha({
ui: "tdd",
color: true,
timeout: timeoutOption,
});
// See esbuild.test.mjs for more details

View file

@ -10,9 +10,7 @@ describe("Can start python server", () => {
await startContinuePythonServer();
await new Promise((resolve) => setTimeout(resolve, 500));
// Currently is flaky, keeping because still feels useful and we can fix in a followup commit
//
// Check if server is running
const serverUrl = getContinueServerUrl();
const response = await fetch(`${serverUrl}/health`);