Skip to content

ci(positron): run Positron API tests on ubuntu-latest - #4346

Open
jonvanausdeln wants to merge 1 commit into
mainfrom
jonv/positron-tests-macos-linux-615274
Open

ci(positron): run Positron API tests on ubuntu-latest#4346
jonvanausdeln wants to merge 1 commit into
mainfrom
jonv/positron-tests-macos-linux-615274

Conversation

@jonvanausdeln

Copy link
Copy Markdown
Collaborator

Moves the Positron-API-Tests workflow from macos-latest to ubuntu-latest. Linux Actions minutes bill at roughly 1/10 the macOS rate.

Part of posit-dev/positron#15281. The suite itself landed in #4298.

Changes

Beyond the runner line, four things were required:

  1. xvfb-run -a wrap. Positron is an Electron app and needs a display server on Linux. posit-dev/setup-positron is a thin composite step that only runs the command it is handed, so it provides none. Without this the run fails with Missing X server or $DISPLAY and then dies with SIGSEGV.
  2. @posit-dev/positron-test-electron^0.0.3. 0.0.2's platform table is darwin-arm64/darwin-x64 only; linux-x64 and win32-x64 descriptors land in 0.0.3 (the latest published version). The bump is in extensions/vscode/package.json with the root workspace package-lock.json updated to match.
  3. posit-dev/setup-positron@v1 instead of @main, so upstream changes to the action can't break CI here.
  4. ${{ runner.os }} in the Positron download cache key, on both the restore and the save step. The cache layout is .positron-test/<channel>/<version>/<platform>, so under an OS-less key a stale same-day macOS entry would restore, set cache-hit=true, suppress the save step, and the Linux build would never get cached that day.

Also:

  • Added workflow_dispatch alongside workflow_call so the suite can be triggered manually (e2e.yaml already does both). This is what made the pre-merge verification below possible.
  • Replaced the "macOS only" notes in scripts/run-positron-tests.mjs, src/test/positron/README.md, and extensions/vscode/CLAUDE.md with the xvfb-run recipe for headless Linux runs. Unrelated darwin platform switches in extension source are untouched.

Verification

Dispatched on a fork before opening this PR (run, commit 4b9ac8d8). A green job alone doesn't prove the tests ran, so from the log:

Run xvfb-run -a npm run test-positron
  ✔ Positron injects the acquirePositronApi global
  ✔ Publisher activates in Positron
  ✔ resolves the Python interpreter from Positron's preferred runtime (2051ms)
  ✔ resolves the R interpreter from Positron's preferred runtime
  4 passing (3s)
Extension host test runner exit code: 0
Exit code:   0

Both interpreter-discovery tests pass, so actions/setup-python@v7 and r-lib/actions/setup-r@v2 resolve on ubuntu and Positron's runtime discovery finds both. positron-channel: stable works on Linux — the 0.0.3 README's "stable not available on Linux/Windows yet" caveat is stale. Wall clock was ~5 minutes.

No CHANGELOG entry: CI-only, no user-facing behavior change.

Linux Actions minutes bill at roughly 1/10 the macOS rate
(posit-dev/positron#15281).

- Switch the Positron-API-Tests runner from macos-latest to ubuntu-latest.
- Wrap the test command in `xvfb-run -a`. Positron is an Electron app and
  needs a display server on Linux; posit-dev/setup-positron is a thin
  composite step that only runs the command it is handed, so it provides
  none. Without this the run fails with "Missing X server or $DISPLAY"
  and then SIGSEGV.
- Bump @posit-dev/positron-test-electron to ^0.0.3, which is the first
  release whose platform table includes linux-x64 (0.0.2 was
  darwin-arm64/darwin-x64 only).
- Pin posit-dev/setup-positron@v1 instead of @main so upstream changes to
  the action can't break CI here.
- Add ${{ runner.os }} to the Positron download cache key (restore and
  save). The cache layout is .positron-test/<channel>/<version>/<platform>,
  so without it a stale same-day macOS entry would restore, set
  cache-hit=true, suppress the save step, and the Linux build would never
  get cached.
- Add workflow_dispatch alongside workflow_call so the suite can be run
  manually (matches e2e.yaml).
- Replace the "macOS only" notes in the launcher script, the suite README,
  and extensions/vscode/CLAUDE.md with the xvfb-run recipe for headless
  Linux runs.
@jonvanausdeln
jonvanausdeln requested a review from a team as a code owner August 18, 2026 19:32
@posit-connect-projects

posit-connect-projects Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Claude finished @jonvanausdeln's task in 58s —— View job


Code Review Complete

  • Read changed workflow file
  • Read documentation and script changes
  • Review package.json and lockfile changes
  • Check git diff for complete changes
  • Provide code review feedback

Review Summary

This is a well-executed PR that moves the Positron API tests from macOS to Ubuntu Linux for significant cost savings. The changes are thorough and address all the platform differences correctly.

What looks good

  1. Cache key fix (.github/workflows/positron-api-tests.yaml:34,47): Adding ${{ runner.os }} to both the restore and save cache keys is essential. Without this, a macOS cache entry could be restored on Linux, causing the save step to be skipped (cache-hit=true), leaving Linux builds uncached.

  2. xvfb-run wrapper (line 42): Using xvfb-run -a is the correct approach for headless Electron apps on Linux. The -a flag automatically finds a free display number, avoiding conflicts in concurrent runs.

  3. Action version pinning (line 37): Switching from @main to @v1 is a good stability improvement — protects CI from unintentional breaking changes upstream.

  4. Package bump (extensions/vscode/package.json:955): The @posit-dev/positron-test-electron bump to ^0.0.3 is required since 0.0.2 only had darwin-arm64/darwin-x64 platform descriptors.

  5. workflow_dispatch addition (lines 2-4): Enabling manual dispatch is useful for debugging and pre-merge verification, matching the pattern in e2e.yaml.

  6. Documentation updates: All three docs (CLAUDE.md, README.md, run-positron-tests.mjs) are updated consistently to replace the "macOS only" notes with the xvfb-run recipe.

No issues found

The implementation is clean and complete. The verification run on a fork with visible test output in the logs confirms the tests actually executed. No CHANGELOG entry is correct per the repo guidelines (CI-only, no user-facing change).

Verdict: Approve — Ready to merge.


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.

1 participant