-
Notifications
You must be signed in to change notification settings - Fork 286
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
More upkeep polishing #1909
Merged
Merged
More upkeep polishing #1909
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,49 @@ | ||
test_that("tidy upkeep bullets don't change accidentally", { | ||
withr::local_options( | ||
usethis.description = list( | ||
"Authors@R" = utils::person( | ||
"Jane", "Doe", | ||
email = "jane@rstudio.com", | ||
role = c("aut", "cre") | ||
), | ||
License = "MIT + file LICENSE" | ||
) | ||
) | ||
create_local_package() | ||
use_mit_license() | ||
|
||
expect_snapshot( | ||
writeLines(tidy_upkeep_checklist(posit_pkg = TRUE, posit_person_ok = FALSE)), | ||
transform = scrub_checklist_footer | ||
local_mocked_bindings( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I probably should've done this in a separate PR, but using mocking for everything makes the tests quite a bit simpler. |
||
Sys.Date = function() as.Date("2023-01-01"), | ||
usethis_version = function() "1.1.0", | ||
author_has_rstudio_email = function() TRUE, | ||
is_posit_pkg = function() TRUE, | ||
is_posit_person_canonical = function() FALSE | ||
) | ||
|
||
expect_snapshot(writeLines(tidy_upkeep_checklist())) | ||
}) | ||
|
||
test_that("upkeep bullets don't change accidentally",{ | ||
skip_if_no_git_user() | ||
withr::local_options(usethis.description = NULL) | ||
|
||
create_local_package() | ||
local_mocked_bindings(git_default_branch = function() "main") | ||
use_cran_comments() | ||
|
||
expect_snapshot( | ||
writeLines(upkeep_checklist()), | ||
transform = scrub_checklist_footer | ||
local_mocked_bindings( | ||
Sys.Date = function() as.Date("2023-01-01"), | ||
usethis_version = function() "1.1.0", | ||
git_default_branch = function() "main" | ||
) | ||
|
||
expect_snapshot(writeLines(upkeep_checklist())) | ||
|
||
# Add some files to test conditional todos | ||
use_code_of_conduct("jane.doe@foofymail.com") | ||
use_testthat() | ||
withr::local_file("cran-comments.md") | ||
writeLines( | ||
"## Test environments\\n\\n* local Ubuntu\\n\\# R CMD check results\\n", | ||
"cran-comments.md" | ||
) | ||
writeLines("# test environment\n", "cran-comments.md") | ||
local_mocked_bindings(git_default_branch = function() "master") | ||
|
||
expect_snapshot({ | ||
local_edition(2L) | ||
writeLines(upkeep_checklist()) | ||
}, | ||
transform = scrub_checklist_footer | ||
) | ||
}) | ||
}) | ||
|
||
test_that("get extra upkeep bullets works", { | ||
env <- env(upkeep_bullets = function() c("extra", "upkeep bullets")) | ||
expect_equal(upkeep_extra_bullets(env), | ||
c("* [ ] extra", "* [ ] upkeep bullets", "")) | ||
expect_equal( | ||
upkeep_extra_bullets(env), | ||
c("* [ ] extra", "* [ ] upkeep bullets", "") | ||
) | ||
|
||
env <- NULL | ||
expect_equal(upkeep_extra_bullets(env), "") | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Now in upkeep, rather than release.
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.
I kinda like it as part of the release checklist, but not a hill I will die on.
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.
I don't have strong feelings either except that it should be in one or the other.