From da0a5069d6f095b4812a403f8700c03277911ac6 Mon Sep 17 00:00:00 2001 From: elliot Date: Thu, 24 Jul 2025 10:44:46 -0400 Subject: [PATCH 1/3] Add build-vscode command --- .github/workflows/test.yaml | 3 +-- package.json | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f17d2aee..3769353c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -29,9 +29,8 @@ jobs: - name: Build vscode extension run: | - cd apps/vscode yarn install - yarn run build + yarn run build-vscode - name: Compile and run tests run: | diff --git a/package.json b/package.json index 544c54d3..f4976c3b 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "build": "turbo run build", "dev-writer": "turbo run dev --filter writer*", "dev-vscode": "turbo run dev --filter quarto...", + "build-vscode": "turbo run build --filter quarto...", "test-vscode": "cd apps/vscode && yarn test", "install-vscode": "cd apps/vscode && yarn install-vscode", "install-positron": "cd apps/vscode && yarn install-positron", From 333cdb5d6f67aa18d03b6ab4194323aa7d20aed4 Mon Sep 17 00:00:00 2001 From: elliot Date: Thu, 24 Jul 2025 10:49:51 -0400 Subject: [PATCH 2/3] Disable test skipping in CI to diagnose issue --- apps/vscode/.vscode-test.mjs | 2 +- apps/vscode/src/test/quartoDoc.test.ts | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/vscode/.vscode-test.mjs b/apps/vscode/.vscode-test.mjs index 638bef89..e9ecc398 100644 --- a/apps/vscode/.vscode-test.mjs +++ b/apps/vscode/.vscode-test.mjs @@ -5,7 +5,7 @@ export default defineConfig([ files: 'test-out/*.test.js', workspaceFolder: 'src/test/examples', mocha: { - timeout: 3000, + timeout: 5000, }, }, ]); diff --git a/apps/vscode/src/test/quartoDoc.test.ts b/apps/vscode/src/test/quartoDoc.test.ts index deb7d879..547dafa7 100644 --- a/apps/vscode/src/test/quartoDoc.test.ts +++ b/apps/vscode/src/test/quartoDoc.test.ts @@ -4,7 +4,7 @@ import { exampleWorkspacePath, exampleWorkspaceOutPath, copyFile, wait } from ". import { isQuartoDoc } from "../core/doc"; import { extension } from "./extension"; -const APPROX_TIME_TO_OPEN_VISUAL_EDITOR = 1600; +const APPROX_TIME_TO_OPEN_VISUAL_EDITOR = 1700; suite("Quarto basics", function () { // Before we run any tests, we should copy any files that get edited in the tests to file under `exampleWorkspaceOutPath` @@ -24,11 +24,13 @@ suite("Quarto basics", function () { // Note: the following tests may be flaky. They rely on waiting estimated amounts of time for commands to complete. test("Can edit in visual mode", async function () { // don't run this in CI for now because we haven't figured out how to get the LSP to start - if (process.env['CI']) this.skip(); + // if (process.env['CI']) this.skip(); const doc = await vscode.workspace.openTextDocument(exampleWorkspaceOutPath("hello.qmd")); const editor = await vscode.window.showTextDocument(doc); + await extension().activate(); + // manually confirm visual mode so dialogue pop-up doesn't show because dialogues cause test errors // and switch to visual editor await vscode.commands.executeCommand("quarto.test_setkVisualModeConfirmedTrue"); @@ -43,11 +45,13 @@ suite("Quarto basics", function () { // does in `/examples`. test("Roundtrip doesn't change hello.qmd", async function () { // don't run this in CI for now because we haven't figured out how to get the LSP to start - if (process.env['CI']) this.skip(); + // if (process.env['CI']) this.skip(); const doc = await vscode.workspace.openTextDocument(exampleWorkspaceOutPath("hello.qmd")); const editor = await vscode.window.showTextDocument(doc); + await extension().activate(); + const docTextBefore = doc.getText(); // switch to visual editor and back @@ -59,6 +63,6 @@ suite("Quarto basics", function () { await wait(300); const docTextAfter = doc.getText(); - assert.ok(docTextBefore === docTextAfter); + assert.ok(docTextBefore === docTextAfter, docTextAfter); }); }); From 3c70e17c927cc5b882ee96de9fc96cd2dae40d87 Mon Sep 17 00:00:00 2001 From: elliot Date: Thu, 24 Jul 2025 11:38:07 -0400 Subject: [PATCH 3/3] Remove test skips in CI! --- apps/vscode/src/test/quartoDoc.test.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/apps/vscode/src/test/quartoDoc.test.ts b/apps/vscode/src/test/quartoDoc.test.ts index 547dafa7..87c7f5e5 100644 --- a/apps/vscode/src/test/quartoDoc.test.ts +++ b/apps/vscode/src/test/quartoDoc.test.ts @@ -23,9 +23,6 @@ suite("Quarto basics", function () { // Note: the following tests may be flaky. They rely on waiting estimated amounts of time for commands to complete. test("Can edit in visual mode", async function () { - // don't run this in CI for now because we haven't figured out how to get the LSP to start - // if (process.env['CI']) this.skip(); - const doc = await vscode.workspace.openTextDocument(exampleWorkspaceOutPath("hello.qmd")); const editor = await vscode.window.showTextDocument(doc); @@ -44,9 +41,6 @@ suite("Quarto basics", function () { // test. That's okay for this test, but could cause issues if you expect a qmd to look how it // does in `/examples`. test("Roundtrip doesn't change hello.qmd", async function () { - // don't run this in CI for now because we haven't figured out how to get the LSP to start - // if (process.env['CI']) this.skip(); - const doc = await vscode.workspace.openTextDocument(exampleWorkspaceOutPath("hello.qmd")); const editor = await vscode.window.showTextDocument(doc);