10000 Update tests to use the 3rd edition of testthat by kelly-sovacool · Pull Request #298 · SchlossLab/mikropml · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update tests to use the 3rd edition of testthat #298

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

Merged
merged 17 commits into from
Jul 25, 2022
Merged

Conversation

kelly-sovacool
Copy link
Member
@kelly-sovacool kelly-sovacool commented Jun 30, 2022

https://testthat.r-lib.org/articles/third-edition.html

Change(s) made

  • Specified testthat 3e in DESCRIPTION
  • Made minor tweaks to the tests to be compatible with testthat 3e.
  • Checks were failing because gtools became orphaned, but that has now been fixed.

Checklist

(Strikethrough any points that are not applicable.)

  • [ ] Write unit tests for any new functionality or bug fixes.
  • [ ] Update docs if there are any API changes:
    • [ ] roxygen comments
    • [ ] vignettes
  • [ ] Update NEWS.md if this includes any user-facing changes.
  • The check workflow succeeds on your most recent commit. This is always required before the PR can be merged.

expect_message returns the message object now,
so expectations like expect_equal have to be
nested inside it in order to work.
instead of expect_equivalent().
Also, handle multiple deprecation warnings.
@kelly-sovacool kelly-sovacool changed the title Update to use the 3rd edition of testthat Update tests to use the 3rd edition of testthat Jun 30, 2022
@kelly-sovacool
Copy link
Member Author
kelly-sovacool commented Jun 30, 2022

The check is throwing a warning because gtools is an orphaned package, and one of mikropml's indirectly depends on it -- I think the root package is BayesFactor. Waiting on them to submit a new release to CRAN richarddmorey/BayesFactor#161

@kelly-sovacool
Copy link
Member Author
kelly-sovacool commented Jul 7, 2022

I determined which mikropml dependencies depend on gtools with:

mikropml_deps <- tools::package_dependencies(packages = 'mikropml', 
                                                 recursive = TRUE)$mikropml %>% 
    sort()
all_deps <- tools::package_dependencies(packages = mikropml_deps, 
                                        recursive = TRUE)
deps_tbl <- tibble::tibble(Package=names(all_deps), 
                   data=purrr::map(all_deps, tibble::as_tibble)) %>% 
  tidyr::unnest(data)
deps_tbl %>% dplyr::filter(value == 'gtools') %>% knitr::kable()
Package value
gplots gtools
MLmetrics gtools
ROCR gtools

gplots depends on gtools, while ROCR depends on gplots and MLmetrics depends on ROCR. So gplots is the root cause. I opened an issue here: talgalili/gplots#11

@kelly-sovacool
Copy link
Member Author

For future reference, pak::pkg_deps_tree('mikropml') prints a pretty tree of package dependencies, which makes it easier to trace the cause of an indirect dependency issue.

@kelly-sovacool
Copy link
Member Author

macOS devel seems to be failing due to an error beyond our control. I think we can move forward with this as-is.

@kelly-sovacool kelly-sovacool requested review from a team and sklucas and removed request for a team July 13, 2022 20:34
@kelly-sovacool kelly-sovacool merged commit 47adbdc into main Jul 25, 2022
@kelly-sovacool kelly-sovacool deleted the testthat-3e branch July 25, 2022 17:59
@courtneyarmour courtneyarmour self-assigned this Jul 25, 2022
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

Successfully merging this pull request may close these issues.

3 participants
0