Skip to content

Commit 196c3a5

Browse files
authored
fix test workflow (#771)
* Add build-vscode command * Remove test skips in CI!
1 parent 8871478 commit 196c3a5

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ jobs:
2929

3030
- name: Build vscode extension
3131
run: |
32-
cd apps/vscode
3332
yarn install
34-
yarn run build
33+
yarn run build-vscode
3534
3635
- name: Compile and run tests
3736
run: |

apps/vscode/.vscode-test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default defineConfig([
55
files: 'test-out/*.test.js',
66
workspaceFolder: 'src/test/examples',
77
mocha: {
8-
timeout: 3000,
8+
timeout: 5000,
99
},
1010
},
1111
]);

apps/vscode/src/test/quartoDoc.test.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { exampleWorkspacePath, exampleWorkspaceOutPath, copyFile, wait } from ".
44
import { isQuartoDoc } from "../core/doc";
55
import { extension } from "./extension";
66

7-
const APPROX_TIME_TO_OPEN_VISUAL_EDITOR = 1600;
7+
const APPROX_TIME_TO_OPEN_VISUAL_EDITOR = 1700;
88

99
suite("Quarto basics", function () {
1010
// Before we run any tests, we should copy any files that get edited in the tests to file under `exampleWorkspaceOutPath`
@@ -23,12 +23,11 @@ suite("Quarto basics", function () {
2323

2424
// Note: the following tests may be flaky. They rely on waiting estimated amounts of time for commands to complete.
2525
test("Can edit in visual mode", async function () {
26-
// don't run this in CI for now because we haven't figured out how to get the LSP to start
27-
if (process.env['CI']) this.skip();
28-
2926
const doc = await vscode.workspace.openTextDocument(exampleWorkspaceOutPath("hello.qmd"));
3027
const editor = await vscode.window.showTextDocument(doc);
3128

29+
await extension().activate();
30+
3231
// manually confirm visual mode so dialogue pop-up doesn't show because dialogues cause test errors
3332
// and switch to visual editor
3433
await vscode.commands.executeCommand("quarto.test_setkVisualModeConfirmedTrue");
@@ -42,12 +41,11 @@ suite("Quarto basics", function () {
4241
// test. That's okay for this test, but could cause issues if you expect a qmd to look how it
4342
// does in `/examples`.
4443
test("Roundtrip doesn't change hello.qmd", async function () {
45-
// don't run this in CI for now because we haven't figured out how to get the LSP to start
46-
if (process.env['CI']) this.skip();
47-
4844
const doc = await vscode.workspace.openTextDocument(exampleWorkspaceOutPath("hello.qmd"));
4945
const editor = await vscode.window.showTextDocument(doc);
5046

47+
await extension().activate();
48+
5149
const docTextBefore = doc.getText();
5250

5351
// switch to visual editor and back
@@ -59,6 +57,6 @@ suite("Quarto basics", function () {
5957
await wait(300);
6058

6159
const docTextAfter = doc.getText();
62-
assert.ok(docTextBefore === docTextAfter);
60+
assert.ok(docTextBefore === docTextAfter, docTextAfter);
6361
});
6462
});

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"build": "turbo run build",
1212
"dev-writer": "turbo run dev --filter writer*",
1313
"dev-vscode": "turbo run dev --filter quarto...",
14+
"build-vscode": "turbo run build --filter quarto...",
1415
"test-vscode": "cd apps/vscode && yarn test",
1516
"install-vscode": "cd apps/vscode && yarn install-vscode",
1617
"install-positron": "cd apps/vscode && yarn install-positron",

0 commit comments

Comments
 (0)