Skip to content

e2e: pre-install required R packages on the windows and macos runners - #18487

Merged
kevinushey merged 1 commit into
mainfrom
test/e2e-preinstall-required-packages
Aug 10, 2026
Merged

kevinushey merged 1 commit into
mainfrom
test/e2e-preinstall-required-packages

Conversation

@kevinushey

Copy link
Copy Markdown
Collaborator

Problem

In the pr-18449 all-platforms e2e run, all three unexpected failures were desktop-windows tests hung in mid-suite package installs: s4_unloaded_package.test.ts stuck on .rs.ensurePackageInstalled("DBI", repos = "https://cran.r-project.org") with

warning: unable to access index for repository https://cran.r-project.org/src/contrib:
  cannot open URL 'https://cran.r-project.org/src/contrib/PACKAGES'

and shinytest2.test.ts stuck on install.packages("shinytest2", ...) with no output, both until the test timeout.

The root cause is that the Windows and macOS e2e workflows never pass install-required-packages to the os-e2e-deps action, so the cached R library contains only the harness's DESCRIPTION dependencies. The required-packages.txt set (which already includes DBI and shinytest2) is instead installed from cran.r-project.org at test time on every run -- by globalSetup when CRAN is reachable, and by per-test ensurePackages self-healing when it is not. A CRAN outage therefore surfaces as mid-suite hangs rather than a fast, clearly-attributed setup failure.

Linux already works the way we want: PR #18390 flipped preinstall_r_packages on for every Linux engine, installing the set from PPM into the cached library before tests run.

Change

  • Pass install-required-packages: "true" to os-e2e-deps in the Windows main workflow, the scheduled Windows autocomplete workflow, and all three macOS workflows, matching the Linux engines. The set installs from PPM (not cran.r-project.org) in the deps step, lands in the cached R-libs tree, and a warm cache installs nothing at all. A cold-cache install failure now fails the "Install e2e test dependencies" step instead of hanging tests.
  • Add the PW_RSTUDIO_R_LIBS_USER wiring (pointing globalSetup at that same library) to the macOS and autocomplete workflows; the main Windows workflow already had it. Without it, globalSetup provisions the harness-default per-host path, which is a different, uncached directory on these ephemeral runners.
  • Refresh the comments in os-e2e-deps/action.yml, required-packages.txt, and r-libs-setup.ts that described the required-set install as Fedora-only.

The Linux Server workflow is deliberately unchanged: it seeds a root-owned system library with its own curated list, because its sessions run as a per-run user and tests that exercise uninstall flows (fortunes, DBI) cannot remove packages from a root-owned library.

Notes

  • The R-library cache key gains a -req<hash> suffix when the flag is set; restore-keys still prefix-matches the old caches, so the first runs restore the existing library and top up the missing packages. The scheduled main-branch runs then save the complete library under the new key.
  • Test-time ensurePackages/ensurePackageInstalled calls still exist as a self-heal path, and they still point at cran.r-project.org; with the library pre-populated they reduce to presence checks. Repointing them at PPM would be a possible follow-up but is not needed for this fix.

Verification

  • YAML parses; actionlint reports only pre-existing shellcheck style notes (identical count on main).
  • e2e/rstudio source changes are comment-only.

The Windows and macOS e2e workflows never passed install-required-packages
to the os-e2e-deps action, so the harness's REQUIRED_PACKAGES set (DBI,
shinytest2, rmarkdown, ...) was installed from cran.r-project.org at test
time on every run: by globalSetup when it could, and by per-test
ensurePackages self-healing when it could not. During a CRAN outage those
installs hang mid-suite (s4_unloaded_package, shinytest2 in the pr-18449
all-platforms run) instead of failing fast.

Pass install-required-packages to the deps action on every desktop engine,
matching Linux (PR #18390), so the set is installed from PPM into the cached
R library before tests and a warm cache installs nothing at all. The macOS
workflows and the scheduled Windows autocomplete workflow also gain the
PW_RSTUDIO_R_LIBS_USER wiring that points globalSetup at that same library
(the main Windows workflow already had it).

The Linux Server workflow deliberately keeps its own system-library seed:
its sessions run as a per-run user, and tests that exercise uninstall flows
(fortunes, DBI) cannot remove packages from a root-owned library.
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

#################### 100% pass rate

Passed Failed Skipped Flaky
2027 0 377 7
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 2 0 8 0
✅ desktop-linux 502 0 90 1
✅ desktop-macos 506 0 86 2
✅ desktop-windows 507 0 90 2
✅ server-linux 488 0 95 2
✅ setup 22 0 8 0
View / download the full report

View report online -- opens in the browser, no download needed. Available for 14 days.

Download playwright-report.zip -- extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


All platforms - commit 02d8c6ec8c1f2425d14d286041ad8a73350788d4 - Run #491

@kevinushey
kevinushey merged commit aebb191 into main Aug 10, 2026
27 checks passed
@kevinushey
kevinushey deleted the test/e2e-preinstall-required-packages branch August 10, 2026 20:38
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