ropensci / awardFindR

Scan multiple online grant databases for relevant awards
https://docs.ropensci.org/awardFindR
Other
16 stars 7 forks source link

test failure #29

Closed maelle closed 1 year ago

maelle commented 2 years ago

:wave: here!

Via https://ropensci.r-universe.dev/ui#builds= and locally I see

Failure (test-ophil.R:6:3): Expected results
nrow(ophil) (`actual`) not equal to 4 (`expected`).

`actual` is NULL
`expected` is a double vector (4)

Happy to help if needed!

maelle commented 1 year ago

@mccallc @adam3smith Friendly reminder :smile_cat:

mccallc commented 1 year ago

Thanks for the report! I have been working on a rewrite of the module for open philosophy, they changed their web interface and that caused this issue. Will be done soon.

mccallc commented 1 year ago

This has been fixed in commit 966b7a560db9486a2db1d8482fb46be3c92b526a.

maelle commented 1 year ago

Thanks!

Locally I don't get failures and I see on GHA all goes well but I still see failures in https://github.com/r-universe/ropensci/runs/8200257159?check_suite_focus=true, weird Are tests skipped for CRAN?

mccallc commented 1 year ago

I'm having a hard time decoding exactly what went wrong in this test process, and I can't seem to reproduce it myself.

Based on the guidelines at https://books.ropensci.org/http-testing/cran-preparedness.html#skipping-all-tests-on-cran , should I just set all tests to skip on CRAN?

maelle commented 1 year ago

do the tests need some sort of authentication?

maelle commented 1 year ago

as noted in the link above skipping tests on CRAN is fine. it's useful to have a scheduled run of R CMD check on GitHub Actions.

maelle commented 1 year ago

From the log I see a more precise error

2022-09-12T10:50:00.6166000Z ── Error (test-loop.R:7:3): NIH and NSF multiple page query ────────────────────
2022-09-12T10:50:00.6167560Z Error in `expect_compare(">", act, exp)`: Result of comparison must be a single logical value
2022-09-12T10:50:00.6167900Z Backtrace:
2022-09-12T10:50:00.6168170Z     ▆
2022-09-12T10:50:00.6168750Z  1. └─testthat::expect_gt(nrow(nsf), 25) at test-loop.R:7:2
2022-09-12T10:50:00.6169310Z  2.   └─testthat:::expect_compare(">", act, exp)
2022-09-12T10:50:00.6169960Z  3.     └─rlang::abort("Result of comparison must be a single logical value")
2022-09-12T10:50:00.6170700Z ── Error (test-neh.R:4:2): NEH returns expected results ────────────────────────
2022-09-12T10:50:00.6171800Z Error in `utils::unzip(zip_path, list = TRUE)`: zip file '/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/RtmpTBasjc/file1db43a176c93' cannot be opened
2022-09-12T10:50:00.6172190Z Backtrace:
2022-09-12T10:50:00.6172420Z      ▆
2022-09-12T10:50:00.6172920Z   1. ├─base::suppressMessages(...) at test-neh.R:4:1
2022-09-12T10:50:00.6173430Z   2. │ └─base::withCallingHandlers(...)
2022-09-12T10:50:00.6173900Z   3. ├─vcr::use_cassette(...)
2022-09-12T10:50:00.6174290Z   4. │ └─cassette$call_block(...)
2022-09-12T10:50:00.6174850Z   5. ├─awardFindR:::.standardize_neh(...) at test-neh.R:5:3
2022-09-12T10:50:00.6175300Z   6. │ └─base::lapply(...)
2022-09-12T10:50:00.6175740Z   7. │   └─awardFindR (local) FUN(X[[i]], ...)
2022-09-12T10:50:00.6176240Z   8. │     └─readxl::read_xlsx(xlsx_path)
2022-09-12T10:50:00.6176720Z   9. │       └─readxl:::read_excel_(...)
2022-09-12T10:50:00.6177220Z  10. │         ├─readxl:::set_readxl_names(...)
2022-09-12T10:50:00.6177810Z  11. │         │ └─tibble::as_tibble(l, .name_repair = .name_repair)
2022-09-12T10:50:00.6178280Z  12. │         └─readxl (local) read_fun(...)
2022-09-12T10:50:00.6178680Z  13. └─readxl (local) `<fn>`(...)
2022-09-12T10:50:00.6179170Z  14.   └─utils::unzip(zip_path, list = TRUE)
2022-09-12T10:50:00.6179340Z 
2022-09-12T10:50:00.6179530Z [ FAIL 2 | WARN 0 | SKIP 0 | PASS 19 ]
maelle commented 1 year ago

Not necessarily related but it might be safer to switch to JSON vcr cassettes.

maelle commented 1 year ago

I've launched the check on R-hub just to see what happens there and it seems ok so feel free to ignore. However #34 might be more problematic.

mccallc commented 1 year ago

tests shouldn't require any authentication. This repository doesn't have any secrets.

all tests have are now skipped on CRAN, and I checked that this works on rhub.

Also switched to json vcr cassettes.

mccallc commented 1 year ago

not sure the best way to address this error: https://github.com/r-universe/ropensci/actions/runs/3064283863/jobs/4947243022

do I need to include buildtools somewhere?

maelle commented 1 year ago

All awardFindR icons are now green on https://ropensci.r-universe.dev/ui#builds (so I guess it was just a matter of waiting/retrying?) -- thank you and well done!