Skip to content

Windows CI runs fewer unit test scopes than Linux/macOS #17825

Description

@gtritchie

Summary

After #17824, the Windows CI Tests stage runs only the core scope.
Other platforms run substantially more, leaving Windows-specific
regressions in several areas uncovered by CI.

Coverage gaps

jenkins/Jenkinsfile.windows still invokes only core:

bat 'cd package/win32/build/src/cpp && rstudio-tests.bat --scope core'

rstudio-tests.bat itself now accepts every scope the Unix runner does
(core, rserver, rsession, r), so what remains is a gap in what CI
asks for rather than in what the runner can do:

  • rsession and r are supported by the batch script but not invoked by
    the Jenkinsfile. Running all scopes in CI was attempted and reverted
    (7f7d9be, see comment below) pending investigation of the failures.
  • rserver has nothing to run on Windows: those tests are not built on
    the platform, so the scope prints a skip notice and passes.
  • shared_core is not a separate scope. It runs as part of core, along
    with server_core where that is built.

For comparison:

  • Linux (jenkins/Jenkinsfile.linux): four separate invocations --
    core, rsession, rserver, r
  • macOS (jenkins/Jenkinsfile.macos) and PR build: bare ./rstudio-tests,
    which runs all available scopes
  • Windows (jenkins/Jenkinsfile.windows): core only

Runner interface (addressed)

When this issue was filed the two helper scripts used divergent argument
syntax: the bash rstudio-tests took --scope <name>, while
rstudio-tests.bat took bare positional tokens. That mismatch is what
silently disabled Windows tests between #14883 and #17824.

#18069 gave rstudio-tests.bat the same --scope / --filter interface as
the Unix runner, added the r scope, and made the script propagate
failures -- any failing suite now exits 1, where the positional wrapper
always exited 0.

#18384 takes the Windows runner one step further: --scope accepts more
than one scope per invocation, in any of three equivalent forms:

rstudio-tests.bat --scope core,rsession
rstudio-tests.bat --scope core rsession
rstudio-tests.bat --scope core --scope rsession

Scopes always run in core, rserver, rsession, r order regardless of
the order requested, and an unrecognized name fails before any suite runs.
The Windows Tests stage can therefore cover several scopes in a single
bat step, rather than one step per scope as on Linux. The Unix
rstudio-tests still takes a single scope per invocation.

Remaining work

  1. Investigate and fix the failures that caused 7f7d9be, so the rsession
    and r scopes pass on the Windows agents.
  2. Add those scopes to the Windows Tests stage once they are stable, as a
    single invocation -- e.g. rstudio-tests.bat --scope core,rsession,r.

