-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Release {precommit} 0.4.1 #551
Conversation
5142c21
to
dea123c
Compare
dea123c
to
b8f72d2
Compare
tests/testthat/test-hooks.R
Outdated
@@ -118,7 +118,7 @@ run_test("style-files", | |||
run_test("style-files", | |||
file_name = "style-files-cmd", | |||
suffix = "-success.R", | |||
std_err = "scope must be one", | |||
std_err = ifelse(packageVersion("styler") < package_version("1.10.3"), "scope must be one", "`scope` must be one"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std_err = ifelse(packageVersion("styler") < package_version("1.10.3"), "scope must be one", "`scope` must be one"), | |
std_err = "scope", # wrong scope specified |
Maybe it would be best to change this to only scope. Maybe rlang could change its error messages from rlang::arg_match()
and this would break precommit again.
The tidyverse team advocates not to test error messages from other packages. I guess this applies to packages from the same maintainer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe yeah. So should we just test that there is an error without checking the exact message? Like check for ""
seems to work, NA
and NULL
don't do the trick. 😞
I think to be honest, since the next release is pressing, I'd probably do that now. In the mid to long term, I'd be interested in refactoring the testing infra. Would you be interested in supporting this? I created an issue and outlined how we could start that, shouldn't be too hard after all: #552
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So should we just test that there is an error without checking the exact message
that's the intention of the suggedtion here
I will see, but I was under the expression this was a regex, similar to when you use expect_error()
. my suggestion was to simplify that regex to "scope" to avoid future change in the error message from styler affecting precommit. (mainly to avoid burden for future you)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not a regex, we check if the string is a sub string of the error message, since fixed
is TRUE
. But regardless, we checking for scope
would still work. I just went for the empty sting to eliminate any dependency on the error message. Because testing for scope
still has a dependency, albeit a very minimal one.
Test time needs to be reduced since on r devel for windows, it takes quite long.
they said:
|
The important tests to run on CRAN are those where
We could also activate parallelisation, but the real gains on CRAN would probably be limited then. Testing timing:
While the hook tests are obviously the core, they clearly take the longest and are not susceptible to breaking changes on CRAN, as we are using {renv} for isolation. That may change again in the future though. Probably makes sense to split up hook tests in one per hook file and then parallelise. |
Since {styler} needs to be updated on CRAN due to changes in parser error messages (r-lib/styler#1183), and #1176 breaks {precommit} tests, a new {precommit} release must preceed a new {styler} release.
Prepare for release:
devtools::check_win_devel()
revdepcheck::revdep_check()
cran-comments.md
urlchecker::url_check(".")
Perform release:
devtools::submit_cran()
Wait for CRAN...
NEWS.md
for new features.