Skip to content

Run all test scopes on Windows CI - #18822

Merged
gtritchie merged 2 commits into
mainfrom
test/windows-ci-all-test-scopes
Sep 14, 2026
Merged

gtritchie merged 2 commits into
mainfrom
test/windows-ci-all-test-scopes

Conversation

@gtritchie

Copy link
Copy Markdown
Member

Following #18810, which added the rsession scope, the Windows pipeline now drops --scope entirely so rstudio-tests.bat runs every scope it supports. In practice that adds the r (testthat) scope; rserver remains a no-op on Windows because those tests aren't built there.

Windows CI now runs the same set of test scopes as the Linux and macOS pipelines.

All scopes pass locally on Windows.

Fixes #17825.

@gtritchie
gtritchie merged commit 3dd87a5 into main Sep 14, 2026
11 checks passed
@gtritchie
gtritchie deleted the test/windows-ci-all-test-scopes branch September 14, 2026 21:52
gtritchie pushed a commit that referenced this pull request Sep 15, 2026
* Install testthat and friends by default on Windows

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]>

* Create R_LIBS_USER before installing packages on Windows

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]>

* Fail loudly on Windows R package install failures

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]>

* Add the newly-created user library to .libPaths() on Windows

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]>

* no comment

---------

Co-authored-by: Claude Sonnet 5 <[email protected]>
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.
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.

Windows CI runs fewer unit test scopes than Linux/macOS

1 participant