Skip to content

Commit 62be1ab

Browse files
Skip latex test for vscode version >= 1.98.0 (#2986)
1 parent 66001b4 commit 62be1ab

File tree

5 files changed

+47
-14
lines changed

5 files changed

+47
-14
lines changed

packages/cursorless-vscode-e2e/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@
3030
"@types/js-yaml": "4.0.9",
3131
"@types/lodash-es": "4.17.12",
3232
"@types/mocha": "10.0.10",
33+
"@types/semver": "7.7.0",
3334
"@types/sinon": "17.0.4",
3435
"@types/vscode": "1.82.0",
3536
"chai": "5.2.0",
3637
"js-yaml": "4.1.0",
3738
"mocha": "11.6.0",
39+
"semver": "7.7.2",
3840
"sinon": "21.0.0"
3941
}
4042
}

packages/cursorless-vscode-e2e/src/suite/recorded.vscode.test.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
import * as vscode from "vscode";
1414
import { endToEndTestSetup, sleepWithBackoff } from "../endToEndTestSetup";
1515
import { setupFake } from "./setupFake";
16+
import { shouldSkipRecordedTest } from "./shouldSkipTest";
1617

1718
suite("recorded test cases", async function () {
1819
const { getSpy } = endToEndTestSetup(this);
@@ -27,19 +28,20 @@ suite("recorded test cases", async function () {
2728
getRecordedTestPaths().forEach(({ name, path }) =>
2829
test(
2930
name,
30-
asyncSafety(
31-
async () =>
32-
await runRecordedTest({
33-
path,
34-
spyIde: getSpy()!,
35-
36-
openNewTestEditor,
37-
38-
sleepWithBackoff,
39-
testHelpers: (await getCursorlessApi()).testHelpers!,
40-
runCursorlessCommand,
41-
}),
42-
),
31+
asyncSafety(async () => {
32+
if (shouldSkipRecordedTest(name)) {
33+
this.ctx.skip();
34+
}
35+
36+
await runRecordedTest({
37+
path,
38+
spyIde: getSpy(),
39+
openNewTestEditor,
40+
sleepWithBackoff,
41+
testHelpers: (await getCursorlessApi()).testHelpers!,
42+
runCursorlessCommand,
43+
});
44+
}),
4345
),
4446
);
4547
});

packages/cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
serializeIterationScopeFixture,
2222
serializeScopeFixture,
2323
} from "./serializeScopeFixture";
24+
import { shouldSkipScopeTest } from "./shouldSkipTest";
2425

2526
suite("Scope test cases", async function () {
2627
endToEndTestSetup(this);
@@ -53,7 +54,13 @@ suite("Scope test cases", async function () {
5354
testPaths.forEach(({ path, name, languageId, facet }) =>
5455
test(
5556
name,
56-
asyncSafety(() => runTest(path, languageId, facet)),
57+
asyncSafety(() => {
58+
if (shouldSkipScopeTest(languageId)) {
59+
this.ctx.skip();
60+
}
61+
62+
return runTest(path, languageId, facet);
63+
}),
5764
),
5865
);
5966
});
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import * as semver from "semver";
2+
import * as vscode from "vscode";
3+
4+
/**
5+
* FIXME: On newer vscode versions some Tree sitter parser throws memory errors
6+
* https://github.com/cursorless-dev/cursorless/issues/2879
7+
*/
8+
const isVersionProblematic = semver.gte(vscode.version, "1.98.0");
9+
10+
export function shouldSkipRecordedTest(name: string): boolean {
11+
return isVersionProblematic && name.startsWith("recorded/languages/latex/");
12+
}
13+
14+
export function shouldSkipScopeTest(languageId: string): boolean {
15+
return isVersionProblematic && languageId === "latex";
16+
}

pnpm-lock.yaml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)