Activity

  1. added
    new
    on Jun 2, 2026
  2. added theissue type on Jun 2, 2026
  3. added
    tech debt
    and removed on Jun 2, 2026
  4. self-assigned this
    on Jun 2, 2026
  5. gtritchie commented on Jun 27, 2026

    @gtritchie
    MemberAuthor

    Lot's o-failures attempting to run all tests in CI. Reverted until I have a change to investigate and fix.

    Revert: 7f7d9be

  6. removed their assignment
    on Jul 14, 2026
  7. gtritchie commented on Sep 15, 2026

    @gtritchie
    MemberAuthor

    Reopening: #18822 (run all test scopes) and #18830 (install testthat on the Windows image) are both being reverted in #18834.

    The r scope can't run on Windows CI as things stand. docker/jenkins/Dockerfile.windows installs R 3.6.3, and CRAN serves no Windows binaries below bin/windows/contrib/4.0 (contrib/3.6/PACKAGES is a 404). Current sources need a newer R regardless — testthat 3.3.2 and purrr 1.2.2 require R >= 4.1.0, rlang 1.3.0 requires R >= 4.0.0.

    So this needs one of:

    1. Upgrade R in Dockerfile.windows (kept in sync with dependencies/windows/Install-RStudio-Prereqs.ps1, which also pins 3.6.3) to >= 4.1. The real fix, but it changes the R that the Windows build and the rsession scope run against.
    2. Install package versions pinned to ones that still support R 3.6, from the CRAN archive.

    Either way the follow-up has to touch docker/ or dependencies/ — or run with FORCE_BUILD_DOCKER=true, OS_FILTER=windows — or the changeset gate on Rebuild Docker Images never fires and the image tag stays stale.

  8. gtritchie commented on Sep 15, 2026

    @gtritchie
    MemberAuthor

    Why R 3.6.3 is pinned on the Windows image, and what actually constrains it

    Follow-up investigation into what it would take to get the r scope running. Summary: the reason usually given for the pin -- that we must link against the oldest supported R's DLLs so RStudio works with that version -- does not hold. There is a hard ceiling on the R version, but it is the 32-bit build, and it lands on R 4.1.3, which is enough to install testthat.

    The linking argument does not hold

    The premise is reasonable as a conservative strategy: the Windows loader resolves every import eagerly at DLL load, so a single R symbol missing from the runtime R.dll fails rsession.dll outright. Building against the oldest supported R guarantees by construction that the import set exists there.

    But the import set is determined by what RStudio's own object files reference, not by which R generated the import library:

    • cmake/modules/FindLibR.cmake:176 runs src/cpp/tools/dll2lib.R, which dumpbin /EXPORTS-es each R DLL into a names-only .def (no ordinals) and calls lib.exe /def:. Binding is by symbol name.

    • Nothing in src/cpp defines USE_RINTERNALS. Where RStudio needs R's internal struct layouts it hand-mirrors them in src/cpp/r/include/r/RSexpInternal.hpp ("accurate for R >= 3.5"), so that ABI comes from our source, not R's headers.

    • There are no R_VERSION conditionals anywhere. src/cpp/r/include/r/RRuntime.hpp:29 states the intent directly:

      This avoids compile-time R_VERSION checks, which break when the version of R used at compile time differs from the version loaded at runtime.

      RRuntime.cpp resolves newer-R symbols (R_ClosureFormals 4.5+, R_getVarEx 4.6+, R_GetBindingType 4.6+) through LoadLibrary/GetProcAddress with old-R fallbacks.

    RSTUDIO_R_VERSION_REQUIRED (cmake/globals.cmake:317) is 3.6.0 -- a build-time floor, not a ceiling.

    Linux is consistent with this: the jammy image builds against Ubuntu 22.04's r-base (R 4.1.2, docker/jenkins/Dockerfile.jammy:69) while supporting older R. That is supporting evidence rather than decisive, though -- ELF binds lazily through the PLT, so a Linux build would tolerate a stray newer-R import that never gets called, where Windows would not. The design intent above is the stronger argument.

    The pin's history offers no justification either: 489a4ed37b (Apr 2021) is just "install R 3.6.3 (up from 3.5) via PowerShell bootstrapper."

    The real ceiling is the 32-bit build

    package/win32/make-package.bat:44-48 sets MULTIARCH=1 whenever JENKINS_URL is defined. package/win32/make-install-win32.bat:62 configures the i386 session, and src/cpp/CMakeLists.txt:502 sets LIBR_FIND_WINDOWS_32BIT, which points FindLibR at LIBR_HOME/bin/i386.

    R 4.2.0's NEWS: "Support for 32-bit builds has been dropped." So the x86\rsession.exe we sign and ship cannot be built with R >= 4.2. R 4.1.3 is the newest R that still ships bin/i386.

    R 4.1.3 is enough for testthat

    CRAN's frozen bin/windows/contrib/4.1 carries Windows binaries for the entire default package set -- no Rtools needed:

    package version in contrib/4.1
    testthat 3.1.7
    purrr 1.0.1
    rlang 1.1.0
    cli 3.6.1
    digest 0.6.31
    xml2 1.3.3
    yaml 2.3.7
    rmarkdown 2.21

    R-4.1.3-win.exe is still published on CRAN. For contrast, bin/windows/contrib/3.6 is a 404 -- CRAN serves no Windows binaries below 4.0 -- and current sources need R >= 4.1 anyway (testthat 3.3.2, purrr 1.2.2) or R >= 4.0 (rlang 1.3.0). That is why #18830 could not work.

    If we bump to 4.1.3

    Touch points:

    • docker/jenkins/Dockerfile.windows:108-117 (download + PATH)
    • dependencies/windows/Install-RStudio-Prereqs.ps1:136-149
    • package/win32/make-package.bat:204
    • package/win32/make-install-win32.bat:62
    • upload R-4.1.3-win.exe to the rstudio-buildtools bucket, which both installers fetch from

    Then re-enable the r scope in jenkins/Jenkinsfile.windows and restore the install-packages.cmd step.

    Two things to resolve first:

    1. testthat 3.1.7 lacks expect_in() (introduced in 3.1.9). Used 23 times in src/cpp/tests/testthat/test-completions-inherit-dot-params.R and once in test-connections.R. Trivially rewritable, but it needs doing or the scope fails.
    2. Whether 32-bit R is still a product requirement is not derivable from the code. If it is not, the 4.1.x ceiling disappears and we can pick any current R.

    Verification the bump should carry

    dll2lib.R leaves an R.def next to each DLL, so the subset check is cheap and should not be skipped -- do not accept the bump on the argument above alone. After building with LIBR_HOME=C:\R\R-4.1.3, run dumpbin /IMPORTS on rsession.dll and confirm its R.dll imports are a subset of 3.6.3's bin\x64\R.def. Same for the x86 rsession.dll against bin\i386\R.def, and for Rgraphapp.dll. A subset proves the binary loads against R 3.6.3.

    Unrelated, but it bit us here

    Setup and Trigger Builds in jenkins/Jenkinsfile.build does not depend on Rebuild Docker Images succeeding. In hourly 2332 the windows cell of the rebuild failed and the platform builds were triggered anyway, against the stale image tag -- which is what made #18830 look like it had simply not worked. Worth a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    automationnewtech debt

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions