Skip to content

Commit

Permalink
Fixing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Schuemie authored and Schuemie committed Oct 22, 2023
1 parent faa68ea commit 1e0550d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/testthat/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ testServers[[length(testServers) + 1]] <- list(
)

addDbmsToLabel <- function(label, testServer) {
return(paste(label, testServer$connectionDetails$dbms))
# Test sections are not shown in R check, so also printing them here:
message(sprintf("Test: %s (%s)", label, testServer$connectionDetails$dbms))
return(sprintf("%s (%s)", label, testServer$connectionDetails$dbms))
}

4 changes: 3 additions & 1 deletion tests/testthat/test-insertTable.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if (DatabaseConnector:::is_installed("ParallelLogger")) {
set.seed(0)
day.start <- "1960/01/01"
day.end <- "2000/12/31"
time.start <- as.POSIXct("2018-11-12 09:04:07 CET")
time.start <- as.POSIXct("2018-11-12 09:04:07")
dayseq <- seq.Date(as.Date(day.start), as.Date(day.end), by = "week")
timeSeq <- time.start + (1:length(dayseq)) * 60 * 60 * 24
makeRandomStrings <- function(n = 1, lenght = 12) {
Expand Down Expand Up @@ -60,6 +60,8 @@ for (testServer in testServers) {
data2 <- data2[order(data2$person_id), ]
row.names(data) <- NULL
row.names(data2) <- NULL
attr(data$some_datetime, "tzone") <- NULL
attr(data2$some_datetime, "tzone") <- NULL
expect_equal(data, data2, check.attributes = FALSE)

# Check data types
Expand Down

0 comments on commit 1e0550d

Please sign in to comment.