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

Skipping overhaul #1761

Merged
merged 10 commits into from
Apr 5, 2023
Merged

Skipping overhaul #1761

merged 10 commits into from
Apr 5, 2023

Conversation

hadley
Copy link
Member

@hadley hadley commented Mar 29, 2023

@DavisVaughan @jennybc no need for a detailed review, but I'd love your thoughts on how the tests look now, and if you see any other obvious low hanging fruit.

* Use `IS_BIOC_BUILD_MACHINE` for `skip_on_bioc()`. Fixes #1712.
* `skip()` gains default message. Fixes #1586
* Overhaul testing and get as close as possible to 100% test coverage.
* Replace mockery with `local_mocked_bindings()`.
* Move superseded skips to own doc.
NEWS.md Outdated Show resolved Hide resolved
R/expect-self-test.R Outdated Show resolved Hide resolved
@@ -48,7 +48,7 @@
#' expect_equal(1, 2) # this one skipped
#' expect_equal(1, 3) # this one is also skipped
#' })
skip <- function(message) {
skip <- function(message = "Skipping") {
Copy link
Member

Choose a reason for hiding this comment

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

I don't love providing a default message, I feel like if you call skip() then you should justify yourself with a good message

I don't feel extremely strong about this though

R/skip.R Outdated Show resolved Hide resolved
R/skip.R Show resolved Hide resolved
tests/testthat/test-skip.R Outdated Show resolved Hide resolved
R/skip.R Outdated
Comment on lines 125 to 129
if (!has_internet(host)) {
skip("offline")
} else {
invisible()
}
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick, but I try to avoid negating the condition when I can.

Suggested change
if (!has_internet(host)) {
skip("offline")
} else {
invisible()
}
if (has_internet(host)) {
invisible()
} else {
skip("offline")
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Given that we already have the skip_if() and skip_if_not() helpers that do this, I just refactored to use them in more places.

R/skip.R Show resolved Hide resolved
@hadley hadley merged commit 95635f6 into main Apr 5, 2023
@hadley hadley deleted the skip-updates branch April 5, 2023 21:20
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.

Use IS_BIOC_BUILD_MACHINE rather than BBS_HOME in skip_on_bioc() skip() without message
3 participants