fix: Skip tests if suggested packages aren't available#432
Merged
Conversation
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>
cpsievert
commented
Mar 10, 2026
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>
There was a problem hiding this comment.
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 whencurlisn’t installed, and explicitly attachcurlin those files when available. - Remove unconditional
library(curl)from the shared test helper and fully-qualifycurlcalls. - 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
added a commit
that referenced
this pull request
Mar 17, 2026
cpsievert
added a commit
that referenced
this pull request
Mar 17, 2026
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.
Summary
curlis inSuggests, butlibrary(curl)was called unconditionally intests/testthat/helper-app.R, causing the entire test suite to fail when curl is not available (e.g. in thecheck-depends-onlyCI job)requireNamespace()test-app,test-http-parse,test-static-paths,test-static-server) skip when curl is not installedtest-utils,test-traffic,test-frame-completion) run regardlessTest plan
check-depends-onlyjob passes🤖 Generated with Claude Code