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

test failure in round_coordinates() #302

Closed
PietrH opened this issue Apr 10, 2024 · 4 comments · Fixed by #304
Closed

test failure in round_coordinates() #302

PietrH opened this issue Apr 10, 2024 · 4 comments · Fixed by #304
Assignees
Labels
bug Something isn't working

Comments

@PietrH
Copy link
Member

PietrH commented Apr 10, 2024

I'm experiencing CI failures in PR #300

I'm having trouble replicating on my system, this is what the CI reports;

Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
    7. └─camtraptor::round_coordinates(mica2, 3)
    8.   ├─assertthat::assert_that(...) at camtraptor/R/round_coordinates.R:60:5
    9.   │ └─assertthat::see_if(..., env = env, msg = msg)
   10.   └─glue::glue(...) at camtraptor/R/round_coordinates.R:60:5
   11.     └─glue::glue_data(...)
   12.       └─base::lapply(...)
   13.         └─glue (local) FUN(X[[i]], ...)
   14.           ├─eval(call("force", as.symbol(paste0("..", x)))) %||% .null
   15.           ├─base::eval(call("force", as.symbol(paste0("..", x))))
   16.           │ └─base::eval(call("force", as.symbol(paste0("..", x))))
   17.           └─base::force(..4)
  
  [ FAIL 1 | WARN 0 | SKIP 2 | PASS 613 ]
  Error: Test failures
  Execution halted

Failing at:

if (!is.null(original_precision)) {
  original_digits <- -log10(original_precision) # 0.001 -> 3
  assertthat::assert_that(
    digits <= original_digits, # 0.1 > 0.01
    msg = glue::glue(
      "Can't round from {original_digits} to {digits} digits. ",
      "`{original_digits}` is derived from the ",
      "`package$coordinatePrecision={original_precision}`.",
    )
  )
}

if (!is.null(original_precision)) {
original_digits <- -log10(original_precision) # 0.001 -> 3
assertthat::assert_that(
digits <= original_digits, # 0.1 > 0.01
msg = glue::glue(
"Can't round from {original_digits} to {digits} digits. ",
"`{original_digits}` is derived from the ",
"`package$coordinatePrecision={original_precision}`.",
)
)

Runs failing:

Some of the older releases on Ubuntu seem fine...

current head 45b72a2

My system:

─ Session info ──────────────────────────────────────────────────────────
 setting  value
 version  R version 4.2.1 (2022-06-23)
 os       Ubuntu 22.10
 system   x86_64, linux-gnu
 ui       RStudio
 language en_US
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       Europe/Brussels
 date     2024-04-10
 rstudio  2023.12.0+369 Ocean Storm (desktop)
 pandoc   2.17.1.1 @ /usr/bin/pandoc

─ Packages ──────────────────────────────────────────────────────────────
 package     * version date (UTC) lib source
 camtraptor  * 0.25.0  2024-04-10 [1] local
 cli           3.6.2   2023-12-11 [1] CRAN (R 4.2.1)
 crosstalk     1.2.1   2023-11-23 [1] CRAN (R 4.2.1)
 desc          1.4.3   2023-12-10 [1] CRAN (R 4.2.1)
 digest        0.6.35  2024-03-11 [1] CRAN (R 4.2.1)
 dplyr         1.1.4   2023-11-17 [1] CRAN (R 4.2.1)
 fansi         1.0.6   2023-12-08 [1] CRAN (R 4.2.1)
 fastmap       1.1.1   2023-02-24 [1] CRAN (R 4.2.1)
 generics      0.1.3   2022-07-05 [1] CRAN (R 4.2.1)
 glue          1.7.0   2024-01-09 [1] CRAN (R 4.2.1)
 htmltools     0.5.8.1 2024-04-04 [1] CRAN (R 4.2.1)
 htmlwidgets   1.6.4   2023-12-06 [1] CRAN (R 4.2.1)
 leaflet       2.2.2   2024-03-26 [1] CRAN (R 4.2.1)
 lifecycle     1.0.4   2023-11-07 [1] CRAN (R 4.2.1)
 magrittr      2.0.3   2022-03-30 [1] CRAN (R 4.2.1)
 pillar        1.9.0   2023-03-22 [1] CRAN (R 4.2.1)
 pkgconfig     2.0.3   2019-09-22 [1] CRAN (R 4.2.1)
 R6            2.5.1   2021-08-19 [1] CRAN (R 4.2.1)
 rlang         1.1.3   2024-01-10 [1] CRAN (R 4.2.1)
 rstudioapi    0.16.0  2024-03-24 [1] CRAN (R 4.2.1)
 sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.2.1)
 tibble        3.2.1   2023-03-20 [1] CRAN (R 4.2.1)
 tidyselect    1.2.1   2024-03-11 [1] CRAN (R 4.2.1)
 utf8          1.2.4   2023-10-22 [1] CRAN (R 4.2.1)
 vctrs         0.6.5   2023-12-01 [1] CRAN (R 4.2.1)

 [1] /home//R/x86_64-pc-linux-gnu-library/4.2
 [2] /usr/local/lib/R/site-library
 [3] /usr/lib/R/site-library
 [4] /usr/lib/R/library

