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

skip some tests on CRAN #268

Merged
merged 3 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions man/createCovariateSettings.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/getDbCovariateData.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ if (dbms == "bigquery" && .Platform$OS.type == "windows") {
# oracle
if (dbms == "oracle") {
DatabaseConnector::downloadJdbcDrivers(dbms)
oracleConnectionDetails <- createConnectionDetails(
oracleConnectionDetails <- DatabaseConnector::createConnectionDetails(
dbms = dbms,
user = Sys.getenv("CDM5_ORACLE_USER"),
password = URLdecode(Sys.getenv("CDM5_ORACLE_PASSWORD")),
Expand All @@ -148,7 +148,7 @@ if (dbms == "oracle") {
# postgres
if (dbms == "postgresql") {
DatabaseConnector::downloadJdbcDrivers(dbms)
pgConnectionDetails <- createConnectionDetails(
pgConnectionDetails <- DatabaseConnector::createConnectionDetails(
dbms = dbms,
user = Sys.getenv("CDM5_POSTGRESQL_USER"),
password = URLdecode(Sys.getenv("CDM5_POSTGRESQL_PASSWORD")),
Expand All @@ -161,7 +161,7 @@ if (dbms == "postgresql") {
# redshift
if (dbms == "redshift") {
DatabaseConnector::downloadJdbcDrivers(dbms)
redshiftConnectionDetails <- createConnectionDetails(
redshiftConnectionDetails <- DatabaseConnector::createConnectionDetails(
dbms = dbms,
user = Sys.getenv("CDM5_REDSHIFT_USER"),
password = URLdecode(Sys.getenv("CDM5_REDSHIFT_PASSWORD")),
Expand Down Expand Up @@ -204,7 +204,7 @@ if (dbms == "spark") {
# sql server
if (dbms == "sql server") {
DatabaseConnector::downloadJdbcDrivers("sql server")
sqlServerConnectionDetails <- createConnectionDetails(
sqlServerConnectionDetails <- DatabaseConnector::createConnectionDetails(
dbms = "sql server",
user = Sys.getenv("CDM5_SQL_SERVER_USER"),
password = URLdecode(Sys.getenv("CDM5_SQL_SERVER_PASSWORD")),
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-Aggregation.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# covr::file_report(covr::file_coverage("R/Aggregation.R", "tests/testthat/test-Aggregation.R"))

test_that("aggregateCovariates works", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
settings <- createCovariateSettings(useDemographicsAgeGroup = TRUE, useChads2Vasc = TRUE)
covariateData <- getDbCovariateData(
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-CompareCohorts.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ test_that("Test stdDiff continuous variable computation", {
})

test_that("Test stdDiff binary variable computation", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
connectionDetails <- Eunomia::getEunomiaConnectionDetails()
Eunomia::createCohorts(connectionDetails)
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-CovariateData.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ test_that("test CovariateData Class on Empty", {
})

test_that("test saveCovariateData error cases", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
saveFileTest <- tempfile("covDatSave")
settings <- createDefaultCovariateSettings()
Expand Down Expand Up @@ -95,6 +96,7 @@ test_that("test summary call for covariateData class", {
})

test_that("test filtering of covariates based on minCharacterizationMean", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
settings <- createDefaultCovariateSettings()
covariateData <- getDbCovariateData(
Expand Down Expand Up @@ -152,6 +154,7 @@ test_that("Test show method", {
})

test_that("getDbCovariateData cohortId warning", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
settings <- createDefaultCovariateSettings()
expect_warning(getDbCovariateData(
Expand All @@ -165,6 +168,7 @@ test_that("getDbCovariateData cohortId warning", {
})

test_that("getDbCovariateData settings list - check metaData", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
looCovSet <- FeatureExtraction:::.createLooCovariateSettings(useLengthOfObs = TRUE)
covariateSettingsList <- list(looCovSet, looCovSet)
Expand Down
8 changes: 8 additions & 0 deletions tests/testthat/test-GetCohortBasedCovariates.R
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ test_that("Cohort-based covariates: binary, non-aggregated on Eunomia", {
})

test_that("Cohort-based covariates: binary, aggregated on Eunomia", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
runCohortBasedBinaryAggTest(
connection = eunomiaConnection,
Expand All @@ -496,6 +497,7 @@ test_that("Cohort-based covariates: binary, aggregated on Eunomia", {
})

test_that("Cohort-based covariates: binary, non-aggregated, temporal on Eunomia", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
runCohortBasedBinaryNonAggTemporalTest(
connection = eunomiaConnection,
Expand All @@ -506,6 +508,7 @@ test_that("Cohort-based covariates: binary, non-aggregated, temporal on Eunomia"
})

test_that("Cohort-based covariates: binary, aggregated, temporal on Eunomia", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
runCohortBasedBinaryAggTemporalTest(
connection = eunomiaConnection,
Expand All @@ -516,6 +519,7 @@ test_that("Cohort-based covariates: binary, aggregated, temporal on Eunomia", {
})

test_that("Cohort-based covariates: counts, non-aggregated on Eunomia", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
runCohortBasedCountsNonAggTest(
connection = eunomiaConnection,
Expand All @@ -526,6 +530,7 @@ test_that("Cohort-based covariates: counts, non-aggregated on Eunomia", {
})

test_that("Cohort-based covariates: counts, aggregated on Eunomia", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
runCohortBasedCountsAggTest(
connection = eunomiaConnection,
Expand All @@ -536,6 +541,7 @@ test_that("Cohort-based covariates: counts, aggregated on Eunomia", {
})

test_that("Cohort-based covariates: counts, non-aggregated, temporal on Eunomia", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
runCohortBasedCountsNonAggTemporalTest(
connection = eunomiaConnection,
Expand All @@ -546,6 +552,7 @@ test_that("Cohort-based covariates: counts, non-aggregated, temporal on Eunomia"
})

test_that("Cohort-based covariates: counts, aggregated, temporal on Eunomia", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
runCohortBasedCountsAggTemporalTest(
connection = eunomiaConnection,
Expand All @@ -556,6 +563,7 @@ test_that("Cohort-based covariates: counts, aggregated, temporal on Eunomia", {
})

test_that("Cohort-based covariates: counts, aggregated, using multiple cohort IDs on Eunomia", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
runCohortBasedCountsAggMultiCohortTest(
connection = eunomiaConnection,
Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test-GetCovariates.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ test_that("getDbCovariateData enforces specification of database details", {
})

test_that("getDbCovariateData CDM v4 not supported", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
expect_error(getDbCovariateData(
connectionDetails = eunomiaConnectionDetails,
Expand All @@ -83,6 +84,7 @@ test_that("getDbCovariateData cohortTableIsTemp tests when table name lacks # sy
})

test_that("getDbCovariateData cohortTableIsTemp tests when table name contains # symbol", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
result <- getDbCovariateData(
connection = eunomiaConnection,
Expand All @@ -95,6 +97,7 @@ test_that("getDbCovariateData cohortTableIsTemp tests when table name contains #
})

test_that("getDbCovariateData populationSize == 0 tests", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
expect_warning(getDbCovariateData(
connection = eunomiaConnection,
Expand All @@ -107,6 +110,7 @@ test_that("getDbCovariateData populationSize == 0 tests", {
})

test_that("Custom covariate builder", {
skip_on_cran()
# TODO: This test is probably good to run on all DB platforms
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
covariateSettings <- createCovariateSettings(
Expand All @@ -129,6 +133,7 @@ test_that("Custom covariate builder", {
})

test_that("getDbCovariateData care site from person tests", {
skip_on_cran()
# TODO: This test is probably good to run on all DB platforms
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))

Expand Down Expand Up @@ -171,6 +176,7 @@ test_that("getDbCovariateData care site from person tests", {
})

test_that("getDbCovariateData care site from visit_occurrence tests", {
skip_on_cran()
# TODO: This test is probably good to run on all DB platforms
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))

Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-GetCovariatesFromCohortAttributes.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ test_that("getDbCohortAttrCovariatesData CDM v4 not supported check", {
})

test_that("getDbCohortAttrCovariatesData hasIncludedAttributes == 0", {
skip_on_cran()
# TODO: This test is probably good to run on all DB platforms
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
covariateSettings <- createCohortAttrCovariateSettings(
Expand All @@ -47,6 +48,7 @@ test_that("getDbCohortAttrCovariatesData hasIncludedAttributes == 0", {
})

test_that("getDbCohortAttrCovariatesData hasIncludedAttributes > 0", {
skip_on_cran()
# TODO: This test is probably good to run on all DB platforms
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
covariateSettings <- createCohortAttrCovariateSettings(
Expand Down Expand Up @@ -74,6 +76,7 @@ test_that("createCohortAttrCovariateSettings check", {
})

test_that("getDbCohortAttrCovariatesData cohortId warning", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
covariateSettings <- createCohortAttrCovariateSettings(
attrDatabaseSchema = eunomiaOhdsiDatabaseSchema,
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-GetCovariatesTemporalSequence.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ test_that("getDbCovariateData works with createTemporalSequenceCovariateSettings

# Check backwards compatibility
test_that("Temporal Covariate Settings are backwards compatible", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))

# Temporal covariate settings created previously will not have
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-GetDefaultCovariates.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# covr::file_report(covr::file_coverage("R/GetDefaultCovariates.R", "tests/testthat/test-GetDefaultCovariates.R"))

test_that("Test exit conditions", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))

# covariateSettings object type
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-HelperFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ test_that("Test helper functions for non-aggregated covariate data", {
})

test_that("Test helper functions for aggregated covariate data", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
expect_error(filterByCohortDefinitionId("blah", 1), "not of class CovariateData")

Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-Table1.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ test_that("createTable1 works with categorical covariates", {


test_that("createTable1 works with continuous covariates", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))

settings <- createCovariateSettings(
Expand Down Expand Up @@ -142,6 +143,7 @@ test_that("createTable1 works with continuous covariates", {


test_that("createTable1 works with other covariates", {
skip_on_cran()
skip_if_not(dbms == "sqlite" && exists("eunomiaConnection"))
settings <- createCovariateSettings(
useDemographicsAgeGroup = TRUE,
Expand Down
Loading