Fix failing CI checks: roxygen2 8.0.0 docs, screenshot robustness, Windows timeouts, httr2 >= 1.0.0 - #450
Merged
Merged
Conversation
… schloerke/draft-pr-fix-gha
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.
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
marked this pull request as ready for review
July 15, 2026 18:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.0roxygen2 8.0.0 validates and re-renders R6 method
@examplesinto the reference page's\preformatted{}blocks. Three constructs inAppDriver's examples produced malformed Rd (unexpected macro '\if'), breakingpkgdown::build_reference_index()and R CMD check:•and ellipsis…. Replaced with*and....\{ … \}.DESCRIPTIONnow recordsConfig/roxygen2/version: 8.0.0andman/is regenerated.2.
#greenscreenshot tests (ubuntu / macOS)test-app-image.R's two#greenexpectations used the defaultthreshold = NULL, which makesexpect_screenshot()a byte-level comparison. The#greenbox 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 despitescreenshot_max_difference()being0. Passthreshold = 10to use the pixel-convolution path.3.
check-depends-onlyThe
thresholdcomparison reads pixels via{png}(a Suggests dependency), absent when checking with dependencies only. Addedskip_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_timeoutcaused flakyShiny app did not become stable/Timed out waiting for JavaScript script to return trueerrors that varied across runs and R versions. Addedtests/testthat/setup-ci-timeouts.RraisingSHINYTEST2_LOAD_TIMEOUT(60s) andSHINYTEST2_TIMEOUT(20s) on CI via environment variables, so child R processes launched bycallr::rscript()inherit them too.5.
test-url.Ron R 4.1 —httr2 (>= 1.0.0)The
Urlhelper relies onhttr2::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 aNULLhostname for bare-domain URLs. Pinned the minimum version.Verification
pkgdown::build_reference_index()emits 0 warnings;tools::parse_Rd()is clean for allman/*.Rd; ubuntu/macOS/Windows R-CMD-check andtest-actionsare green in CI.