positron: add api tests in ci - #1058
Conversation
✅ 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.
|
Looks like the same failure is showing up on main, but the rest should be ready to go!
|
|
Failing tests are related to #1062, I think |
|
The fix for the tests related to the new Quarto version is merged now, if you want to merge from |
|
Ah, yep! Looks much better now 💯 |
juliasilge
left a comment
There was a problem hiding this comment.
Thank you so much for working on these! We're in a much better place now for being able to add tests moving forward.
|
Sorry I missed this PR before it was merged. It looks awesome @isabelizimm !! Excited to have this. |
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 topositron.runtime.executeCode:#| ...) are stripped from executed code.reticulate::repl_python(...)and submitted to the R runtime.notebook-export.test.ts— Verifies Quarto registers its.qmdexporter with Positron's built-inpositron.notebook-exportextension API (cross-extension wiring absent in vanilla VS Code).Test harness / infra
scripts/run-positron-tests.mjs— Launcher using@posit-dev/positron-test-electron. Runs with extensions enabled (opts out of the default--disable-extensions) so Positron's bundled runtimes and notebook-export extension are available. Extension auto-update is disabled in the test host — otherwise Positron treats the dev-loaded extension as "outdated" and removes it mid-run.index.ts— Mocha entry point (tdd UI, 120s timeout) that discovers and runs the compiled tests.build.ts— Includespositron/*.tsin the test build.package.json— Addstest-positronscripts (app + root) and the@posit-dev/positron-test-electrondev 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-positronaction, which downloads a Positron build and executesyarn test-positroninside it.