Skip to content

Commit

Permalink
Hack to work around microsoft/vscode#178241 (#1515)
Browse files Browse the repository at this point in the history
- Fixes #1363

## Checklist

- [x] Fails when test case legitimately fails
- [x] Retries when test case fails with "codewindow unresponsive"
- [x] Succeeds when test case succeeds
- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [x] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [x] I have not broken the cheatsheet
  • Loading branch information
pokey committed Jun 15, 2023
1 parent 2b0a50c commit 85a50bb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
6 changes: 2 additions & 4 deletions packages/test-harness/src/scripts/runTestsCI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getCursorlessRepoRoot } from "@cursorless/common";
import * as path from "path";
import { launchVscodeAndRunTests } from "../util/launchVscodeAndRunTests";

async function main() {
(async function main() {
// Note that we run all tests, including unit tests, in VSCode, even though
// unit tests could be run separately. If we wanted to run unit tests
// separately, we could instead use `../runners/endToEndOnly` instead of
Expand All @@ -18,6 +18,4 @@ async function main() {
);

await launchVscodeAndRunTests(extensionTestsPath);
}

main();
})();
24 changes: 14 additions & 10 deletions packages/test-harness/src/util/launchVscodeAndRunTests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as cp from "child_process";
import * as path from "path";
import * as os from "os";
import {
downloadAndUnzipVSCode,
resolveCliArgsFromVSCodeExecutablePath,
Expand Down Expand Up @@ -55,21 +56,24 @@ export async function launchVscodeAndRunTests(extensionTestsPath: string) {
},
);

console.log("finished installing dependency extensions");

// Run the integration test
await runTests({
const code = await runTests({
vscodeExecutablePath,
extensionDevelopmentPath,
extensionTestsPath,
// Note: Crash dump causes legacy VSCode to hang, so we just don't bother
launchArgs: useLegacyVscode
? undefined
: [
`--crash-reporter-directory=${crashDir}`,
`--logsPath=${logsDir}`,
"--disable-gpu",
"--disable-software-rasterizer",
],
// Note: Crash dump causes legacy VSCode and Windows to hang, so we just
// don't bother. Can be re-enabled if we ever need it; on windows it only
// hangs some of the time, so might be enough to get a crash dump when you
// need it.
launchArgs:
useLegacyVscode || os.platform() === "win32"
? undefined
: [`--crash-reporter-directory=${crashDir}`, `--logsPath=${logsDir}`],
});

console.log(`Returned from "runTests" with value: ${code}`);
} catch (err) {
console.error("Test run threw exception:");
console.error(err);
Expand Down

0 comments on commit 85a50bb

Please sign in to comment.