Skip to content

positron: add api tests in ci#1058

Draft
isabelizimm wants to merge 6 commits into
mainfrom
positron-api-tests
Draft

positron: add api tests in ci#1058
isabelizimm wants to merge 6 commits into
mainfrom
positron-api-tests

Conversation

@isabelizimm

@isabelizimm isabelizimm commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

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:
    • Quarto cell options (#| ...) are stripped from executed code.
    • In a knitr document, Python cells are rerouted through reticulate::repl_python(...) and submitted to the R runtime.
  • 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 disables
    extension 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 the posit-dev/setup-positron action, which downloads a Positron build and executes yarn test-positron inside it.

@posit-snyk-bot

posit-snyk-bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 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.
@isabelizimm isabelizimm changed the title positron: add api tests positron: add api tests in ci Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants