Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_quantity unit tests fail on R 4.0 devel #377

Closed
adokter opened this issue Apr 30, 2020 · 3 comments
Closed

get_quantity unit tests fail on R 4.0 devel #377

adokter opened this issue Apr 30, 2020 · 3 comments

Comments

@adokter
Copy link
Owner

adokter commented Apr 30, 2020

The following lines do not pass:

test_that("get_quantity.vpts() return a matrix for all 16 quantities", {
expect_equal(class(get_quantity(vpts, "dens")), "matrix")
expect_equal(class(get_quantity(vpts, "u")), "matrix")
expect_equal(class(get_quantity(vpts, "v")), "matrix")
expect_equal(class(get_quantity(vpts, "w")), "matrix")
expect_equal(class(get_quantity(vpts, "ff")), "matrix")
expect_equal(class(get_quantity(vpts, "dd")), "matrix")
expect_equal(class(get_quantity(vpts, "sd_vvp")), "matrix")
expect_equal(class(get_quantity(vpts, "gap")), "matrix")
expect_equal(class(get_quantity(vpts, "dbz")), "matrix")
expect_equal(class(get_quantity(vpts, "eta")), "matrix")
expect_equal(class(get_quantity(vpts, "dens")), "matrix")
expect_equal(class(get_quantity(vpts, "DBZH")), "matrix")
expect_equal(class(get_quantity(vpts, "n")), "matrix")
expect_equal(class(get_quantity(vpts, "n_all")), "matrix")
expect_equal(class(get_quantity(vpts, "n_dbz")), "matrix")
expect_equal(class(get_quantity(vpts, "n_dbz_all")), "matrix")
})

rhub::check_with_rdevel() gives:

check_with_rdevel()
─  Building package
─  Uploading package
─  Preparing build, see status at
   https://builder.r-hub.io/status/bioRad_0.5.1.9344.tar.gz-0f14ac1d66f4425fbf522f288feeda02
─  Build started
─  Downloading and unpacking package file
─  Querying system requirements
─  Installing system requirements
─  Starting Docker container
─  Querying package dependencies
─  Installing package dependencies
─  Running R CMD check
   About to run xvfb-run R CMD check bioRad_0.5.1.9344.tar.gz
─  using log directory ‘/home/docker/bioRad.Rcheck’
─  using R Under development (unstable) (2020-04-26 r78302)
─  using platform: x86_64-pc-linux-gnu (64-bit)
─  using session charset: UTF-8
✓  checking for file ‘bioRad/DESCRIPTION’
─  this is package ‘bioRad’ version ‘0.5.1.9344’
─  package encoding: UTF-8
✓  checking package namespace information
✓  checking package dependencies (2.6s)
✓  checking if this is a source package
✓  checking if there is a namespace
✓  checking for executable files (2.6s)
✓  checking for hidden files and directories
✓  checking for portable file names
✓  checking for sufficient/correct file permissions
✓  checking whether package ‘bioRad’ can be installed (21.3s)
N  checking installed package size
     installed size is  5.7Mb
     sub-directories of 1Mb or more:
       data      1.6Mb
       doc       1.2Mb
       extdata   1.7Mb
✓  checking package directory
✓  checking ‘build’ directory
✓  checking DESCRIPTION meta-information (2.7s)
✓  checking top-level files
✓  checking for left-over files
✓  checking index information
✓  checking package subdirectories
✓  checking R files for non-ASCII characters
✓  checking R files for syntax errors
✓  checking whether the package can be loaded (5.2s)
✓  checking whether the package can be loaded with stated dependencies (2.9s)
✓  checking whether the package can be unloaded cleanly (6s)
✓  checking whether the namespace can be loaded with stated dependencies (2.6s)
✓  checking whether the namespace can be unloaded cleanly (5.6s)
✓  checking loading without being on the library search path (2.8s)
✓  checking dependencies in R code (5.6s)
✓  checking S3 generic/method consistency (7.6s)
✓  checking replacement functions (5.2s)
✓  checking foreign function calls (5.2s)
✓  checking R code for possible problems (21.4s)
✓  checking Rd files
✓  checking Rd metadata
✓  checking Rd cross-references (2.5s)
✓  checking for missing documentation entries (2.8s)
✓  checking for code/documentation mismatches (13.8s)
✓  checking Rd \usage sections (7.7s)
✓  checking Rd contents
✓  checking for unstated dependencies in examples (2.7s)
✓  checking contents of ‘data’ directory
✓  checking data for non-ASCII characters
✓  checking data for ASCII and uncompressed saves
✓  checking installed files from ‘inst/doc’
✓  checking files in ‘vignettes’
✓  checking examples (38.2s)
✓  checking for unstated dependencies in ‘tests’
─  checking tests
E  Running ‘testthat.R’ (46.7s)
   Running the tests in ‘tests/testthat.R’ failed.
   Last 13 lines of output:
     ══ testthat results  ═══════════════════════════════════════════════════════════
     [ OK: 282 | SKIPPED: 38 | WARNINGS: 4 | FAILED: 17 ]
     1. Failure: get_quantity.vpts() return a matrix for all 16 quantities (@test-get_quantity.R#104) 
     2. Failure: get_quantity.vpts() return a matrix for all 16 quantities (@test-get_quantity.R#105) 
     3. Failure: get_quantity.vpts() return a matrix for all 16 quantities (@test-get_quantity.R#106) 
     4. Failure: get_quantity.vpts() return a matrix for all 16 quantities (@test-get_quantity.R#107) 
     5. Failure: get_quantity.vpts() return a matrix for all 16 quantities (@test-get_quantity.R#108) 
     6. Failure: get_quantity.vpts() return a matrix for all 16 quantities (@test-get_quantity.R#109) 
     7. Failure: get_quantity.vpts() return a matrix for all 16 quantities (@test-get_quantity.R#110) 
     8. Failure: get_quantity.vpts() return a matrix for all 16 quantities (@test-get_quantity.R#111) 
     9. Failure: get_quantity.vpts() return a matrix for all 16 quantities (@test-get_quantity.R#112) 
     1. ...
     
     Error: testthat unit tests failed
     Execution halted
✓  checking for unstated dependencies in vignettes
✓  checking package vignettes in ‘inst/doc’
─  checking running R code from vignettes
     ‘bioRad.Rmd’ using ‘UTF-8’... OK
     ‘rad_aero_19.Rmd’ using ‘UTF-8’... OK
     ‘range_correction.Rmd’ using ‘UTF-8’... OK
    NONE
✓  checking re-building of vignette outputs (45.7s)
✓  checking PDF version of manual (5.1s)
   
─  Done with R CMD check
─  Saving artifacts
@peterdesmet
Copy link
Collaborator

Seems to be caused by tidymodels/recipes#422, where class() is now returning a vector with 2 instead of 1 value: "matrix" "array"

We could do:

expect_equal(class(get_quantity(vpts, "height"))[1], "matrix")

But the referenced page suggest to use is() and no longer class(). So:

expect_true(is(get_quantity(vpts, "height"), "matrix"))

@peterdesmet
Copy link
Collaborator

See #379.

@adokter
Copy link
Owner Author

adokter commented May 1, 2020

closed by #379

@adokter adokter closed this as completed May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants