Repository navigation
e2e: consolidate R package provisioning in the os-e2e-deps action - #18489
Closed
kevinushey wants to merge 5 commits into
Closed
kevinushey wants to merge 5 commits into
kevinushey wants to merge 5 commits into
Conversation
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.
Getting the harness's required R packages installed where the session can see them previously took a hand-wired pair in every workflow -- the install-required-packages input plus a PW_RSTUDIO_R_LIBS_USER env var pointing at the same path -- and configuring one without the other silently degraded to test-time installs from cran.r-project.org (the failure class behind #18390 and the pr-18449 Windows CRAN-outage hangs). The Linux Server workflow had a third mechanism: a separately curated list seeded into a root-owned system library, which uninstall-flow tests could never touch. Make the os-e2e-deps action own the whole contract: default install-required-packages to true and export PW_RSTUDIO_R_LIBS_USER from the action itself (skipped when the caller defines it or opts out), then delete the per-workflow wiring on Windows, macOS, and Linux desktop. The Linux engines keep their per-engine escape hatch (an empty value still opts out). The server workflow now copies the action-populated library into the per-run test user's default user library (~/R/%p-library/%v) and chowns it: rserver rebuilds each session's environment from scratch (#18348), so only R's own default path can reach the rsessions. Sessions get every package read-write, so uninstall-flow tests (missing_packages_banner) keep working, and the system-library seed is retired. Of its curated list, readr is genuinely used (import_dataset.test.ts) and moves into required-packages.txt; tidyverse is referenced by no test and is dropped. Addresses #18488.
RStudio E2E - all platforms11 test(s) failed
View / download the full reportView report online -- opens in the browser, no download needed. Available for 14 days. Download playwright-report.zip -- extract and open
All platforms - commit |
- scope the provision-step chown to the resolved USER_LIB rather than a hardcoded ~/R, so the guard and the ownership handover stay in lockstep - fail the provision step with names when required packages are missing from the test user library, instead of echoing an unasserted count - pin the action's install step to R_LIBS_USER = the r-libs-user input, so the install can't diverge from the cache path and exported lookup - drop tidyverse from e2e/rstudio/DESCRIPTION (referenced by no test; the components tests use come via required-packages.txt)
…idation # Conflicts: # .github/actions/os-e2e-deps/action.yml
Restores tidyverse in the e2e DESCRIPTION (dropped in the previous review commit) and adds it to required-packages.txt, so globalSetup's presence check covers it and CI preinstalls it into the cached library.
Member
Code review findingsActionable items from an automated review. Suggestions
|
gtritchie
approved these changes
Aug 10, 2026
gtritchie
left a comment
Member
There was a problem hiding this comment.
LGTM! One suggestion posted.
kevinushey
added a commit
that referenced
this pull request
Aug 10, 2026
…18489 commit 849c42d Author: Kevin Ushey <[email protected]> Date: Mon Aug 10 13:43:21 2026 -0700 keep tidyverse; add it to required-packages.txt Restores tidyverse in the e2e DESCRIPTION (dropped in the previous review commit) and adds it to required-packages.txt, so globalSetup's presence check covers it and CI preinstalls it into the cached library. commit 5bd28d4 Merge: 0e36677 aebb191 Author: Kevin Ushey <[email protected]> Date: Mon Aug 10 13:42:52 2026 -0700 Merge remote-tracking branch 'origin/main' into test/e2e-rlibs-consolidation # Conflicts: # .github/actions/os-e2e-deps/action.yml commit 0e36677 Author: Kevin Ushey <[email protected]> Date: Mon Aug 10 13:32:26 2026 -0700 address review feedback - scope the provision-step chown to the resolved USER_LIB rather than a hardcoded ~/R, so the guard and the ownership handover stay in lockstep - fail the provision step with names when required packages are missing from the test user library, instead of echoing an unasserted count - pin the action's install step to R_LIBS_USER = the r-libs-user input, so the install can't diverge from the cache path and exported lookup - drop tidyverse from e2e/rstudio/DESCRIPTION (referenced by no test; the components tests use come via required-packages.txt) commit 6d2dcf3 Author: Kevin Ushey <[email protected]> Date: Fri Aug 7 17:10:38 2026 -0700 e2e: consolidate R package provisioning in the os-e2e-deps action Getting the harness's required R packages installed where the session can see them previously took a hand-wired pair in every workflow -- the install-required-packages input plus a PW_RSTUDIO_R_LIBS_USER env var pointing at the same path -- and configuring one without the other silently degraded to test-time installs from cran.r-project.org (the failure class behind #18390 and the pr-18449 Windows CRAN-outage hangs). The Linux Server workflow had a third mechanism: a separately curated list seeded into a root-owned system library, which uninstall-flow tests could never touch. Make the os-e2e-deps action own the whole contract: default install-required-packages to true and export PW_RSTUDIO_R_LIBS_USER from the action itself (skipped when the caller defines it or opts out), then delete the per-workflow wiring on Windows, macOS, and Linux desktop. The Linux engines keep their per-engine escape hatch (an empty value still opts out). The server workflow now copies the action-populated library into the per-run test user's default user library (~/R/%p-library/%v) and chowns it: rserver rebuilds each session's environment from scratch (#18348), so only R's own default path can reach the rsessions. Sessions get every package read-write, so uninstall-flow tests (missing_packages_banner) keep working, and the system-library seed is retired. Of its curated list, readr is genuinely used (import_dataset.test.ts) and moves into required-packages.txt; tidyverse is referenced by no test and is dropped. Addresses #18488. commit 02d8c6e Author: Kevin Ushey <[email protected]> Date: Fri Aug 7 16:41:44 2026 -0700 e2e: pre-install required R packages on the windows and macos runners 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.
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.
Addresses #18488.
Stacked on #18487 (base branch); GitHub will retarget this to
mainwhen that merges. The diff shown here is just the consolidation.What changes
The
os-e2e-depsaction now owns the whole provisioning contract.install-required-packagesdefaults to"true", and the action exportsPW_RSTUDIO_R_LIBS_USER(pointing at itsr-libs-userinput) toGITHUB_ENVitself, the same way it already exportsPLAYWRIGHT_BROWSERS_PATH. The export is skipped when the caller already defines the variable (a job-level override wins) or opts out of the install. It is no longer possible to configure the install without the lookup or vice versa -- the half-configured states behind #18390 and the pr-18449 Windows CRAN-outage hangs.With the action owning both halves, the per-workflow wiring is deleted:
PW_RSTUDIO_R_LIBS_USERjob env and the explicit flag are gone.cache-scopeinputs stay -- they encode real ABI boundaries).PW_RSTUDIO_R_LIBS_USERexpression on the test step is gone. The per-enginepreinstall_r_packagespass-through stays as the escape hatch: an engine passing an empty value still opts out of both halves (a provided-but-empty input does not take the action default).The Linux Server workflow provisions the test user's library instead of a root-owned system library. rserver rebuilds each rsession's environment from scratch (#18348), so no env var from the job can reach the sessions -- only R's own default user library path can. After
os-e2e-depspopulates the workspaceR-libstree, a new step expands the per-run test user'sR_LIBS_USERtemplate (~/R/%p-library/%v, resolved the same wayr-libs-setup.tsdoes), copies the tree there, and chowns it. Sessions then resolve every required package with zero test-time installs, and because the user owns the copy, uninstall-flow tests (missing_packages_banner'sremove.packages) work -- which the root-owned seed this replaces could never allow. A real copy rather than a hardlink clone:chownon hardlinks would flip the owner of the runner's cached tree too (shared inodes).The retired seed's curated list is folded into the single manifest:
readris genuinely used (import_dataset.test.ts) and moves intorequired-packages.txt;tidyverseis referenced by no test and is dropped. Note the DBI uninstall test (s4_unloaded_package) is@desktop_only, so nothing on server uninstalls anything seeded.Notes
-req<hash>suffix (it now carries the required set);restore-keysbridges from the old key, and the scheduled main runs save the new one.sudo -H -uexpansion relies on sudo'senv_resetkeeping the job'sR_LIBS_USERout of the child environment so R's own default template is what expands; a guard fails the step if the resolved path lands outside the user's home.actionlintfinding counts identical tomainon every touched workflow (the new server step contributes none); the expansion one-liner tested locally with the template both set and unset.packageRepo()inr-libs-setup.tsand the per-testensurePackageInstalledstill point at cran.r-project.org; with the library pre-populated everywhere these reduce to presence checks.