Skip to content

Fix failing CI checks: roxygen2 8.0.0 docs, screenshot robustness, Windows timeouts, httr2 >= 1.0.0 - #450

Merged
schloerke merged 14 commits into
mainfrom
schloerke/draft-pr-fix-gha
Jul 15, 2026
Merged

Fix failing CI checks: roxygen2 8.0.0 docs, screenshot robustness, Windows timeouts, httr2 >= 1.0.0#450
schloerke merged 14 commits into
mainfrom
schloerke/draft-pr-fix-gha

Conversation

@schloerke

@schloerke schloerke commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Restores the package's CI to green. Each failing check was traced to a distinct root cause and fixed.

Fixes

1. website / pkgdown — roxygen2 8.0.0

roxygen2 8.0.0 validates and re-renders R6 method @examples into the reference page's \preformatted{} blocks. Three constructs in AppDriver's examples produced malformed Rd (unexpected macro '\if'), breaking pkgdown::build_reference_index() and R CMD check:

  • Non-ASCII characters in illustrative log output — bullet and ellipsis . Replaced with * and ....
  • Unbalanced escaped braces in truncated WebSocket JSON log lines. Balanced each \{ … \}.

DESCRIPTION now records Config/roxygen2/version: 8.0.0 and man/ is regenerated.

2. #green screenshot tests (ubuntu / macOS)

test-app-image.R's two #green expectations used the default threshold = NULL, which makes expect_screenshot() a byte-level comparison. The #green box is a solid color whose pixels are identical across platforms, but chromote/Chrome emit non-deterministic PNG bytes (the IDAT zlib stream differs by environment), so the byte comparison failed for months despite screenshot_max_difference() being 0. Pass threshold = 10 to use the pixel-convolution path.

3. check-depends-only

The threshold comparison reads pixels via {png} (a Suggests dependency), absent when checking with dependencies only. Added skip_if_not_installed("png").

4. Windows R-CMD-check timeouts (flaky)

Windows GitHub Actions runners are slow to start the background R process, launch Chrome, and let the app become idle. The 15s default load_timeout caused flaky Shiny app did not become stable / Timed out waiting for JavaScript script to return true errors that varied across runs and R versions. Added tests/testthat/setup-ci-timeouts.R raising SHINYTEST2_LOAD_TIMEOUT (60s) and SHINYTEST2_TIMEOUT (20s) on CI via environment variables, so child R processes launched by callr::rscript() inherit them too.

5. test-url.R on R 4.1 — httr2 (>= 1.0.0)

The Url helper relies on httr2::url_parse()'s curl-based parser (added in httr2 1.0.0). On R 4.1, CI installed httr2 0.2.2 (the last Windows binary for R 4.1), whose older regex parser returns a NULL hostname for bare-domain URLs. Pinned the minimum version.

Verification

pkgdown::build_reference_index() emits 0 warnings; tools::parse_Rd() is clean for all man/*.Rd; ubuntu/macOS/Windows R-CMD-check and test-actions are green in CI.

schloerke and others added 13 commits July 14, 2026 15:44
The CI routine bot regenerates man/ with roxygen2 8.0.0, which inlines
R6 method @examples into man/AppDriver.Rd with malformed brace escaping
(unexpected macro '\if'), breaking the pkgdown 'website' check. This
branch makes no roxygen source changes, so restore man/ and DESCRIPTION
to main's roxygen2 7.3.3 output.
roxygen2 8.0.0 validates and re-renders R6 method @examples into the
reference page's \preformatted{} blocks. Two constructs in the AppDriver
examples produced malformed Rd (unbalanced braces / 'unexpected macro'
warnings) that broke the pkgdown 'website' check and R CMD check:

- Non-ASCII characters (bullet '•', ellipsis '…') in illustrative log
  output. Replaced with ASCII '*' and '...'.
- Unbalanced escaped braces in truncated WebSocket JSON log lines.
  Balanced each line's \{ ... \} escapes.

Verified: tools::parse_Rd() is clean for all man/*.Rd and
pkgdown::build_reference_index() emits 0 warnings.
test-app-image.R's two '#green' screenshot expectations used the default
threshold = NULL, which makes expect_screenshot() a byte-level
comparison (compare_file_binary). The '#green' box is a solid color
whose pixels are identical across platforms, but chromote/Chrome emit
non-deterministic PNG bytes (the IDAT zlib stream differs by
environment), so the byte comparison failed on CI for months despite
screenshot_max_difference() being 0.

Pass threshold = 10 so the comparison uses the pixel convolution path,
which tolerates re-encoding while still catching real visual changes.
The threshold-based comparison reads pixels via {png}, a Suggests
dependency absent under 'R CMD check' with dependencies only. Skip
these tests when {png} isn't installed instead of failing.
Windows GitHub Actions runners are slow to start the background R
process, launch Chrome, and let the Shiny app become idle. The 15s
default load_timeout caused flaky 'Shiny app did not become stable' /
'Timed out waiting for JavaScript script to return true' errors that
varied across runs and Windows R versions (test-app-stop, test-app-update,
test-save-app, ...).

Add a testthat setup file that raises SHINYTEST2_LOAD_TIMEOUT (60s) and
SHINYTEST2_TIMEOUT (20s) on CI. Environment variables are used so the
child R processes started via callr::rscript() inherit them too. Only
raises the failure ceiling; fast inits are unaffected.
The Url helper relies on httr2::url_parse()'s curl-based parser (added
in httr2 1.0.0). On R 4.1, CI installed httr2 0.2.2 (the last Windows
binary for R 4.1), whose older regex parser returns a NULL hostname for
bare-domain URLs, failing test-url.R. Pin the minimum version so a
working httr2 is used.
@schloerke schloerke changed the title chore: temp change to trigger CI Fix failing CI checks: roxygen2 8.0.0 docs, screenshot robustness, Windows timeouts, httr2 >= 1.0.0 Jul 15, 2026
test-app-screenshot-size.R asserts exact 'viewport' screenshot
dimensions equal the window size. On CI runners with classic (non-
overlay) scrollbars -- e.g. macOS GitHub Actions -- the ~15px scrollbars
shrink the captured viewport (e.g. 450x400 -> 435x385), making the test
flaky depending on the runner's scrollbar mode.

Reproduced locally: forcing a 15px scrollbar yields 435x385; forcing a
zero-width scrollbar yields the expected 450x400. Inject
'::-webkit-scrollbar { width: 0; height: 0; }' into the test app so the
viewport is deterministic across platforms. All assertions still pass.
@schloerke
schloerke marked this pull request as ready for review July 15, 2026 18:06
@schloerke
schloerke merged commit 3c31e83 into main Jul 15, 2026
34 of 35 checks passed
@schloerke
schloerke deleted the schloerke/draft-pr-fix-gha branch July 15, 2026 18:06
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.

1 participant