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

[chore] tidy testing environment #106

Merged
merged 3 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/testthat/test-check_tbl_colnames.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ test_that("check_tbl_colnames validates correct files", {
})

test_that("check_tbl_colnames fails on files", {
skip_if_not_installed("testthis")
zkamvar marked this conversation as resolved.
Show resolved Hide resolved
hub_path <- system.file("testhubs/simple", package = "hubValidations")
file_path <- "test/file.csv"
round_id <- "2022-10-15"
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-check_tbl_unique_round_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ test_that("check_tbl_unique_round_id works", {


test_that("check_tbl_unique_round_id fails correctly", {
skip_if_not_installed("testthis")
zkamvar marked this conversation as resolved.
Show resolved Hide resolved
hub_path <- system.file("testhubs/simple", package = "hubValidations")
file_path <- "team1-goodmodel/2022-10-08-team1-goodmodel.csv"
multiple_rids <- suppressMessages(
Expand Down
15 changes: 10 additions & 5 deletions tests/testthat/test-validate_pr.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
test_that("validate_pr works on valid PR", {
skip_if_offline()

temp_hub <- fs::path(tempdir(), "valid_sb_hub")
dir <- withr::local_tempdir()
temp_hub <- fs::dir_create(fs::path(dir, "valid_sb_hub"))
gert::git_clone(
url = "https://github.com/hubverse-org/ci-testhub-simple",
path = temp_hub,
Expand All @@ -27,7 +28,8 @@ test_that("validate_pr works on valid PR", {
test_that("validate_pr works on invalid PR", {
skip_if_offline()

temp_hub <- fs::path(tempdir(), "invalid_sb_hub")
dir <- withr::local_tempdir()
temp_hub <- fs::dir_create(fs::path(dir, "invalid_sb_hub"))
gert::git_clone(
url = "https://github.com/hubverse-org/ci-testhub-simple",
path = temp_hub,
Expand All @@ -53,7 +55,8 @@ test_that("validate_pr works on invalid PR", {
test_that("validate_pr flags modifications and deletions in PR", {
skip_if_offline()

temp_hub <- fs::path(tempdir(), "mod_del_hub")
dir <- withr::local_tempdir()
temp_hub <- fs::dir_create(fs::path(dir, "mod_del_hub"))
gert::git_clone(
url = "https://github.com/hubverse-org/ci-testhub-simple",
path = temp_hub,
Expand Down Expand Up @@ -140,7 +143,8 @@ test_that("validate_pr flags modifications and deletions in PR", {
test_that("validate_pr handles errors in determining submission window & file renaming", {
skip_if_offline()

temp_hub <- fs::path(tempdir(), "mod_exec_error_hub")
dir <- withr::local_tempdir()
temp_hub <- fs::dir_create(fs::path(dir, "mod_exec_error_hub"))
gert::git_clone(
url = "https://github.com/hubverse-org/ci-testhub-simple",
path = temp_hub,
Expand All @@ -165,7 +169,8 @@ test_that("validate_pr handles errors in determining submission window & file re
test_that("validate_pr works on valid PR using v2.0.0 schema and old orgname", {
skip_if_offline()

temp_hub <- fs::path(tempdir(), "valid_sb_hub-old")
dir <- withr::local_tempdir()
temp_hub <- fs::dir_create(fs::path(dir, "valid_sb_hub-old"))
gert::git_clone(
url = "https://github.com/hubverse-org/ci-testhub-simple-old-orgname",
path = temp_hub,
Expand Down
Loading