─────────────────────────────────────────────────────────────────────────
@PietrH PietrH added the bug Something isn't working label Apr 10, 2024
@PietrH
Copy link
Member Author

PietrH commented Apr 10, 2024

This is the test that is failing:

test_that("round_coordinates() does not allow to round to higher precision", {
  mica2 <- round_coordinates(mica, 2)

  # Based on package$coordinatePrecision
  expect_error(
    round_coordinates(mica2, 3),
    paste(
      "Can't round from 2 to 3 digits.",
      "`2` is derived from the `package$coordinatePrecision=0.01`."
    ),
    fixed = TRUE
  )

  # Based on data
  mica2$coordinatePrecision <- NULL
  expect_error(
    round_coordinates(mica2, 3),
    paste(
      "Can't round from 2 to 3 digits.",
      "`2` is the maximum number of decimals for latitude in the data."
    ),
    fixed = TRUE
  )
})

@PietrH
Copy link
Member Author

PietrH commented Apr 10, 2024

Session info of a failing mac os machine (Github Actions CI)

─ Session info ───────────────────────────────────────────────────────────────
   setting  value
   version  R version 4.3.3 (2024-02-29)
   os       macOS Monterey 12.7.4
   system   x86_64, darwin20
   ui       X11
   language (EN)
   collate  en_US.UTF-8
   ctype    en_US.UTF-8
   tz       UTC
   date     2024-04-10
   pandoc   3.1.11 @ /usr/local/bin/pandoc
  ─ Packages ───────────────────────────────────────────────────────────────────
   ! package           * version    date (UTC) lib source
     askpass             1.2.0      2023-09-03 [1] CRAN (R 4.3.0)
     assertthat          0.2.1      2019-03-21 [1] CRAN (R 4.3.0)
     base              * 4.3.3      2024-03-01 [?] local
     base64enc           0.1-3      2015-07-28 [1] CRAN (R 4.3.0)
     bit                 4.0.5      2022-11-15 [1] CRAN (R 4.3.0)
     bit64               4.0.5      2020-08-30 [1] CRAN (R 4.3.0)
     boot                1.3-29     2024-02-19 [3] CRAN (R 4.3.3)
     brio                1.1.4      2023-12-10 [1] CRAN (R 4.3.0)
     bslib               0.7.0      2024-03-29 [1] CRAN (R 4.3.2)
     cachem              1.0.8      2023-05-01 [1] CRAN (R 4.3.0)
     callr               3.7.6      2024-03-25 [1] CRAN (R 4.3.2)
     class               7.3-22     2023-05-03 [3] CRAN (R 4.3.3)
     cli                 3.6.2      2023-12-11 [1] CRAN (R 4.3.0)
     clipr               0.8.0      2022-02-22 [1] CRAN (R 4.3.0)
     cluster             2.1.6      2023-12-01 [3] CRAN (R 4.3.3)
     codetools           0.2-19     2023-02-01 [3] CRAN (R 4.3.3)
     colorspace          2.1-0      2023-01-23 [1] CRAN (R 4.3.0)
   P compiler            4.3.3      2024-03-01 [3] local
     covr                3.6.4      2023-11-09 [1] CRAN (R 4.3.0)
     crayon              1.5.2      2022-09-29 [1] CRAN (R 4.3.0)
     crosstalk           1.2.1      2023-11-23 [1] CRAN (R 4.3.0)
     curl                5.2.1      2024-03-01 [1] CRAN (R 4.3.2)
   P datasets          * 4.3.3      2024-03-01 [3] local
     desc                1.4.3      2023-12-10 [1] CRAN (R 4.3.0)
     diffobj             0.3.5      2021-10-05 [1] CRAN (R 4.3.0)
     digest              0.6.35     2024-03-11 [1] CRAN (R 4.3.2)
     dplyr               1.1.4      2023-11-17 [1] CRAN (R 4.3.0)
     EML                 2.0.6.1    2022-04-28 [1] CRAN (R 4.3.0)
     emld                0.5.1      2020-09-27 [1] CRAN (R 4.3.0)
     evaluate            0.23       2023-11-01 [1] CRAN (R 4.3.0)
     fansi               1.0.6      2023-12-08 [1] CRAN (R 4.3.0)
     farver              2.1.1      2022-07-06 [1] CRAN (R 4.3.0)
     fastmap             1.1.1      2023-02-24 [1] CRAN (R 4.3.0)
     fontawesome         0.5.2      2023-08-19 [1] CRAN (R 4.3.0)
     foreign             0.8-86     2023-11-28 [3] CRAN (R 4.3.3)
     frictionless        1.1.0      2024-03-29 [1] CRAN (R 4.3.2)
     fs                  1.6.3      2023-07-20 [1] CRAN (R 4.3.0)
     generics            0.1.3      2022-07-05 [1] CRAN (R 4.3.0)
     glue                1.7.0      2024-01-09 [1] CRAN (R 4.3.0)
   P graphics          * 4.3.3      2024-03-01 [3] local
   P grDevices         * 4.3.3      2024-03-01 [3] local
     grid                4.3.3      2024-03-01 [?] local
     highr               0.10       2022-12-22 [1] CRAN (R 4.3.0)
     hms                 1.1.3      2023-03-21 [1] CRAN (R 4.3.0)
     htmltools           0.5.8.1    2024-04-04 [1] CRAN (R 4.3.2)
     htmlwidgets         1.6.4      2023-12-06 [1] CRAN (R 4.3.0)
     httr                1.4.7      2023-08-15 [1] CRAN (R 4.3.0)
     jqr                 1.3.3      2023-12-04 [1] CRAN (R 4.3.0)
     jquerylib           0.1.4      2021-04-26 [1] CRAN (R 4.3.0)
     jsonld              2.2        2020-05-27 [1] CRAN (R 4.3.0)
     jsonlite            1.8.8      2023-12-04 [1] CRAN (R 4.3.0)
     KernSmooth          2.23-22    2023-07-10 [3] CRAN (R 4.3.3)
     knitr               1.45       2023-10-30 [1] CRAN (R 4.3.0)
     labeling            0.4.3      2023-08-29 [1] CRAN (R 4.3.0)
     lattice             0.22-5     2023-10-24 [3] CRAN (R 4.3.3)
     lazyeval            0.2.2      2019-03-15 [1] CRAN (R 4.3.0)
     leaflet             2.2.2      2024-03-26 [1] CRAN (R 4.3.2)
     leaflet.providers   2.0.0      2023-10-17 [1] CRAN (R 4.3.0)
     lifecycle           1.0.4      2023-11-07 [1] CRAN (R 4.3.0)
     lubridate           1.9.3      2023-09-27 [1] CRAN (R 4.3.0)
     magrittr            2.0.3      2022-03-30 [1] CRAN (R 4.3.0)
     MASS                7.3-60.0.1 2024-01-13 [3] CRAN (R 4.3.3)
     Matrix              1.6-5      2024-01-11 [3] CRAN (R 4.3.3)
     memoise             2.0.1      2021-11-26 [1] CRAN (R 4.3.0)
   P methods           * 4.3.3      2024-03-01 [3] local
     mgcv                1.9-1      2023-12-21 [3] CRAN (R 4.3.3)
     mime                0.12       2021-09-28 [1] CRAN (R 4.3.0)
     munsell             0.5.1      2024-04-01 [1] CRAN (R 4.3.2)
     nlme                3.1-164    2023-11-27 [3] CRAN (R 4.3.3)
     nnet                7.3-19     2023-05-03 [3] CRAN (R 4.3.3)
     openssl             2.1.1      2023-09-25 [1] CRAN (R 4.3.0)
     pak                 0.7.2      2024-03-27 [2] local
     parallel            4.3.3      2024-03-01 [?] local
     pillar              1.9.0      2023-03-22 [1] CRAN (R 4.3.0)
     pkgbuild            1.4.4      2024-03-17 [1] CRAN (R 4.3.2)
     pkgconfig           2.0.3      2019-09-22 [1] CRAN (R 4.3.0)
     pkgload             1.3.4      2024-01-16 [1] CRAN (R 4.3.0)
     png                 0.1-8      2022-11-29 [1] CRAN (R 4.3.0)
     praise              1.0.0      2015-08-11 [1] CRAN (R 4.3.0)
     prettyunits         1.2.0      2023-09-24 [1] CRAN (R 4.3.0)
     processx            3.8.4      2024-03-16 [1] CRAN (R 4.3.2)
     ps                  1.7.6      2024-01-18 [1] CRAN (R 4.3.0)
     purrr               1.0.2      2023-08-10 [1] CRAN (R 4.3.0)
     R6                  2.5.1      2021-08-19 [1] CRAN (R 4.3.0)
     rappdirs            0.3.3      2021-01-31 [1] CRAN (R 4.3.0)
     raster              3.6-26     2023-10-14 [1] CRAN (R 4.3.0)
     rcmdcheck           1.4.0      2021-09-27 [1] any (@1.4.0)
     RColorBrewer        1.1-3      2022-04-03 [1] CRAN (R 4.3.0)
     Rcpp                1.0.12     2024-01-09 [1] CRAN (R 4.3.0)
     readr               2.1.5      2024-01-10 [1] CRAN (R 4.3.0)
     rematch2            2.1.2      2020-05-01 [1] CRAN (R 4.3.0)
     rex                 1.2.1      2021-11-26 [1] CRAN (R 4.3.0)
     rlang               1.1.3      2024-01-10 [1] CRAN (R 4.3.0)
     rmarkdown           2.26       2024-03-05 [1] CRAN (R 4.3.2)
     rpart               4.1.23     2023-12-05 [3] CRAN (R 4.3.3)
     rprojroot           2.0.4      2023-11-05 [1] CRAN (R 4.3.0)
     sass                0.4.9      2024-03-15 [1] CRAN (R 4.3.2)
     scales              1.3.0      2023-11-28 [1] CRAN (R 4.3.0)
     sessioninfo         1.2.2      2021-12-06 [1] any (@1.2.2)
     sp                  2.1-3      2024-01-30 [1] CRAN (R 4.3.2)
     spatial             7.3-17     2023-07-20 [3] CRAN (R 4.3.3)
     splines             4.3.3      2024-03-01 [?] local
   P stats             * 4.3.3      2024-03-01 [3] local
     stats4              4.3.3      2024-03-01 [?] local
     stringi             1.8.3      2023-12-11 [1] CRAN (R 4.3.0)
     stringr             1.5.1      2023-11-14 [1] CRAN (R 4.3.0)
     survival            3.5-8      2024-02-14 [3] CRAN (R 4.3.3)
     sys                 3.4.2      2023-05-23 [1] CRAN (R 4.3.0)
     tcltk               4.3.3      2024-03-01 [?] local
     terra               1.7-71     2024-01-31 [1] CRAN (R 4.3.2)
     testthat            3.2.1      2023-12-02 [1] CRAN (R 4.3.0)
     tibble              3.2.1      2023-03-20 [1] CRAN (R 4.3.0)
     tidyr               1.3.1      2024-01-24 [1] CRAN (R 4.3.2)
     tidyselect          1.2.1      2024-03-11 [1] CRAN (R 4.3.2)
     timechange          0.3.0      2024-01-18 [1] CRAN (R 4.3.0)
     tinytex             0.50       2024-03-16 [1] CRAN (R 4.3.2)
   P tools               4.3.3      2024-03-01 [3] local
     tzdb                0.4.0      2023-05-12 [1] CRAN (R 4.3.0)
     utf8                1.2.4      2023-10-22 [1] CRAN (R 4.3.0)
   P utils             * 4.3.3      2024-03-01 [3] local
     uuid                1.2-0      2024-01-14 [1] CRAN (R 4.3.0)
     V8                  4.4.2      2024-02-15 [1] CRAN (R 4.3.2)
     vctrs               0.6.5      2023-12-01 [1] CRAN (R 4.3.0)
     viridisLite         0.4.2      2023-05-02 [1] CRAN (R 4.3.0)
     vroom               1.6.5      2023-12-05 [1] CRAN (R 4.3.0)
     waldo               0.5.2      2023-11-02 [1] CRAN (R 4.3.0)
     withr               3.0.0      2024-01-16 [1] CRAN (R 4.3.0)
     xfun                0.43       2024-03-25 [1] CRAN (R 4.3.2)
     xml2                1.3.6      2023-12-04 [1] CRAN (R 4.3.0)
     xopen               1.0.0      2018-09-17 [1] CRAN (R 4.3.0)
     yaml                2.3.8      2023-12-11 [1] CRAN (R 4.3.0)
   [1] /Users/runner/work/_temp/Library
   [2] /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/site-library
   [3] /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library
   P ── Loaded and on-disk path mismatch.
  ──────────────────────────────────────────────────────────────────────────────

@PietrH
Copy link
Member Author

PietrH commented Apr 10, 2024

Possibly related to issue in glue: apache/arrow#40858

@PietrH
Copy link
Member Author

PietrH commented Apr 10, 2024

May be due to trailing commas: tidyverse/glue#320 !

@PietrH PietrH self-assigned this Apr 10, 2024
@PietrH PietrH linked a pull request Apr 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant