Skip to content

fix: Skip tests if suggested packages aren't available#432

Merged
cpsievert merged 4 commits intomainfrom
fix/skip-tests-without-curl
Mar 11, 2026
Merged

fix: Skip tests if suggested packages aren't available#432
cpsievert merged 4 commits intomainfrom
fix/skip-tests-without-curl

Conversation

@cpsievert
Copy link
Contributor

Summary

  • curl is in Suggests, but library(curl) was called unconditionally in tests/testthat/helper-app.R, causing the entire test suite to fail when curl is not available (e.g. in the check-depends-only CI job)
  • The helper now loads curl conditionally with requireNamespace()
  • The 4 test files that depend on curl (test-app, test-http-parse, test-static-paths, test-static-server) skip when curl is not installed
  • The remaining 3 test files (test-utils, test-traffic, test-frame-completion) run regardless

Test plan

  • CI check-depends-only job passes
  • All other CI jobs maintain the same pass/skip/fail counts

🤖 Generated with Claude Code

cpsievert and others added 3 commits March 10, 2026 15:06
curl is in Suggests, but library(curl) was called unconditionally in the
test helper, causing the entire test suite to fail when curl is not
available (e.g. in check-depends-only CI jobs).

Now the helper loads curl conditionally, and the 4 test files that
depend on curl skip when it's not installed. The remaining 3 test files
(test-utils, test-traffic, test-frame-completion) run regardless.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of loading curl in the shared helper (which runs for all tests),
use curl:: namespace qualification in helper-app.R and move
library(curl) into each test file that needs it (after
skip_if_not_installed).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts the test suite and supporting helpers so that optional Suggests dependencies (notably curl) don’t cause the full testthat run to fail in minimal-install CI jobs (e.g. check-depends-only).

Changes:

  • Skip curl-dependent test files when curl isn’t installed, and explicitly attach curl in those files when available.
  • Remove unconditional library(curl) from the shared test helper and fully-qualify curl calls.
  • Regenerate documentation and metadata updates (plus an added skip for missing websocket).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/testthat/test-static-server.R Skips this test file if curl isn’t installed; attaches curl when present.
tests/testthat/test-static-paths.R Skips this test file if curl isn’t installed; attaches curl when present.
tests/testthat/test-http-parse.R Skips this test file if curl isn’t installed; attaches curl when present.
tests/testthat/test-app.R Skips this test file if curl isn’t installed; attaches curl when present.
tests/testthat/test-frame-completion.R Skips websocket-dependent test when websocket isn’t installed.
tests/testthat/helper-app.R Removes unconditional curl attach; uses curl::-qualified calls in helper functions.
man/runStaticServer.Rd Updates generated examples wrapper in documentation.
DESCRIPTION Bumps RoxygenNote.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cpsievert cpsievert changed the title fix: Skip tests that require curl when it's not installed fix: Skip tests if suggested packages aren't available Mar 11, 2026
@cpsievert cpsievert merged commit 267b1df into main Mar 11, 2026
30 checks passed
@cpsievert cpsievert deleted the fix/skip-tests-without-curl branch March 11, 2026 16:46
cpsievert added a commit that referenced this pull request Mar 17, 2026
)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cpsievert added a commit that referenced this pull request Mar 17, 2026
) (#434)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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