Skip to content

e2e: consolidate R package provisioning across runner workflows #18488

Open

Description

@kevinushey

Background

Getting the e2e suite's R packages installed where the session can see them is currently spread across several runner-specific mechanisms:

  • The package list itself is single-sourced (e2e/rstudio/required-packages.txt) and the installer is one shared action (os-e2e-deps), but every workflow must hand-wire a pair of settings that only work together: install-required-packages on the action, and PW_RSTUDIO_R_LIBS_USER pointing globalSetup at the same library the action populated. Configuring one without the other silently degrades to a thinner library plus test-time CRAN installs -- the failure class behind both treat an empty PW_RSTUDIO_R_LIBS_USER as unset #18390 (env var set but effectively empty on Linux) and the desktop-windows CRAN-outage hangs diagnosed in the pr-18449 all-platforms run (env var set but flag missing; fixed by PR e2e: pre-install required R packages on the windows and macos runners #18487).
  • The Linux Server workflow has a third mechanism: a hand-curated package list seeded into a root-owned system library, with a caveat comment warning that uninstall-test subjects must never be added to it.
  • Repo selection exists twice: PPM in the action's bash, cran.r-project.org in r-libs-setup.ts for non-Linux.

Plan

  1. Make os-e2e-deps own the whole contract. Default install-required-packages to "true" and have the action export PW_RSTUDIO_R_LIBS_USER (pointing at its r-libs-user input) to GITHUB_ENV itself, skipping the export when the caller already defines the variable or opts out of the install. The action already exports PLAYWRIGHT_BROWSERS_PATH the same way. Callers then can't half-configure the pairing, and the per-workflow env/flag wiring (Windows x2, macOS x3, the Linux test-step expression) gets deleted.
  2. Server: provision the per-run test user's library instead of the system library. After os-e2e-deps populates the workspace R-libs tree, copy it into the test user's default user library (~/R/%p-library/%v) and chown it. R picks that path up with no env plumbing (nothing has to survive rserver's per-session environment rebuild, E2E sandbox AI credentials do not reach an RStudio Server session #18348), sessions get every package read-write, and uninstall-flow tests work on anything. The root-owned system-library seed and its separate curated list are then retired. Notes: the DBI uninstall test (s4_unloaded_package) is @desktop_only so it never ran on server anyway; fortunes (the missing_packages_banner subject) stays absent from every manifest; readr is genuinely used (import_dataset.test.ts) and moves into required-packages.txt; tidyverse is referenced by no test and is dropped.
  3. Keep what encodes real differences: the macOS cache-scope keys (ABI boundaries) and the Linux per-engine preinstall_r_packages escape hatch (passing an empty value still opts out).

Out of scope

packageRepo() in r-libs-setup.ts and the per-test ensurePackageInstalled self-heal path still point at cran.r-project.org; with the library pre-populated everywhere these reduce to presence checks, so repointing them at PPM can be considered separately.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions