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

tests: clean up, simplify tests #716

Merged
merged 17 commits into from
Oct 2, 2023
Merged

tests: clean up, simplify tests #716

merged 17 commits into from
Oct 2, 2023

Conversation

maelle
Copy link
Member

@maelle maelle commented Oct 2, 2023

Fix #695
Part of #714

  • Breaking up tests into paragraphs or even more tests;
  • Removing the variants and the version skips that are outdated;
  • Using testthat for mocking;
  • Not using expect_snapshot_error(;
  • Making all test switches' names start with FLEDGE_;
  • Use the internal local helper everywhere.

@@ -206,7 +206,7 @@ update_cran_comments <- function() {
}

get_crp_date <- function() {
cmt <- gh::gh("/repos/eddelbuettel/crp/commits")[[1]]
cmt <- gh("/repos/eddelbuettel/crp/commits")[[1]]
Copy link
Member Author

Choose a reason for hiding this comment

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

this change is for being able to mock it while respecting the guidance in https://testthat.r-lib.org/reference/local_mocked_bindings.html#namespaced-calls

@@ -360,10 +360,10 @@ has_internet <- function() {
if (!rlang::is_installed("curl")) {
return(FALSE)
}
if (nzchar(Sys.getenv("YES_INTERNET_TEST_FLEDGE"))) {
if (nzchar(Sys.getenv("FLEDGE_YES_INTERNET_TEST"))) {
Copy link
Member Author

Choose a reason for hiding this comment

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

these were the only test switches not starting with FLEDGE_ 😬

@@ -1,92 +1,94 @@
test_that("bump_version() works -- dev", {
Copy link
Member Author

Choose a reason for hiding this comment

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

the diff here: removing the skips as I don't think we need them anymore, same for the variant, and restructuring the test files into paragraphs.

@maelle maelle requested a review from krlmlr October 2, 2023 10:54
@krlmlr krlmlr merged commit 5f18bc2 into main Oct 2, 2023
@krlmlr krlmlr deleted the test-moresmoothly branch October 2, 2023 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Remove all snapshot_variant("testthat")?
2 participants