Skip to content
Merged

v1.3.2 #1014

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 1.3.2
Date: 2025-12-22 16:32:13 UTC
SHA: 0adeda804093cfb15d23aaeccae1fee6d29bdc08
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: plumber
Title: An API Generator for R
Version: 1.3.1.9000
Version: 1.3.2
Authors@R: c(
person("Barret", "Schloerke", , "barret@posit.co", role = c("cre", "aut"),
comment = c(ORCID = "0000-0001-9986-114X")),
Expand Down
7 changes: 6 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# plumber (development version)
# plumber 1.3.2

## Bug fixes and minor improvements

* R Markdown include tests now use more robust HTML pattern matching for
image source attributes (#1012).

# plumber 1.3.1

Expand Down
235 changes: 80 additions & 155 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,172 +1,97 @@
## Comments

#### 2025-11
#### 2025-12-22

Dear maintainer,

Please see the problems shown on
cran.r-project.org/web/checks/check_results_plumber.html.
<https://cran.r-project.org/web/checks/check_results_plumber.html>.

Please correct before 2025-12-08 to safely retain your package on CRAN.

Do remember to look at any 'Additional issues'

Packages in Suggests should be used conditionally: see 'Writing R Extensions'.
This needs to be corrected even if the missing package(s) become available.
It can be tested by checking with _R_CHECK_DEPENDS_ONLY_=true.
Please correct before 2026-01-12 to safely retain your package on CRAN.

Best wishes,
The CRAN Team

#### 2024-12-12

Complete output:
> library(testthat)
> library(plumber)
>
> test_check("plumber")
Saving _problems/test-parser-6.R
Saving _problems/test-serializer-htmlwidgets-39.R
<packageNotFoundError in loadNamespace(x): there is no package called 'base64enc'>
<packageNotFoundError in loadNamespace(x): there is no package called 'base64enc'>
Saving _problems/test-tidy-plumber-109.R
<packageNotFoundError in loadNamespace(x): there is no package called 'base64enc'>
Saving _problems/test-tidy-plumber-133.R
Saving _problems/test-zzz-openapi-340.R
Saving _problems/test-zzz-openapi-347.R
[ FAIL 7 | WARN 0 | SKIP 46 | PASS 1750 ]

══ Skipped tests (46) ══════════════════════════════════════════════════════════
• On CRAN (15): 'test-cookies.R:47:3', 'test-deprecated.R:60:3',
'test-find-port.R:40:3', 'test-find-port.R:56:3', 'test-legacy.R:20:3',
'test-options.R:22:3', 'test-plumber-print.R:2:3',
'test-plumber-print.R:60:3', 'test-plumber.R:67:3',
'test-serializer-device.R:26:1', 'test-serializer-htmlwidgets.R:18:3',
'test-static.R:23:3', 'test-zzz-openapi.R:254:3',
'test-zzz-plumb_api.R:10:3', 'test-zzz-plumb_api.R:65:3'
• {arrow} is not installed (5): 'test-parse-body.R:93:3',
'test-parse-body.R:113:3', 'test-serializer-feather.R:4:3',
'test-serializer-feather.R:21:3', 'test-serializer-feather.R:34:3'
• {base64enc} is not installed (9): 'test-cookies.R:113:3',
'test-cookies.R:175:3', 'test-cookies.R:207:3', 'test-cookies.R:265:3',
'test-sessions.R:30:3', 'test-sessions.R:55:3', 'test-sessions.R:86:3',
'test-sessions.R:117:3', 'test-sessions.R:150:3'
• {geojsonsf} is not installed (3): 'test-parse-body.R:164:3',
'test-serializer-geojson.R:2:3', 'test-serializer-geojson.R:24:3'
• {mockery} is not installed (2): 'test-plumber-run.R:45:3',
'test-plumber-run.R:71:3'
• {readr} is not installed (5): 'test-parse-body.R:53:3',
'test-parse-body.R:73:3', 'test-parse-body.R:305:3',
'test-serializer-csv.R:4:3', 'test-serializer-csv.R:26:3'
• {readxl} is not installed (1): 'test-parse-body.R:138:3'
• {rmarkdown} is not installed. (1): 'test-zzzz-include.R:22:3'
• {writexl} is not installed (2): 'test-serializer-excel.R:4:3',
'test-serializer-excel.R:24:3'
• {yaml} is not installed (3): 'test-parse-body.R:46:3',
'test-serializer-yaml.R:4:3', 'test-serializer-yaml.R:26:3'

══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-parser.R:6:5'): parsers can be combined ────────────────────────
Error in `(function (..., sheet = NULL) { if (!requireNamespace("readxl", quietly = TRUE)) { stop("`readxl` must be installed for `parser_excel` to work") } parse_fn <- parser_read_file(function(tmpfile) { if (is.null(sheet)) { sheet <- 1L } else if (anyNA(sheet)) { sheet <- readxl::excel_sheets(tmpfile) } if (is.character(sheet)) names(sheet) <- sheet out <- suppressWarnings(lapply(sheet, function(sht) { readxl::read_excel(path = tmpfile, sheet = sht, ...) })) out }) function(value, ...) { parse_fn(value) } })()`: `readxl` must be installed for `parser_excel` to work
Backtrace:
▆
1. └─plumber (local) expect_parsers(...) at test-parser.R:18:3
2. └─plumber:::make_parser(names) at test-parser.R:6:5
3. └─base::lapply(...)
4. └─plumber (local) FUN(X[[i]], ...)
5. ├─base::do.call(init_parser_func, aliases[[alias]])
6. └─plumber (local) `<fn>`()
7. ├─base::do.call(parser, list(...))
8. └─plumber (local) `<fn>`()
── Error ('test-parser.R:38:3'): parsers work ──────────────────────────────────
Error in `(function (..., sheet = NULL) { if (!requireNamespace("readxl", quietly = TRUE)) { stop("`readxl` must be installed for `parser_excel` to work") } parse_fn <- parser_read_file(function(tmpfile) { if (is.null(sheet)) { sheet <- 1L } else if (anyNA(sheet)) { sheet <- readxl::excel_sheets(tmpfile) } if (is.character(sheet)) names(sheet) <- sheet out <- suppressWarnings(lapply(sheet, function(sht) { readxl::read_excel(path = tmpfile, sheet = sht, ...) })) out }) function(value, ...) { parse_fn(value) } })()`: `readxl` must be installed for `parser_excel` to work
Backtrace:
▆
1. └─plumber::pr(test_path("files/parsers.R")) at test-parser.R:38:3
2. └─Plumber$new(file = file, filters = filters, envir = envir)
3. └─plumber (local) initialize(...)
4. └─plumber:::evaluateBlock(...)
5. └─base::lapply(...)
6. └─plumber (local) FUN(X[[i]], ...)
7. └─PlumberEndpoint$new(...)
8. └─plumber (local) initialize(...)
9. └─plumber:::make_parser(parsers)
1. └─base::lapply(...)
2. └─plumber (local) FUN(X[[i]], ...)
3. ├─base::do.call(init_parser_func, aliases[[alias]])
4. └─plumber (local) `<fn>`()
5. ├─base::do.call(parser, list(...))
6. └─plumber (local) `<fn>`()
── Error ('test-serializer-htmlwidgets.R:37:3'): Errors call error handler ─────
Error: The htmlwidgets package is not available but is required in order to use the htmlwidgets serializer
Backtrace:
▆
1. ├─base::suppressWarnings(...) at test-serializer-htmlwidgets.R:37:3
2. │ └─base::withCallingHandlers(...)
3. └─plumber::serializer_htmlwidget()
── Error ('test-tidy-plumber.R:109:3'): pr_cookie adds cookie ──────────────────
Error in `expect_match(p$call(req)$headers$`Set-Cookie`, "^counter=")`: `object` must be a character vector, not `NULL`.
Backtrace:
▆
1. └─testthat::expect_match(object = p$call(req)$headers$`Set-Cookie`) at test-tidy-plumber.R:109:3
2. └─testthat:::check_character(object)
3. └─testthat:::stop_input_type(...)
4. └─rlang::abort(message, ..., call = call, arg = arg)
── Error ('test-tidy-plumber.R:133:3'): pr_cookie adds path in cookie ──────────
Error in `expect_match(cookie_header1, "^counter=")`: `object` must be a character vector, not `NULL`.
Backtrace:
▆
1. └─testthat::expect_match(object = cookie_header1) at test-tidy-plumber.R:133:3
2. └─testthat:::check_character(object)
3. └─testthat:::stop_input_type(...)
4. └─rlang::abort(message, ..., call = call, arg = arg)
── Error ('test-zzz-openapi.R:340:3'): Response content type set with serializer ──
Error in `serializer_csv()`: `readr` must be installed for `serializer_csv` to work
Backtrace:
▆
1. ├─plumber::pr_get(...) at test-zzz-openapi.R:340:3
2. │ └─plumber::pr_handle(...)
3. │ └─pr$handle(...)
4. │ └─PlumberEndpoint$new(...)
5. │ └─plumber (local) initialize(...)
6. └─plumber::serializer_csv()
── Error ('test-zzz-openapi.R:347:3'): Api spec can be set using a file path ───
Error in `pr$setApiSpec(api = api)`: yaml must be installed to read yaml format
Backtrace:
▆
1. ├─pr() %>% pr_set_api_spec(test_path("files/openapi.yaml")) at test-zzz-openapi.R:347:3
2. └─plumber::pr_set_api_spec(., test_path("files/openapi.yaml"))
3. └─pr$setApiSpec(api = api)

[ FAIL 7 | WARN 0 | SKIP 46 | PASS 1750 ]
Error:
! Test failures.
Execution halted
* checking PDF version of manual ... [14s/18s] OK
* checking HTML version of manual ... [9s/12s] OK
* checking for non-standard things in the check directory ... OK
* checking for detritus in the temp directory ... OK
* DONE

Status: 1 ERROR
See
‘/data/gannet/ripley/R/packages/tests-Suggests/plumber.Rcheck/00check.log’
for details.

#### 2025-12-22

Output from CRAN package checks:

```
CRAN Package Check Results for Package plumber
Last updated on 2025-12-22 15:51:00 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.3.1 12.50 86.23 98.73 OK
r-devel-linux-x86_64-debian-gcc 1.3.1 8.08 62.75 70.83 ERROR
r-devel-linux-x86_64-fedora-clang 1.3.1 22.00 131.83 153.83 OK
r-devel-linux-x86_64-fedora-gcc 1.3.1 24.00 182.79 206.79 OK
r-devel-windows-x86_64 1.3.1 14.00 107.00 121.00 OK
r-patched-linux-x86_64 1.3.1 13.59 77.77 91.36 OK
r-release-linux-x86_64 1.3.0 13.25 78.78 92.03 OK
r-release-macos-arm64 1.3.1 3.00 48.00 51.00 OK
r-release-macos-x86_64 1.3.1 8.00 146.00 154.00 OK
r-release-windows-x86_64 1.3.1 16.00 104.00 120.00 OK
r-oldrel-macos-arm64 1.3.1 3.00 52.00 55.00 OK
r-oldrel-macos-x86_64 1.3.1 9.00 186.00 195.00 OK
r-oldrel-windows-x86_64 1.3.1 19.00 124.00 143.00 OK
Check Details
Version: 1.3.1
Check: tests
Result: ERROR
Running ‘spelling.R’ [0s/0s]
Running ‘testthat.R’ [21s/34s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(plumber)
>
> test_check("plumber")
[ FAIL 1 | WARN 0 | SKIP 15 | PASS 1952 ]

══ Skipped tests (15) ══════════════════════════════════════════════════════════
• On CRAN (15): 'test-cookies.R:41:3', 'test-deprecated.R:60:3',
'test-find-port.R:40:3', 'test-find-port.R:56:3', 'test-legacy.R:20:3',
'test-options.R:22:3', 'test-plumber-print.R:2:3',
'test-plumber-print.R:60:3', 'test-plumber.R:67:3',
'test-serializer-device.R:21:1', 'test-serializer-htmlwidgets.R:20:3',
'test-static.R:23:3', 'test-zzz-openapi.R:302:3',
'test-zzz-plumb_api.R:10:3', 'test-zzz-plumb_api.R:65:3'

══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-zzzz-include.R:34:5'): Includes work ─────────────────────────
Expected `val$body` to match regexp "<html.*<img (role=\"img\" )?src=\"data:image/png;base64.*</html>\\s*$".
Actual text:
✖ │ <!DOCTYPE html>
│
│ <html>
│
│ <head>
│
│ <meta charset="utf-8" />
│ <meta name="generator" content="pandoc" />
│ <meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
│
│
│ <meta name="author" content="Jeff Allen" />
│
│ <meta name="date" content="2015-06-14" />
│
│ <title>test</title>
│
| [...truncated...]


[ FAIL 1 | WARN 0 | SKIP 15 | PASS 1952 ]
Error:
! Test failures.
Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc
```

#### 2024-12-12

A CI check is now being run with your environment variable _R_CHECK_DEPENDS_ONLY_=true set.
I've made the test more robust to different html output formats. No `./R` code has been changed.

Best,
Barret

## R CMD check results

0 errors ✔ | 0 warnings ✔ | 0 notes ✔

## revdepcheck results

We checked 21 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.

* We saw 0 new problems
* We failed to check 0 packages
10 changes: 8 additions & 2 deletions tests/testthat/test-zzzz-include.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ test_that("Includes work", {
if (rmarkdown::pandoc_available()) {
res <- PlumberResponse$new()
val <- r$route(make_req("GET", "/md"), res)
expect_match(val$body, "<html.*<h2>R Output</h2>.*</html>\\s*$")
expect_match(val$body, "<h2>R Output</h2>")
expect_equal(val$headers$`Content-Type`, "text/html; charset=UTF-8")

res <- PlumberResponse$new()
val <- r$route(make_req("GET", "/rmd"), res)
expect_match(val$body, "<html.*<img (role=\"img\" )?src=\"data:image/png;base64.*</html>\\s*$")

# Ex test output received from CRAN
test <- '<p><img role="img" aria-label src="data:image/png;base64,iVBORw0'
expect_match(test, "<img[^>]* src=\"data:image/png;base64")

# Make sure image shows up in response
expect_match(val$body, "<img[^>]* src=\"data:image/png;base64")
expect_equal(val$headers$`Content-Type`, "text/html; charset=UTF-8")
}
})
Loading