Skip to content

Add test that package to Windows images - #18830

Merged
gtritchie merged 5 commits into
mainfrom
bugfix/windows-testthat-install
Sep 15, 2026
Merged

gtritchie merged 5 commits into
mainfrom
bugfix/windows-testthat-install

Conversation

@cm421

@cm421 cm421 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Intent

Windows builds are failing because there's no test that R package, now that we're running rstudio-tests.bat without any scopes (see #18822 )

Approach

Describe the approach taken and the tradeoffs involved if non-obvious; add an overview of the solution if it's complicated.

Automated Tests

Indicate whether this change includes unit tests or integration tests, or link a work item or pull request to add those tests to another repo. If the change cannot or will not be covered by a test, indicate why.

QA Notes

Ensure you have updated the QA Notes in the original issue.

Documentation

Specify which documentation has been added or modified and why (User Guide? Admin Guide?). If no documentation was added for a new feature, indicate why. If documentation was added in a separate PR, link the PR here.

Checklist

  • If this PR adds a new feature, or fixes a bug in a previously released version, it includes an entry in NEWS.md
  • If this PR adds or changes UI, the updated UI meets accessibility standards
  • A reviewer is assigned to this PR (if unsure who to assign, check Area Owners list)
  • This PR passes all local unit tests

cm421 and others added 5 commits September 15, 2026 10:06
Windows CI started failing the r/testthat test scope after #18822 removed
the --scope restriction that was excluding it, because nothing in the
Windows dependency-provisioning scripts ever installed testthat (or any
other R package) -- unlike Linux/macOS, which install a default package
set via dependencies/common/install-packages. Add the same default
package list to the Windows counterpart, installed from CRAN since there
is no per-platform Windows renv.lock.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Mirror the Unix install-packages script's dir.create(Sys.getenv("R_LIBS_USER"))
step so a fresh non-admin Windows setup, where the site library isn't
writable and the per-user library doesn't exist yet, doesn't fail before
installing testthat and the other defaults.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
install.packages() reports per-package failures as warnings rather than
errors, so R's exit code (and the ERRORLEVEL check around it) didn't
catch a partial failure -- e.g. testthat could silently fail to install
while the script reported success. Verify every requested package
actually installed and stop() if any are missing.

Also check ERRORLEVEL after calling install-packages.cmd from
install-dependencies.cmd, which previously ignored its exit code and
kept installing later dependencies even after a failure.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
R computes .libPaths() at startup and only includes R_LIBS_USER if that
directory already exists; creating it later in the same R process (via
dir.create()) doesn't retroactively add it. On a fresh machine where the
user library doesn't exist yet, install.packages() would still miss it
and fall back to (or fail against) the site/system library. Explicitly
prepend the user library to .libPaths() after creating it.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@cm421
cm421 requested a review from gtritchie September 15, 2026 16:34
@cm421
cm421 deployed to e2e-playwright September 15, 2026 16:48 — with GitHub Actions Active
@cm421
cm421 deployed to e2e-playwright September 15, 2026 16:48 — with GitHub Actions Active
@cm421
cm421 deployed to e2e-playwright September 15, 2026 16:50 — with GitHub Actions Active
@cm421
cm421 deployed to e2e-playwright September 15, 2026 16:50 — with GitHub Actions Active
@cm421
cm421 deployed to e2e-playwright September 15, 2026 16:53 — with GitHub Actions Active
@cm421
cm421 deployed to e2e-playwright September 15, 2026 16:53 — with GitHub Actions Active
@cm421
cm421 deployed to e2e-playwright September 15, 2026 17:00 — with GitHub Actions Active
@cm421
cm421 deployed to e2e-playwright September 15, 2026 17:00 — with GitHub Actions Active
@cm421
cm421 deployed to e2e-playwright September 15, 2026 17:00 — with GitHub Actions Active
@cm421
cm421 deployed to e2e-playwright September 15, 2026 17:00 — with GitHub Actions Active
@cm421
cm421 deployed to e2e-playwright September 15, 2026 17:00 — with GitHub Actions Active
@cm421
cm421 deployed to e2e-playwright September 15, 2026 17:00 — with GitHub Actions Active
@gtritchie gtritchie added this to the 2026.10 (Blue Mistflower) milestone Sep 15, 2026

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for taking care of this.

@github-actions

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

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

Passed Failed Skipped Flaky
2970 0 196 1
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 2 0 10 0
✅ desktop-linux 749 0 38 0
✅ desktop-macos 745 0 42 1
✅ desktop-windows 751 0 42 0
✅ server-linux 695 0 44 0
✅ setup 28 0 20 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 c99c571fff4dafa283c1c4275cb31aba4c1ff039 - Run #1021

@gtritchie
gtritchie merged commit ef7fd98 into main Sep 15, 2026
35 checks passed
@gtritchie
gtritchie deleted the bugfix/windows-testthat-install branch September 15, 2026 18:21
gtritchie added a commit that referenced this pull request Sep 15, 2026
* Revert "Add test that package to Windows images (#18830)"

This reverts commit ef7fd98.

The Windows CI image installs R 3.6.3 (docker/jenkins/Dockerfile.windows),
and CRAN serves no Windows binaries below bin/windows/contrib/4.0 -- the
3.6 directory is a 404. Current sources don't work either: testthat 3.3.2
and purrr 1.2.2 require R >= 4.1.0, rlang 1.3.0 requires R >= 4.0.0. So
install.packages() could never satisfy the package list, and the stop()
this change added on missing packages failed the RUN layer, which failed
the whole image build.

Hourly build 2332, triggered 33 seconds after the merge, failed the
windows cell of Rebuild Docker Images but still ran Setup and Trigger
Builds, so windows-pipeline 3858 built against the unchanged
jenkins/ide:windows-x86_64-blue-mistflower-msvc145 tag and the r scope
failed the same way as before.

Getting testthat onto the Windows image needs either a newer R in the
image or package versions pinned to ones that support R 3.6.

* Revert "Run all test scopes on Windows CI (#18822)"

This reverts commit 3dd87a5.

Restore --scope core,rsession so Windows CI stops failing on the r scope,
which needs testthat. The image can't install it while it ships R 3.6.3
(see the companion revert of #18830).

Addresses #17825.

This branch was successfully deployed

1 active deployment
e2e-playwright — c99c571f Deployed Sep 15, 2026 by cm421 via windows / e2e-desktop-windows (3) #1021
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