nflverse / nflfastR

A Set of Functions to Efficiently Scrape NFL Play by Play Data
https://www.nflfastr.com/
Other
414 stars 50 forks source link

[BUG] CRAN test failure. #448

Closed trivialfis closed 9 months ago

trivialfis commented 9 months ago

Is there an existing issue for this?

Have you installed the latest development version of the package(s) in question?

If this is a data issue, have you tried clearing your nflverse cache?

I have cleared my nflverse cache and the issue persists.

What version of the package do you have?

4.6.0

Describe the bug

We {xgboost} summited an update to CRAN, {nflfastR} is part of the reverse dependency check and it failed, the log is here:

https://win-builder.r-project.org/incoming_pretest/xgboost_1.7.6.1_20231205_193653/reverseDependencies/summary.txt

We proceeded with the submission since the failure is not related to xgboost, but I think it's probably a good idea to share the failure here as well.

copy and paste in case of expiration:

Package: nflfastR
Check: tests
New result: ERROR
    Running ‘testthat.R’ [3s/3s]
  Running the tests in ‘tests/testthat.R’ failed.
  Complete output:
    > # This file is part of the standard setup for testthat.
    > # It is recommended that you do not modify it.
    > #
    > # Where should you do additional test configuration?
    > # Learn more about the roles of various files in:
    > # * https://r-pkgs.org/tests.html
    > # * https://testthat.r-lib.org/reference/test_package.html#special-files
    > 
    > library(testthat)
    > library(nflfastR)
    > 
    > test_check("nflfastR")
    Error in `FUN()`:
    ! In path: "/home/hornik/tmp/CRAN/nflfastR.Rcheck/tests/testthat/setup.R"
    Caused by error in `if (any(cpu_check != 0)) ...`:
    ! missing value where TRUE/FALSE needed
    Backtrace:
         ▆
      1. ├─testthat::test_check("nflfastR")
      2. │ └─testthat::test_dir(...)
      3. │   └─testthat:::test_files(...)
      4. │     └─testthat:::test_files_serial(...)
      5. │       └─testthat:::test_files_setup_state(...)
      6. │         └─testthat::source_test_setup(".", env)
      7. │           └─testthat::source_dir(path, "^setup.*\\.[rR]$", env = env, wrap = FALSE)
      8. │             └─base::lapply(...)
      9. │               └─testthat (local) FUN(X[[i]], ...)
     10. │                 └─testthat::source_file(path, env = env, chdir = chdir, wrap = wrap)
     11. │                   ├─base::withCallingHandlers(...)
     12. │                   └─base::eval(exprs, env)
     13. │                     └─base::eval(exprs, env)
     14. └─base::.handleSimpleError(...) at tests/testthat/setup.R:17:1
     15.   └─testthat (local) h(simpleError(msg, call))
     16.     └─rlang::abort(...)
    Execution halted

Cheers! Jiaming

Reprex

NA

Expected Behavior

No failure.

nflverse_sitrep

NA

Screenshots

No response

Additional context

No response

mrcaseb commented 9 months ago

This is related to the following code

cpu_check <- as.numeric(
  c(
    Sys.getenv("_R_CHECK_EXAMPLE_TIMING_CPU_TO_ELAPSED_THRESHOLD_", unset = 0),
    Sys.getenv("_R_CHECK_TEST_TIMING_CPU_TO_ELAPSED_THRESHOLD_", unset = 0)
  )
)
if (any(cpu_check != 0)){...}

Seems like CRAN is really setting at least one of those env vars to NA