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

Use testthat 3 + remove deprecated features #577

Merged
merged 9 commits into from
Nov 27, 2024
Merged

Conversation

olivroy
Copy link
Contributor

@olivroy olivroy commented Nov 26, 2024

Summary

Turns out this was much more work than I imagined

  • Convert to testthat 3
    • Get rid of expect_equivalent() (various solutions were needed here, such as creating expect_equal_unlist() that is equivalent to expect_equal(unlist(object), expected), use ignore_attr
    • Use a snapshot test to capture many warnings
    • Change order of operations to account for breaking change in testthat 3.1
    • Use expect_s3_class() and expect_type() instead of expect_is()
  • Use tidyselect::all_of() instead of superseded one_of()
  • Get rid of a partial match issue
  • Use parallel tests
  • Use expect_no_*() instead of expect_*(regexp = NA)
  • Use testthat::test_path() to facilitate running tests interactively.
  • Avoid dplyr superseded function
  • Remove rlang deprecation warning

Also a reminder that to unlock the coverage action, you will have to add a Codecov token

Other minor cleanup

Checklist

… ignoring whether the object is a list

* Revert order of `expect_warning()` / `expect_message()` to be compliant with testthat 3e https://www.tidyverse.org/blog/2021/10/testthat-3-1/#breaking-changes

*
More expect_equal_unlist()
Remove local_edition(3)
* use `ignore_attr = TRUE` in some cases
* Use expect_null()
* Use multiple expect_equal() to avoid unused argument warning
@olivroy olivroy changed the title Use testthat 3 Use testthat 3 + remove deprecated features Nov 26, 2024
@olivroy
Copy link
Contributor Author

olivroy commented Nov 26, 2024

@rich-iannone sorry for the many follow-up commits. Now ready for review!

@rich-iannone
Copy link
Member

This is great @olivroy ! Thanks so much for taking the time for all these fixes :)

@yjunechoe I also invited you to take a look at the changes if you're up for it.

rich-iannone
rich-iannone previously approved these changes Nov 26, 2024
Copy link
Member

@rich-iannone rich-iannone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and thanks so much!

Copy link
Collaborator

@yjunechoe yjunechoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful! The deprecation warnings were a headache to track down, so I'm very happy to see them resolved

All tests continue to pass when I test on my end, so LGTM as well!

@rich-iannone
Copy link
Member

@olivroy it seems like the empty commit trick didn't fix the hanging check of the branch status. Maybe we wait another day for this to (hopefully) update?

@olivroy

This comment was marked as resolved.

@rich-iannone
Copy link
Member

I don't have a way through the GitHub UI. And I tried through GH Mobile but it's the same hanging state. I might work itself out in time. Worst case scenario is you make another PR with the same changes.

@rich-iannone
Copy link
Member

That worked!

@rich-iannone
Copy link
Member

Alright! After CI runs, I'll merge!

@olivroy
Copy link
Contributor Author

olivroy commented Nov 27, 2024

I just did

gert::git_reset_soft("HEAD~3")
gert::git_commit_all("commit to unstale branch")
gert::git_push(force = TRUE)

and it worked! guess GitHub didn't like removing a commit, but doesn't mind combining into many. The commits are less informative now, but it is fine since you both reviewed it already!)

@rich-iannone rich-iannone merged commit f1b523f into rstudio:main Nov 27, 2024
12 checks passed
@rich-iannone
Copy link
Member

Thanks again @olivroy for modernizing the codebase. I will add a CodeCov token soon!

@olivroy olivroy deleted the test branch November 27, 2024 16:02
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