Skip to content

Commit

Permalink
skip some project-info tests on a different server
Browse files Browse the repository at this point in the history
ref #542
  • Loading branch information
wibeasley committed Oct 13, 2024
1 parent 6ea886d commit 5c94ee2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
8 changes: 4 additions & 4 deletions inst/test-data/specific-redcapr/project-info-read/chicago.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
structure(list(project_id = 153L, project_title = "REDCapR Target Simple Static -see https://github.com/OuhscBbmc/REDCapR",
creation_time = structure(1385762300, class = c("POSIXct",
structure(list(project_id = 33L, project_title = "REDCapR: simple",
creation_time = structure(1728609678, class = c("POSIXct",
"POSIXt"), tzone = "America/Chicago"), production_time = structure(NA_real_, class = c("POSIXct",
"POSIXt"), tzone = "America/Chicago"), in_production = FALSE,
project_language = "English", purpose = 0L, purpose_other = NA_character_,
project_language = "English", purpose = 4L, purpose_other = NA_character_,
project_notes = NA_character_, custom_record_label = NA_character_,
secondary_unique_field = NA_character_, is_longitudinal = FALSE,
has_repeating_instruments_or_events = FALSE, surveys_enabled = FALSE,
scheduling_enabled = FALSE, record_autonumbering_enabled = TRUE,
randomization_enabled = FALSE, ddp_enabled = FALSE, project_irb_number = NA_character_,
project_grant_number = NA_character_, project_pi_firstname = NA_character_,
project_pi_lastname = NA_character_, display_today_now_button = TRUE,
missing_data_codes = NA_character_, external_modules = "cross_project_piping,form_status_tweaks,redcap_autofill,data_driven_project_banner",
missing_data_codes = NA_character_, external_modules = "redcap_entity",
bypass_branching_erase_field_prompt = "0"), row.names = c(NA,
-1L), spec = structure(list(cols = list(project_id = structure(list(), class = c("collector_integer",
"collector")), project_title = structure(list(), class = c("collector_character",
Expand Down
10 changes: 5 additions & 5 deletions inst/test-data/specific-redcapr/project-info-read/simple.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
structure(list(project_id = 153L, project_title = "REDCapR Target Simple Static -see https://github.com/OuhscBbmc/REDCapR",
creation_time = structure(1385740700, class = c("POSIXct",
structure(list(project_id = 33L, project_title = "REDCapR: simple",
creation_time = structure(1728591678, class = c("POSIXct",
"POSIXt"), tzone = "UTC"), production_time = structure(NA_real_, class = c("POSIXct",
"POSIXt"), tzone = "UTC"), in_production = FALSE, project_language = "English",
purpose = 0L, purpose_other = NA_character_, project_notes = NA_character_,
purpose = 4L, purpose_other = NA_character_, project_notes = NA_character_,
custom_record_label = NA_character_, secondary_unique_field = NA_character_,
is_longitudinal = FALSE, has_repeating_instruments_or_events = FALSE,
surveys_enabled = FALSE, scheduling_enabled = FALSE, record_autonumbering_enabled = TRUE,
randomization_enabled = FALSE, ddp_enabled = FALSE, project_irb_number = NA_character_,
project_grant_number = NA_character_, project_pi_firstname = NA_character_,
project_pi_lastname = NA_character_, display_today_now_button = TRUE,
missing_data_codes = NA_character_, external_modules = "cross_project_piping,date_validation_action_tags,form_status_tweaks",
missing_data_codes = NA_character_, external_modules = "redcap_entity",
bypass_branching_erase_field_prompt = "0"), row.names = c(NA,
-1L), spec = structure(list(cols = list(project_id = structure(list(), class = c("collector_integer",
"collector")), project_title = structure(list(), class = c("collector_character",
Expand Down Expand Up @@ -37,6 +37,6 @@ structure(list(project_id = 153L, project_title = "REDCapR Target Simple Static
"collector")), missing_data_codes = structure(list(), class = c("collector_character",
"collector")), external_modules = structure(list(), class = c("collector_character",
"collector")), bypass_branching_erase_field_prompt = structure(list(), class = c("collector_character",
"collector"))), default = structure(list(), class = c("collector_character",
"collector"))), default = structure(list(), class = c("collector_guess",
"collector")), delim = ","), class = "col_spec"), class = c("spec_tbl_df",
"tbl_df", "tbl", "data.frame"))
8 changes: 8 additions & 0 deletions tests/testthat/test-project-info-read.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ test_that("simple", {
path_expected <- "test-data/specific-redcapr/project-info-read/simple.R"
expected_outcome_message <- "\\d+ rows were read from REDCap in \\d+(\\.\\d+\\W|\\W)seconds\\."

if (credential$redcap_uri != "https://redcap-dev-2.ouhsc.edu/redcap/api/") {
testthat::skip("Skip when run a different server.")
}

returned_object <-
redcap_project_info_read(
redcap_uri = credential$redcap_uri,
Expand Down Expand Up @@ -80,6 +84,10 @@ test_that("chicago", {
path_expected <- "test-data/specific-redcapr/project-info-read/chicago.R"
expected_outcome_message <- "\\d+ rows were read from REDCap in \\d+(\\.\\d+\\W|\\W)seconds\\."

if (credential$redcap_uri != "https://redcap-dev-2.ouhsc.edu/redcap/api/") {
testthat::skip("Skip when run a different server.")
}

server_locale <- readr::locale(tz = "America/Chicago")

returned_object <-
Expand Down

0 comments on commit 5c94ee2

Please sign in to comment.