Another round of automated checks has failed on CRAN, meaning we need to update by 2023-03-11 to keep {galah} on CRAN. Issue is:
── Failure ('test-international-Sweden.R:60'): search_all(fields)
works for Sweden ──
nrow(x) is not more than 1. Difference: -1
── Error ('test-international-Sweden.R:73'): show_values works for
Sweden ──────
Error in `if (!(field %in% show_all_fields()$id)) {
bullets <- c("Unknown field detected.", i = "Search for the valid
name of a desired field with `search_fields()`.")
abort(bullets, call = caller_env())
}`: argument is of length zero
Backtrace:
▆
1. ├─vcr::use_cassette(...) at test-international-Sweden.R:73:2
2. │ └─cassette$call_block(...)
3. └─galah::show_values(search_fields("basisOfRecord")) at
test-international-Sweden.R:74:4
4. ├─base::do.call(paste0("show_values_", type), args)
5. └─galah:::show_values_field(field = NULL)
What appears to be happening here is:
Sweden API goes down (this time; the principle is the same for other systems)
The call search_fields("basisOfRecord") |> show_values() is not cached correctly by var::use_cassette for some reason
show_all_values() doesn't error (correct behaviour), but also doesn't return useful information
show_values() fails noisily, despite not calling an API at all
Some potential solutions:
make show_values() fail more quietly when incorrect information is provided
make the failing tests conditional on a non-NULL result from show_all(values)
cache more show_all(fields) calls (currently only done for ALA and GBIF)
run more tests without internet to catch odd behaviour
Another round of automated checks has failed on CRAN, meaning we need to update by 2023-03-11 to keep {galah} on CRAN. Issue is:
What appears to be happening here is:
search_fields("basisOfRecord") |> show_values()
is not cached correctly byvar::use_cassette
for some reasonshow_all_values()
doesn't error (correct behaviour), but also doesn't return useful informationshow_values()
fails noisily, despite not calling an API at allSome potential solutions:
show_values()
fail more quietly when incorrect information is providedNULL
result fromshow_all(values)
show_all(fields)
calls (currently only done for ALA and GBIF)testthat::skip_on_cran