positron: add api tests in ci#1058
Draft
isabelizimm wants to merge 6 commits into
Draft
Conversation
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
The macos-latest runner has ~7 GB RAM, so Node's default V8 old-space heap limit (~2 GB) is too small for the vscode-editor vite build, which OOMs during 'yarn run build-vscode'. The same build passes on ubuntu runners (16 GB RAM, ~4 GB default heap). Set NODE_OPTIONS to match.
Running with extensions enabled (disableExtensions: false) keeps the
gallery active, so Positron auto-updates 'outdated' extensions on
startup and disables/removes the development Quarto extension loaded via
extensionDevelopmentPath. By test time getExtension('quarto.quarto')
returns undefined ('Extension quarto.quarto not found').
Seed a throwaway user-data-dir with extensions.autoUpdate /
autoCheckUpdates set to false and pass it via launchArgs. positron-test-
electron appends our launchArgs last, and Positron uses the last
--user-data-dir, so our seeded settings win.
positron-test-electron 0.0.2 disables extension auto-update inside the test host it launches (seeding its own temp user-data-dir), which keeps the development Quarto extension from being evicted mid-run. Passing a second --user-data-dir from the runner (to seed the same setting ourselves) made Positron's getUserDataPath receive an array and crash with ERR_INVALID_ARG_TYPE, so drop it — 0.0.2 covers it in-package. Pin the dependency to ^0.0.2 (was floating "latest", which had locked to the fix-less 0.0.1) so CI installs the version with the fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a separate integration test suite that runs the Quarto extension inside Positron (rather than vanilla VS Code), so we can cover Positron-specific code paths that the main @vscode/test-cli suite can't reach.
Tests added (
apps/vscode/src/test/positron/)execute-cell.test.ts— Verifies the Quarto-specific transformations that happen before delegating to positron.runtime.executeCode:notebook-export.test.ts— Verifies Quarto registers its .qmd exporter with Positron's built-in positron.notebook-export extension API (cross-extension wiring absent in vanilla VS Code).Test harness / infra
scripts/run-positron-tests.mjs— Launcher using @posit-deRuns with extensions enabled (opts out of the default--disable-extensions) so Positron's bundled runtimes and notebook-export extension are available. Seeds a throwaway user-data-dir that disablesextension auto-update — otherwise Positron treats the dev-l"outdated" and removes it mid-run.
index.ts— Mocha entry point (tdd UI, 120s timeout) that discovers and runs the compiled tests.build.ts— Includes positron/*.ts in the test build.package.json— Adds test-positron scripts (app + root) antest-electron dev dependency..gitignore— Ignores .positron-test.Run locally with
yarn test-positron.CI
.github/workflows/test-positron.yaml— New workflow. Runs the tests via theposit-dev/setup-positron action, which downloads a Positron build and executesyarn test-positroninside it.