From a98490a51e2e23557a74cf48f96a945896a39e38 Mon Sep 17 00:00:00 2001 From: Ger Inberg Date: Tue, 20 Aug 2024 14:20:55 +0200 Subject: [PATCH 1/3] skip_on_cran --- man/createCovariateSettings.Rd | 4 +- man/getDbCovariateData.Rd | 8 ++-- tests/testthat/test-Aggregation.R | 2 + tests/testthat/test-CompareCohorts.R | 2 + tests/testthat/test-CovariateData.R | 9 ++++ .../testthat/test-DetailedCovariateSettings.R | 5 +++ .../testthat/test-FeatureExtractionInternal.R | 2 + .../testthat/test-GetCohortBasedCovariates.R | 45 +++++++++++++++++++ tests/testthat/test-GetCovariates.R | 8 ++++ .../test-GetCovariatesFromCohortAttributes.R | 6 +++ .../test-GetCovariatesTemporalSequence.R | 4 ++ tests/testthat/test-GetDefaultCovariates.R | 1 + tests/testthat/test-HelperFunctions.R | 2 + tests/testthat/test-PostcoordConcepts.R | 1 + tests/testthat/test-PrespecAnalyses.R | 1 + tests/testthat/test-Table1.R | 4 ++ tests/testthat/test-query-no-fail.R | 20 +++++++++ tests/testthat/test-spot-checks.R | 5 +++ tests/testthat/test-tidyCovariates.R | 4 ++ 19 files changed, 127 insertions(+), 6 deletions(-) diff --git a/man/createCovariateSettings.Rd b/man/createCovariateSettings.Rd index 5023ea43..694cfedc 100644 --- a/man/createCovariateSettings.Rd +++ b/man/createCovariateSettings.Rd @@ -315,7 +315,7 @@ medium term window. (analysis ID 403)} \item{useDrugEraShortTerm}{One covariate per drug in the drug_era table overlapping with any part of the -short window. (analysis ID 404)} +short term window. (analysis ID 404)} \item{useDrugEraOverlapping}{One covariate per drug in the drug_era table overlapping with the end of the @@ -330,7 +330,7 @@ table starting in the medium term window. (analysis ID 407)} \item{useDrugEraStartShortTerm}{One covariate per drug in the drug_era -table starting in the long short window. +table starting in the short term window. (analysis ID 408)} \item{useDrugGroupEraAnyTimePrior}{One covariate per drug rolled up to ATC diff --git a/man/getDbCovariateData.Rd b/man/getDbCovariateData.Rd index 8428881c..bf6084a6 100644 --- a/man/getDbCovariateData.Rd +++ b/man/getDbCovariateData.Rd @@ -67,13 +67,13 @@ there is more than one period per person.} of the createCovariate functions, or a list of such objects.} \item{aggregated}{Should aggregate statistics be computed instead of covariates per -cohort entry? If aggregated is set to FALSE, the results returned will be based -on each subject_id and cohort_start_date in your cohort table. If your cohort -contains multiple entries for the same subject_id (due to different cohort_start_date values), +cohort entry? If aggregated is set to FALSE, the results returned will be based +on each subject_id and cohort_start_date in your cohort table. If your cohort +contains multiple entries for the same subject_id (due to different cohort_start_date values), you must carefully set the rowIdField so you can identify the patients properly. See issue #229 for more discussion on this parameter.} -\item{minCharacterizationMean}{The minimum mean value for characterization output. Values below this will be cut off from output. This +\item{minCharacterizationMean}{The minimum mean value for characterization output. Values below this will be cut off from output. This will help reduce the file size of the characterization output, but will remove information on covariates that have very low values. The default is 0.} } diff --git a/tests/testthat/test-Aggregation.R b/tests/testthat/test-Aggregation.R index ff383eec..0466e740 100644 --- a/tests/testthat/test-Aggregation.R +++ b/tests/testthat/test-Aggregation.R @@ -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( @@ -29,6 +30,7 @@ test_that("aggregateCovariates works", { }) test_that("aggregateCovariates handles temporalCovariates", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) settings <- createTemporalCovariateSettings(useDemographicsGender = TRUE) covariateData <- getDbCovariateData( diff --git a/tests/testthat/test-CompareCohorts.R b/tests/testthat/test-CompareCohorts.R index 842792be..feeb44d3 100644 --- a/tests/testthat/test-CompareCohorts.R +++ b/tests/testthat/test-CompareCohorts.R @@ -3,6 +3,7 @@ # covr::file_report(covr::file_coverage("R/CompareCohorts.R", "tests/testthat/test-CompareCohorts.R")) test_that("Test stdDiff continuous variable computation", { + skip_on_cran() # NOTE: Data stored in "inst/testdata/continuousCovariateData.zip" created by: # ------------------------------------------------------------------------------ # connectionDetails <- Eunomia::getEunomiaConnectionDetails() @@ -39,6 +40,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) diff --git a/tests/testthat/test-CovariateData.R b/tests/testthat/test-CovariateData.R index ef06707e..09e0ff1a 100644 --- a/tests/testthat/test-CovariateData.R +++ b/tests/testthat/test-CovariateData.R @@ -3,6 +3,7 @@ # covr::file_report(covr::file_coverage("R/CovariateData.R", "tests/testthat/test-CovariateData.R")) test_that("test CovariateData Class on Empty", { + skip_on_cran() skip_if_not(dbms == "sqlite") # create 4 scenarios of Covariate Data # 1) error (non class), 2) covariate data, 3) aggregatedCovariate Data, @@ -52,6 +53,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() @@ -78,6 +80,7 @@ test_that("test saveCovariateData error cases", { }) test_that("test summary call for covariateData class", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) settings <- createDefaultCovariateSettings() covariateData <- getDbCovariateData( @@ -95,6 +98,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( @@ -126,10 +130,12 @@ test_that("test filtering of covariates based on minCharacterizationMean", { }) test_that("test loadCovariateData", { + skip_on_cran() expect_error(loadCovariateData("errorPath")) }) test_that("Test exit/warning conditions", { + skip_on_cran() # Empty Directory test tempDir <- tempdir() expect_error(loadCovariateData(file = tempDir)) @@ -146,12 +152,14 @@ test_that("Test exit/warning conditions", { }) test_that("Test show method", { + skip_on_cran() cvData <- FeatureExtraction::createEmptyCovariateData(cohortIds = c(1, 2), aggregated = FALSE, temporal = FALSE) expect_invisible(show(cvData)) on.exit(rm(cvData)) }) test_that("getDbCovariateData cohortId warning", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) settings <- createDefaultCovariateSettings() expect_warning(getDbCovariateData( @@ -165,6 +173,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) diff --git a/tests/testthat/test-DetailedCovariateSettings.R b/tests/testthat/test-DetailedCovariateSettings.R index e2613896..53ccb16e 100644 --- a/tests/testthat/test-DetailedCovariateSettings.R +++ b/tests/testthat/test-DetailedCovariateSettings.R @@ -1,5 +1,6 @@ # This file covers the code in DetailedCovariateData.R. View coverage for this file using test_that("test createDetailedCovariateSettings", { + skip_on_cran() analysisDetails <- createAnalysisDetails( analysisId = 1, sqlFileName = "DemographicsGender.sql", @@ -23,6 +24,7 @@ test_that("test createDetailedCovariateSettings", { }) test_that("test createDetailedTemporalCovariateSettings", { + skip_on_cran() analysisDetails <- createAnalysisDetails( analysisId = 1, sqlFileName = "DemographicsGender.sql", @@ -44,6 +46,7 @@ test_that("test createDetailedTemporalCovariateSettings", { }) test_that("test convertPrespecSettingsToDetailedSettings", { + skip_on_cran() settings <- createCovariateSettings(useDemographicsAgeGroup = TRUE, useChads2Vasc = TRUE) convertedSettings <- convertPrespecSettingsToDetailedSettings(settings) expect_s3_class(convertedSettings, "covariateSettings") @@ -52,11 +55,13 @@ test_that("test convertPrespecSettingsToDetailedSettings", { }) test_that("test createDefaultCovariateSettings", { + skip_on_cran() settings <- createDefaultCovariateSettings() expect_s3_class(settings, "covariateSettings") }) test_that("test createDefaultTemporalCovariateSettings", { + skip_on_cran() settings <- createDefaultTemporalCovariateSettings() expect_s3_class(settings, "covariateSettings") }) diff --git a/tests/testthat/test-FeatureExtractionInternal.R b/tests/testthat/test-FeatureExtractionInternal.R index 39c79dd3..53140ebb 100644 --- a/tests/testthat/test-FeatureExtractionInternal.R +++ b/tests/testthat/test-FeatureExtractionInternal.R @@ -3,12 +3,14 @@ # covr::file_report(covr::file_coverage("R/FeatureExtraction.R", "tests/testthat/test-FeatureExtractionInternal.R")) test_that("Test .onLoad()", { + skip_on_cran() expect_silent( FeatureExtraction:::.onLoad(libname = "FeatureExtraction", pkgname = "FeatureExtraction") ) }) test_that("Test JSON functions", { + skip_on_cran() expectedToJsonResult <- "{\"id\":\"1\"}" expectedFromJsonResult <- list("id" = "1") toJsonResult <- FeatureExtraction:::.toJson(expectedFromJsonResult) diff --git a/tests/testthat/test-GetCohortBasedCovariates.R b/tests/testthat/test-GetCohortBasedCovariates.R index 2b8d8b7a..9eb662b3 100644 --- a/tests/testthat/test-GetCohortBasedCovariates.R +++ b/tests/testthat/test-GetCohortBasedCovariates.R @@ -476,6 +476,7 @@ runCohortBasedCountsAggMultiCohortTest <- function(connection, cdmDatabaseSchema # Eunomia tests ------------ test_that("Cohort-based covariates: binary, non-aggregated on Eunomia", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) runCohortBasedBinaryNonAggTest( connection = eunomiaConnection, @@ -486,6 +487,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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -567,6 +575,7 @@ test_that("Cohort-based covariates: counts, aggregated, using multiple cohort ID # Postgres tests ------------ test_that("Cohort-based covariates: binary, non-aggregated on Postgres", { + skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -579,6 +588,7 @@ test_that("Cohort-based covariates: binary, non-aggregated on Postgres", { }) test_that("Cohort-based covariates: binary, aggregated on Postgres", { + skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -591,6 +601,7 @@ test_that("Cohort-based covariates: binary, aggregated on Postgres", { }) test_that("Cohort-based covariates: binary, non-aggregated, temporal on Postgres", { + skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -603,6 +614,7 @@ test_that("Cohort-based covariates: binary, non-aggregated, temporal on Postgres }) test_that("Cohort-based covariates: binary, aggregated, temporal on Postgres", { + skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -615,6 +627,7 @@ test_that("Cohort-based covariates: binary, aggregated, temporal on Postgres", { }) test_that("Cohort-based covariates: counts, non-aggregated on Postgres", { + skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -627,6 +640,7 @@ test_that("Cohort-based covariates: counts, non-aggregated on Postgres", { }) test_that("Cohort-based covariates: counts, aggregated on Postgres", { + skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -639,6 +653,7 @@ test_that("Cohort-based covariates: counts, aggregated on Postgres", { }) test_that("Cohort-based covariates: counts, non-aggregated, temporal on Postgres", { + skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -651,6 +666,7 @@ test_that("Cohort-based covariates: counts, non-aggregated, temporal on Postgres }) test_that("Cohort-based covariates: counts, aggregated, temporal on Postgres", { + skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -663,6 +679,7 @@ test_that("Cohort-based covariates: counts, aggregated, temporal on Postgres", { }) test_that("Cohort-based covariates: counts, aggregated, using multiple cohort IDs on Postgres", { + skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -676,6 +693,7 @@ test_that("Cohort-based covariates: counts, aggregated, using multiple cohort ID # SQL Server tests ------------ test_that("Cohort-based covariates: binary, non-aggregated on SQL Server", { + skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -688,6 +706,7 @@ test_that("Cohort-based covariates: binary, non-aggregated on SQL Server", { }) test_that("Cohort-based covariates: binary, aggregated on SQL Server", { + skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -700,6 +719,7 @@ test_that("Cohort-based covariates: binary, aggregated on SQL Server", { }) test_that("Cohort-based covariates: binary, non-aggregated, temporal on SQL Server", { + skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -712,6 +732,7 @@ test_that("Cohort-based covariates: binary, non-aggregated, temporal on SQL Serv }) test_that("Cohort-based covariates: binary, aggregated, temporal on SQL Server", { + skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -724,6 +745,7 @@ test_that("Cohort-based covariates: binary, aggregated, temporal on SQL Server", }) test_that("Cohort-based covariates: counts, non-aggregated on SQL Server", { + skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -736,6 +758,7 @@ test_that("Cohort-based covariates: counts, non-aggregated on SQL Server", { }) test_that("Cohort-based covariates: counts, aggregated on SQL Server", { + skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -748,6 +771,7 @@ test_that("Cohort-based covariates: counts, aggregated on SQL Server", { }) test_that("Cohort-based covariates: counts, non-aggregated, temporal on SQL Server", { + skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -760,6 +784,7 @@ test_that("Cohort-based covariates: counts, non-aggregated, temporal on SQL Serv }) test_that("Cohort-based covariates: counts, aggregated, temporal on SQL Server", { + skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -772,6 +797,7 @@ test_that("Cohort-based covariates: counts, aggregated, temporal on SQL Server", }) test_that("Cohort-based covariates: counts, aggregated, using multiple cohort IDs on SQL Server", { + skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -785,6 +811,7 @@ test_that("Cohort-based covariates: counts, aggregated, using multiple cohort ID # Oracle tests ------------ test_that("Cohort-based covariates: binary, non-aggregated on Oracle", { + skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -797,6 +824,7 @@ test_that("Cohort-based covariates: binary, non-aggregated on Oracle", { }) test_that("Cohort-based covariates: binary, aggregated on Oracle", { + skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -809,6 +837,7 @@ test_that("Cohort-based covariates: binary, aggregated on Oracle", { }) test_that("Cohort-based covariates: binary, non-aggregated, temporal on Oracle", { + skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -821,6 +850,7 @@ test_that("Cohort-based covariates: binary, non-aggregated, temporal on Oracle", }) test_that("Cohort-based covariates: binary, aggregated, temporal on Oracle", { + skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -833,6 +863,7 @@ test_that("Cohort-based covariates: binary, aggregated, temporal on Oracle", { }) test_that("Cohort-based covariates: counts, non-aggregated on Oracle", { + skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -845,6 +876,7 @@ test_that("Cohort-based covariates: counts, non-aggregated on Oracle", { }) test_that("Cohort-based covariates: counts, aggregated on Oracle", { + skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -857,6 +889,7 @@ test_that("Cohort-based covariates: counts, aggregated on Oracle", { }) test_that("Cohort-based covariates: counts, non-aggregated, temporal on Oracle", { + skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -869,6 +902,7 @@ test_that("Cohort-based covariates: counts, non-aggregated, temporal on Oracle", }) test_that("Cohort-based covariates: counts, aggregated, temporal on Oracle", { + skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -881,6 +915,7 @@ test_that("Cohort-based covariates: counts, aggregated, temporal on Oracle", { }) test_that("Cohort-based covariates: counts, aggregated, using multiple cohort IDs on Oracle", { + skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -894,6 +929,7 @@ test_that("Cohort-based covariates: counts, aggregated, using multiple cohort ID # RedShift tests ------------ test_that("Cohort-based covariates: binary, non-aggregated on RedShift", { + skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -906,6 +942,7 @@ test_that("Cohort-based covariates: binary, non-aggregated on RedShift", { }) test_that("Cohort-based covariates: binary, aggregated on RedShift", { + skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -918,6 +955,7 @@ test_that("Cohort-based covariates: binary, aggregated on RedShift", { }) test_that("Cohort-based covariates: binary, non-aggregated, temporal on RedShift", { + skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -930,6 +968,7 @@ test_that("Cohort-based covariates: binary, non-aggregated, temporal on RedShift }) test_that("Cohort-based covariates: binary, aggregated, temporal on RedShift", { + skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -942,6 +981,7 @@ test_that("Cohort-based covariates: binary, aggregated, temporal on RedShift", { }) test_that("Cohort-based covariates: counts, non-aggregated on RedShift", { + skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -954,6 +994,7 @@ test_that("Cohort-based covariates: counts, non-aggregated on RedShift", { }) test_that("Cohort-based covariates: counts, aggregated on RedShift", { + skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -966,6 +1007,7 @@ test_that("Cohort-based covariates: counts, aggregated on RedShift", { }) test_that("Cohort-based covariates: counts, non-aggregated, temporal on RedShift", { + skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -978,6 +1020,7 @@ test_that("Cohort-based covariates: counts, non-aggregated, temporal on RedShift }) test_that("Cohort-based covariates: counts, aggregated, temporal on RedShift", { + skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -990,6 +1033,7 @@ test_that("Cohort-based covariates: counts, aggregated, temporal on RedShift", { }) test_that("Cohort-based covariates: counts, aggregated, using multiple cohort IDs on RedShift", { + skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -1004,6 +1048,7 @@ test_that("Cohort-based covariates: counts, aggregated, using multiple cohort ID # Non-database specific tests --------------- test_that("Cohort-based covariates: warning if using pre-defined analysis ID", { + skip_on_cran() expect_warning( createCohortBasedCovariateSettings( analysisId = 1, diff --git a/tests/testthat/test-GetCovariates.R b/tests/testthat/test-GetCovariates.R index 86507d48..42d75d64 100644 --- a/tests/testthat/test-GetCovariates.R +++ b/tests/testthat/test-GetCovariates.R @@ -34,6 +34,7 @@ getCovariateSettings <- function() { # } test_that("getDbCovariateData enforces specification of database details", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) # No database details specified expect_error(getDbCovariateData( @@ -60,6 +61,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, @@ -71,6 +73,7 @@ test_that("getDbCovariateData CDM v4 not supported", { }) test_that("getDbCovariateData cohortTableIsTemp tests when table name lacks # symbol", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) result <- getDbCovariateData( connection = eunomiaConnection, @@ -83,6 +86,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, @@ -95,6 +99,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, @@ -107,6 +112,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( @@ -129,6 +135,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")) @@ -171,6 +178,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")) diff --git a/tests/testthat/test-GetCovariatesFromCohortAttributes.R b/tests/testthat/test-GetCovariatesFromCohortAttributes.R index bf5cfa18..952e521b 100644 --- a/tests/testthat/test-GetCovariatesFromCohortAttributes.R +++ b/tests/testthat/test-GetCovariatesFromCohortAttributes.R @@ -7,6 +7,7 @@ # covr::file_report(covr::file_coverage("R/GetCovariatesFromCohortAttributes.R", "tests/testthat/test-GetCovariatesFromCohortAttributes.R")) test_that("getDbCohortAttrCovariatesData aggregation not supported check", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) expect_error(getDbCohortAttrCovariatesData( connection = eunomiaConnection, @@ -17,6 +18,7 @@ test_that("getDbCohortAttrCovariatesData aggregation not supported check", { }) test_that("getDbCohortAttrCovariatesData CDM v4 not supported check", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) expect_error(getDbCohortAttrCovariatesData( connection = eunomiaConnection, @@ -27,6 +29,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( @@ -47,6 +50,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( @@ -68,12 +72,14 @@ test_that("getDbCohortAttrCovariatesData hasIncludedAttributes > 0", { }) test_that("createCohortAttrCovariateSettings check", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) result <- createCohortAttrCovariateSettings(attrDatabaseSchema = "main") expect_equal(class(result), "covariateSettings") }) test_that("getDbCohortAttrCovariatesData cohortId warning", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) covariateSettings <- createCohortAttrCovariateSettings( attrDatabaseSchema = eunomiaOhdsiDatabaseSchema, diff --git a/tests/testthat/test-GetCovariatesTemporalSequence.R b/tests/testthat/test-GetCovariatesTemporalSequence.R index 698676cf..45767243 100644 --- a/tests/testthat/test-GetCovariatesTemporalSequence.R +++ b/tests/testthat/test-GetCovariatesTemporalSequence.R @@ -3,6 +3,7 @@ # covr::file_report(covr::file_coverage("R/DefaultTemporalSequenceCovariateSettings.R", "tests/testthat/test-GetCovariatesTemporalSequence.R")) test_that("createTemporalSequenceCovariateSettings correctly sets list", { + skip_on_cran() settings <- createTemporalSequenceCovariateSettings( useDemographicsGender = T, useConditionEraGroupStart = T, @@ -30,6 +31,7 @@ test_that("createTemporalSequenceCovariateSettings correctly sets list", { test_that("createTemporalSequenceCovariateSettings correctly sets function", { + skip_on_cran() settings <- createTemporalSequenceCovariateSettings( useDemographicsGender = T, useConditionEraGroupStart = T, @@ -46,6 +48,7 @@ test_that("createTemporalSequenceCovariateSettings correctly sets function", { # check extraction test_that("getDbCovariateData works with createTemporalSequenceCovariateSettings", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) covSet <- createTemporalSequenceCovariateSettings( useDemographicsGender = T, @@ -78,6 +81,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 diff --git a/tests/testthat/test-GetDefaultCovariates.R b/tests/testthat/test-GetDefaultCovariates.R index 2316f768..25bede6f 100644 --- a/tests/testthat/test-GetDefaultCovariates.R +++ b/tests/testthat/test-GetDefaultCovariates.R @@ -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 diff --git a/tests/testthat/test-HelperFunctions.R b/tests/testthat/test-HelperFunctions.R index 08ed3152..398b84d8 100644 --- a/tests/testthat/test-HelperFunctions.R +++ b/tests/testthat/test-HelperFunctions.R @@ -3,6 +3,7 @@ # covr::file_report(covr::file_coverage("R/HelperFunctions.R", "tests/testthat/test-HelperFunctions.R")) test_that("Test helper functions for non-aggregated covariate data", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) expect_error(filterByRowId("blah", 1), "not of class CovariateData") @@ -28,6 +29,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") diff --git a/tests/testthat/test-PostcoordConcepts.R b/tests/testthat/test-PostcoordConcepts.R index e7e687b1..290954a6 100644 --- a/tests/testthat/test-PostcoordConcepts.R +++ b/tests/testthat/test-PostcoordConcepts.R @@ -3,6 +3,7 @@ library(FeatureExtraction) library(dplyr) test_that("Postcoordinated concepts on Eunomia", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) # eunomiaConnection <- DatabaseConnector::connect(Eunomia::getEunomiaConnectionDetails()) cohort <- data.frame( diff --git a/tests/testthat/test-PrespecAnalyses.R b/tests/testthat/test-PrespecAnalyses.R index 20fb1b34..ad053819 100644 --- a/tests/testthat/test-PrespecAnalyses.R +++ b/tests/testthat/test-PrespecAnalyses.R @@ -1,6 +1,7 @@ # This file contains tests for all the PrespecAnalyses files in the inst/csv folder. test_that("PrespecAnalyses check for uniqueness", { + skip_on_cran() analysesFiles <- list.files(system.file("csv", package = "FeatureExtraction"), pattern = "^.*.Analyses*.csv$", full.names = TRUE diff --git a/tests/testthat/test-Table1.R b/tests/testthat/test-Table1.R index 68ee5bc5..421c9b92 100644 --- a/tests/testthat/test-Table1.R +++ b/tests/testthat/test-Table1.R @@ -3,6 +3,7 @@ # covr::file_report(covr::file_coverage("R/Table1.R", "tests/testthat/test-Table1.R")) test_that("getDefaultTable1Specifications works", { + skip_on_cran() spec <- getDefaultTable1Specifications() expect_s3_class(spec, "data.frame") expect_equal(names(spec), c("label", "analysisId", "covariateIds")) @@ -10,6 +11,7 @@ test_that("getDefaultTable1Specifications works", { test_that("createTable1 works with categorical covariates", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) settings <- createCovariateSettings( @@ -82,6 +84,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( @@ -166,6 +169,7 @@ test_that("createTable1 works with other covariates", { }) test_that("createTable1CovariateSettings works", { + skip_on_cran() covariateSettings <- createTable1CovariateSettings() expect_s3_class(covariateSettings, "covariateSettings") }) diff --git a/tests/testthat/test-query-no-fail.R b/tests/testthat/test-query-no-fail.R index 8605d038..98cdb33e 100644 --- a/tests/testthat/test-query-no-fail.R +++ b/tests/testthat/test-query-no-fail.R @@ -143,6 +143,7 @@ runExtractionPerPerson <- function(connection, cdmDatabaseSchema, ohdsiDatabaseS } test_that("Run all analysis at per-person level on PostgreSQL", { + skip_on_cran() skip_if_not(dbms == "postgresql") pgConnection <- createUnitTestData(pgConnectionDetails, pgCdmDatabaseSchema, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(pgConnection, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -151,6 +152,7 @@ test_that("Run all analysis at per-person level on PostgreSQL", { }) test_that("Run all analysis at per-person level on SQL Server", { + skip_on_cran() skip_if_not(dbms == "sql server") sqlServerConnection <- createUnitTestData(sqlServerConnectionDetails, sqlServerCdmDatabaseSchema, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(sqlServerConnection, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -159,6 +161,7 @@ test_that("Run all analysis at per-person level on SQL Server", { }) test_that("Run all analysis at per-person level on Oracle", { + skip_on_cran() skip_if_not(dbms == "oracle") oracleConnection <- createUnitTestData(oracleConnectionDetails, oracleCdmDatabaseSchema, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(oracleConnection, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -167,6 +170,7 @@ test_that("Run all analysis at per-person level on Oracle", { }) test_that("Run all analysis at per-person level on Redshift", { + skip_on_cran() skip_if_not(dbms == "redshift") redshiftConnection <- createUnitTestData(redshiftConnectionDetails, redshiftCdmDatabaseSchema, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(redshiftConnection, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -175,6 +179,7 @@ test_that("Run all analysis at per-person level on Redshift", { }) test_that("Run all analysis at per-person level on Eunomia", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) covariateData <- runExtractionPerPerson(eunomiaConnection, eunomiaCdmDatabaseSchema, eunomiaOhdsiDatabaseSchema, cohortTable) expect_true(is(covariateData, "CovariateData")) @@ -324,6 +329,7 @@ runExtractionAggregated <- function(connection, cdmDatabaseSchema, ohdsiDatabase } test_that("Run all analysis at aggregated level on PostgreSQL", { + skip_on_cran() skip_if_not(dbms == "postgresql") pgConnection <- createUnitTestData(pgConnectionDetails, pgCdmDatabaseSchema, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(pgConnection, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -332,6 +338,7 @@ test_that("Run all analysis at aggregated level on PostgreSQL", { }) test_that("Run all analysis at aggregated level on SQL Server", { + skip_on_cran() skip_if_not(dbms == "sql server") sqlServerConnection <- createUnitTestData(sqlServerConnectionDetails, sqlServerCdmDatabaseSchema, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(sqlServerConnection, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -340,6 +347,7 @@ test_that("Run all analysis at aggregated level on SQL Server", { }) test_that("Run all analysis at aggregated level on Oracle", { + skip_on_cran() skip_if_not(dbms == "oracle") oracleConnection <- createUnitTestData(oracleConnectionDetails, oracleCdmDatabaseSchema, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(oracleConnection, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -348,6 +356,7 @@ test_that("Run all analysis at aggregated level on Oracle", { }) test_that("Run all analysis at aggregated level on Redshift", { + skip_on_cran() skip_if_not(dbms == "redshift") redshiftConnection <- createUnitTestData(redshiftConnectionDetails, redshiftCdmDatabaseSchema, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(redshiftConnection, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -356,6 +365,7 @@ test_that("Run all analysis at aggregated level on Redshift", { }) test_that("Run all analysis at aggregated level on Eunomia", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) covariateData <- runExtractionAggregated(eunomiaConnection, eunomiaCdmDatabaseSchema, eunomiaOhdsiDatabaseSchema, cohortTable) expect_true(is(covariateData, "CovariateData")) @@ -430,6 +440,7 @@ runExtractionTemporalPerPerson <- function(connection, cdmDatabaseSchema, ohdsiD } test_that("Run all temporalanalysis at per-person level on PostgreSQL", { + skip_on_cran() skip_if_not(dbms == "postgresql") pgConnection <- createUnitTestData(pgConnectionDetails, pgCdmDatabaseSchema, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(pgConnection, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -438,6 +449,7 @@ test_that("Run all temporalanalysis at per-person level on PostgreSQL", { }) test_that("Run all temporalanalysis at per-person level on SQL Server", { + skip_on_cran() skip_if_not(dbms == "sql server") sqlServerConnection <- createUnitTestData(sqlServerConnectionDetails, sqlServerCdmDatabaseSchema, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(sqlServerConnection, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -446,6 +458,7 @@ test_that("Run all temporalanalysis at per-person level on SQL Server", { }) test_that("Run all temporalanalysis at per-person level on Oracle", { + skip_on_cran() skip_if_not(dbms == "oracle") oracleConnection <- createUnitTestData(oracleConnectionDetails, oracleCdmDatabaseSchema, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(oracleConnection, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -454,6 +467,7 @@ test_that("Run all temporalanalysis at per-person level on Oracle", { }) test_that("Run all temporalanalysis at per-person level on Redshift", { + skip_on_cran() skip_if_not(dbms == "redshift") redshiftConnection <- createUnitTestData(redshiftConnectionDetails, redshiftCdmDatabaseSchema, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(redshiftConnection, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -462,6 +476,7 @@ test_that("Run all temporalanalysis at per-person level on Redshift", { }) test_that("Run all temporalanalysis at per-person level on Eunomia", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) covariateData <- runExtractionTemporalPerPerson(eunomiaConnection, eunomiaCdmDatabaseSchema, eunomiaOhdsiDatabaseSchema, cohortTable) expect_true(is(covariateData, "CovariateData")) @@ -537,6 +552,7 @@ runExtractionTemporalAggregated <- function(connection, cdmDatabaseSchema, ohdsi } test_that("Run all temporalanalysis at aggregated level on PostgreSQL", { + skip_on_cran() skip_if_not(dbms == "postgresql") pgConnection <- createUnitTestData(pgConnectionDetails, pgCdmDatabaseSchema, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(pgConnection, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -545,6 +561,7 @@ test_that("Run all temporalanalysis at aggregated level on PostgreSQL", { }) test_that("Run all temporalanalysis at aggregated level on SQL Server", { + skip_on_cran() skip_if_not(dbms == "sql server") sqlServerConnection <- createUnitTestData(sqlServerConnectionDetails, sqlServerCdmDatabaseSchema, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(sqlServerConnection, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -553,6 +570,7 @@ test_that("Run all temporalanalysis at aggregated level on SQL Server", { }) test_that("Run all temporalanalysis at aggregated level on Oracle", { + skip_on_cran() skip_if_not(dbms == "oracle") oracleConnection <- createUnitTestData(oracleConnectionDetails, oracleCdmDatabaseSchema, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(oracleConnection, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -561,6 +579,7 @@ test_that("Run all temporalanalysis at aggregated level on Oracle", { }) test_that("Run all temporalanalysis at aggregated level on Redshift", { + skip_on_cran() skip_if_not(dbms == "redshift") redshiftConnection <- createUnitTestData(redshiftConnectionDetails, redshiftCdmDatabaseSchema, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(redshiftConnection, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -569,6 +588,7 @@ test_that("Run all temporalanalysis at aggregated level on Redshift", { }) test_that("Run all temporalanalysis at aggregated level on Eunomia", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) covariateData <- runExtractionTemporalAggregated(eunomiaConnection, eunomiaCdmDatabaseSchema, eunomiaOhdsiDatabaseSchema, cohortTable) expect_true(is(covariateData, "CovariateData")) diff --git a/tests/testthat/test-spot-checks.R b/tests/testthat/test-spot-checks.R index 4f11c4ce..619af44f 100644 --- a/tests/testthat/test-spot-checks.R +++ b/tests/testthat/test-spot-checks.R @@ -187,6 +187,7 @@ runSpotChecks <- function(connection, cdmDatabaseSchema, ohdsiDatabaseSchema, co } test_that("Run spot-checks at per-person level on PostgreSQL", { + skip_on_cran() skip_if_not(dbms == "postgresql") pgConnection <- createUnitTestData(pgConnectionDetails, pgCdmDatabaseSchema, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(pgConnection, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -194,6 +195,7 @@ test_that("Run spot-checks at per-person level on PostgreSQL", { }) test_that("Run spot-checks at per-person level on SQL Server", { + skip_on_cran() skip_if_not(dbms == "sql server") sqlServerConnection <- createUnitTestData(sqlServerConnectionDetails, sqlServerCdmDatabaseSchema, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(sqlServerConnection, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -201,6 +203,7 @@ test_that("Run spot-checks at per-person level on SQL Server", { }) test_that("Run spot-checks at per-person level on Oracle", { + skip_on_cran() skip_if_not(dbms == "oracle") oracleConnection <- createUnitTestData(oracleConnectionDetails, oracleCdmDatabaseSchema, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(oracleConnection, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -208,6 +211,7 @@ test_that("Run spot-checks at per-person level on Oracle", { }) test_that("Run spot-checks at per-person level on Redshift", { + skip_on_cran() skip_if_not(dbms == "redshift") redshiftConnection <- createUnitTestData(redshiftConnectionDetails, redshiftCdmDatabaseSchema, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(redshiftConnection, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -215,6 +219,7 @@ test_that("Run spot-checks at per-person level on Redshift", { }) test_that("Run spot-checks at per-person level on Eunomia", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) runSpotChecks(eunomiaConnection, eunomiaCdmDatabaseSchema, eunomiaOhdsiDatabaseSchema, cohortTable) }) diff --git a/tests/testthat/test-tidyCovariates.R b/tests/testthat/test-tidyCovariates.R index 59637f68..b9065de1 100644 --- a/tests/testthat/test-tidyCovariates.R +++ b/tests/testthat/test-tidyCovariates.R @@ -3,6 +3,7 @@ # covr::file_report(covr::file_coverage("R/Normalization.R", "tests/testthat/test-tidyCovariates.R")) test_that("Test exit conditions ", { + skip_on_cran() # Covariate Data object check expect_error(tidyCovariateData(covariateData = list())) # CovariateData object closed @@ -23,6 +24,7 @@ test_that("Test exit conditions ", { }) test_that("Test empty covariateData", { + skip_on_cran() cvData <- FeatureExtraction::createEmptyCovariateData( cohortIds = 1, aggregated = FALSE, @@ -33,6 +35,7 @@ test_that("Test empty covariateData", { }) test_that("tidyCovariates works", { + skip_on_cran() # Generate some data: createCovariate <- function(i, analysisId) { return(tibble( @@ -78,6 +81,7 @@ test_that("tidyCovariates works", { }) test_that("tidyCovariateData on Temporal Data", { + skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) covariateSettings <- createTemporalCovariateSettings( useDrugExposure = TRUE, From a6719f434cc0221cfcb2be60df6ed5069acb76e1 Mon Sep 17 00:00:00 2001 From: Ger Inberg Date: Tue, 20 Aug 2024 14:38:49 +0200 Subject: [PATCH 2/3] add package name --- tests/testthat/setup.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testthat/setup.R b/tests/testthat/setup.R index 1c438df7..dd59bcfa 100644 --- a/tests/testthat/setup.R +++ b/tests/testthat/setup.R @@ -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")), @@ -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")), @@ -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")), @@ -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")), From 351355ee20d22ea1affa5a9e3de992c358de9107 Mon Sep 17 00:00:00 2001 From: Ger Inberg Date: Tue, 20 Aug 2024 15:45:54 +0200 Subject: [PATCH 3/3] remove skip_on_cran --- tests/testthat/test-Aggregation.R | 1 - tests/testthat/test-CompareCohorts.R | 1 - tests/testthat/test-CovariateData.R | 5 --- .../testthat/test-DetailedCovariateSettings.R | 5 --- .../testthat/test-FeatureExtractionInternal.R | 2 - .../testthat/test-GetCohortBasedCovariates.R | 39 +------------------ tests/testthat/test-GetCovariates.R | 2 - .../test-GetCovariatesFromCohortAttributes.R | 3 -- .../test-GetCovariatesTemporalSequence.R | 3 -- tests/testthat/test-HelperFunctions.R | 1 - tests/testthat/test-PostcoordConcepts.R | 1 - tests/testthat/test-PrespecAnalyses.R | 1 - tests/testthat/test-Table1.R | 4 +- tests/testthat/test-query-no-fail.R | 20 ---------- tests/testthat/test-spot-checks.R | 5 --- tests/testthat/test-tidyCovariates.R | 4 -- 16 files changed, 2 insertions(+), 95 deletions(-) diff --git a/tests/testthat/test-Aggregation.R b/tests/testthat/test-Aggregation.R index 0466e740..39b291e3 100644 --- a/tests/testthat/test-Aggregation.R +++ b/tests/testthat/test-Aggregation.R @@ -30,7 +30,6 @@ test_that("aggregateCovariates works", { }) test_that("aggregateCovariates handles temporalCovariates", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) settings <- createTemporalCovariateSettings(useDemographicsGender = TRUE) covariateData <- getDbCovariateData( diff --git a/tests/testthat/test-CompareCohorts.R b/tests/testthat/test-CompareCohorts.R index feeb44d3..5952ea70 100644 --- a/tests/testthat/test-CompareCohorts.R +++ b/tests/testthat/test-CompareCohorts.R @@ -3,7 +3,6 @@ # covr::file_report(covr::file_coverage("R/CompareCohorts.R", "tests/testthat/test-CompareCohorts.R")) test_that("Test stdDiff continuous variable computation", { - skip_on_cran() # NOTE: Data stored in "inst/testdata/continuousCovariateData.zip" created by: # ------------------------------------------------------------------------------ # connectionDetails <- Eunomia::getEunomiaConnectionDetails() diff --git a/tests/testthat/test-CovariateData.R b/tests/testthat/test-CovariateData.R index 09e0ff1a..378a4e75 100644 --- a/tests/testthat/test-CovariateData.R +++ b/tests/testthat/test-CovariateData.R @@ -3,7 +3,6 @@ # covr::file_report(covr::file_coverage("R/CovariateData.R", "tests/testthat/test-CovariateData.R")) test_that("test CovariateData Class on Empty", { - skip_on_cran() skip_if_not(dbms == "sqlite") # create 4 scenarios of Covariate Data # 1) error (non class), 2) covariate data, 3) aggregatedCovariate Data, @@ -80,7 +79,6 @@ test_that("test saveCovariateData error cases", { }) test_that("test summary call for covariateData class", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) settings <- createDefaultCovariateSettings() covariateData <- getDbCovariateData( @@ -130,12 +128,10 @@ test_that("test filtering of covariates based on minCharacterizationMean", { }) test_that("test loadCovariateData", { - skip_on_cran() expect_error(loadCovariateData("errorPath")) }) test_that("Test exit/warning conditions", { - skip_on_cran() # Empty Directory test tempDir <- tempdir() expect_error(loadCovariateData(file = tempDir)) @@ -152,7 +148,6 @@ test_that("Test exit/warning conditions", { }) test_that("Test show method", { - skip_on_cran() cvData <- FeatureExtraction::createEmptyCovariateData(cohortIds = c(1, 2), aggregated = FALSE, temporal = FALSE) expect_invisible(show(cvData)) on.exit(rm(cvData)) diff --git a/tests/testthat/test-DetailedCovariateSettings.R b/tests/testthat/test-DetailedCovariateSettings.R index 53ccb16e..e2613896 100644 --- a/tests/testthat/test-DetailedCovariateSettings.R +++ b/tests/testthat/test-DetailedCovariateSettings.R @@ -1,6 +1,5 @@ # This file covers the code in DetailedCovariateData.R. View coverage for this file using test_that("test createDetailedCovariateSettings", { - skip_on_cran() analysisDetails <- createAnalysisDetails( analysisId = 1, sqlFileName = "DemographicsGender.sql", @@ -24,7 +23,6 @@ test_that("test createDetailedCovariateSettings", { }) test_that("test createDetailedTemporalCovariateSettings", { - skip_on_cran() analysisDetails <- createAnalysisDetails( analysisId = 1, sqlFileName = "DemographicsGender.sql", @@ -46,7 +44,6 @@ test_that("test createDetailedTemporalCovariateSettings", { }) test_that("test convertPrespecSettingsToDetailedSettings", { - skip_on_cran() settings <- createCovariateSettings(useDemographicsAgeGroup = TRUE, useChads2Vasc = TRUE) convertedSettings <- convertPrespecSettingsToDetailedSettings(settings) expect_s3_class(convertedSettings, "covariateSettings") @@ -55,13 +52,11 @@ test_that("test convertPrespecSettingsToDetailedSettings", { }) test_that("test createDefaultCovariateSettings", { - skip_on_cran() settings <- createDefaultCovariateSettings() expect_s3_class(settings, "covariateSettings") }) test_that("test createDefaultTemporalCovariateSettings", { - skip_on_cran() settings <- createDefaultTemporalCovariateSettings() expect_s3_class(settings, "covariateSettings") }) diff --git a/tests/testthat/test-FeatureExtractionInternal.R b/tests/testthat/test-FeatureExtractionInternal.R index 53140ebb..39c79dd3 100644 --- a/tests/testthat/test-FeatureExtractionInternal.R +++ b/tests/testthat/test-FeatureExtractionInternal.R @@ -3,14 +3,12 @@ # covr::file_report(covr::file_coverage("R/FeatureExtraction.R", "tests/testthat/test-FeatureExtractionInternal.R")) test_that("Test .onLoad()", { - skip_on_cran() expect_silent( FeatureExtraction:::.onLoad(libname = "FeatureExtraction", pkgname = "FeatureExtraction") ) }) test_that("Test JSON functions", { - skip_on_cran() expectedToJsonResult <- "{\"id\":\"1\"}" expectedFromJsonResult <- list("id" = "1") toJsonResult <- FeatureExtraction:::.toJson(expectedFromJsonResult) diff --git a/tests/testthat/test-GetCohortBasedCovariates.R b/tests/testthat/test-GetCohortBasedCovariates.R index 9eb662b3..fe17ae5f 100644 --- a/tests/testthat/test-GetCohortBasedCovariates.R +++ b/tests/testthat/test-GetCohortBasedCovariates.R @@ -476,7 +476,6 @@ runCohortBasedCountsAggMultiCohortTest <- function(connection, cdmDatabaseSchema # Eunomia tests ------------ test_that("Cohort-based covariates: binary, non-aggregated on Eunomia", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) runCohortBasedBinaryNonAggTest( connection = eunomiaConnection, @@ -498,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, @@ -575,7 +575,6 @@ test_that("Cohort-based covariates: counts, aggregated, using multiple cohort ID # Postgres tests ------------ test_that("Cohort-based covariates: binary, non-aggregated on Postgres", { - skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -588,7 +587,6 @@ test_that("Cohort-based covariates: binary, non-aggregated on Postgres", { }) test_that("Cohort-based covariates: binary, aggregated on Postgres", { - skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -601,7 +599,6 @@ test_that("Cohort-based covariates: binary, aggregated on Postgres", { }) test_that("Cohort-based covariates: binary, non-aggregated, temporal on Postgres", { - skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -614,7 +611,6 @@ test_that("Cohort-based covariates: binary, non-aggregated, temporal on Postgres }) test_that("Cohort-based covariates: binary, aggregated, temporal on Postgres", { - skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -627,7 +623,6 @@ test_that("Cohort-based covariates: binary, aggregated, temporal on Postgres", { }) test_that("Cohort-based covariates: counts, non-aggregated on Postgres", { - skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -640,7 +635,6 @@ test_that("Cohort-based covariates: counts, non-aggregated on Postgres", { }) test_that("Cohort-based covariates: counts, aggregated on Postgres", { - skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -653,7 +647,6 @@ test_that("Cohort-based covariates: counts, aggregated on Postgres", { }) test_that("Cohort-based covariates: counts, non-aggregated, temporal on Postgres", { - skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -666,7 +659,6 @@ test_that("Cohort-based covariates: counts, non-aggregated, temporal on Postgres }) test_that("Cohort-based covariates: counts, aggregated, temporal on Postgres", { - skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -679,7 +671,6 @@ test_that("Cohort-based covariates: counts, aggregated, temporal on Postgres", { }) test_that("Cohort-based covariates: counts, aggregated, using multiple cohort IDs on Postgres", { - skip_on_cran() skip_if_not(dbms == "postgresql") connection <- DatabaseConnector::connect(pgConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -693,7 +684,6 @@ test_that("Cohort-based covariates: counts, aggregated, using multiple cohort ID # SQL Server tests ------------ test_that("Cohort-based covariates: binary, non-aggregated on SQL Server", { - skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -706,7 +696,6 @@ test_that("Cohort-based covariates: binary, non-aggregated on SQL Server", { }) test_that("Cohort-based covariates: binary, aggregated on SQL Server", { - skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -719,7 +708,6 @@ test_that("Cohort-based covariates: binary, aggregated on SQL Server", { }) test_that("Cohort-based covariates: binary, non-aggregated, temporal on SQL Server", { - skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -732,7 +720,6 @@ test_that("Cohort-based covariates: binary, non-aggregated, temporal on SQL Serv }) test_that("Cohort-based covariates: binary, aggregated, temporal on SQL Server", { - skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -745,7 +732,6 @@ test_that("Cohort-based covariates: binary, aggregated, temporal on SQL Server", }) test_that("Cohort-based covariates: counts, non-aggregated on SQL Server", { - skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -758,7 +744,6 @@ test_that("Cohort-based covariates: counts, non-aggregated on SQL Server", { }) test_that("Cohort-based covariates: counts, aggregated on SQL Server", { - skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -771,7 +756,6 @@ test_that("Cohort-based covariates: counts, aggregated on SQL Server", { }) test_that("Cohort-based covariates: counts, non-aggregated, temporal on SQL Server", { - skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -784,7 +768,6 @@ test_that("Cohort-based covariates: counts, non-aggregated, temporal on SQL Serv }) test_that("Cohort-based covariates: counts, aggregated, temporal on SQL Server", { - skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -797,7 +780,6 @@ test_that("Cohort-based covariates: counts, aggregated, temporal on SQL Server", }) test_that("Cohort-based covariates: counts, aggregated, using multiple cohort IDs on SQL Server", { - skip_on_cran() skip_if_not(dbms == "sql server") connection <- DatabaseConnector::connect(sqlServerConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -811,7 +793,6 @@ test_that("Cohort-based covariates: counts, aggregated, using multiple cohort ID # Oracle tests ------------ test_that("Cohort-based covariates: binary, non-aggregated on Oracle", { - skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -824,7 +805,6 @@ test_that("Cohort-based covariates: binary, non-aggregated on Oracle", { }) test_that("Cohort-based covariates: binary, aggregated on Oracle", { - skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -837,7 +817,6 @@ test_that("Cohort-based covariates: binary, aggregated on Oracle", { }) test_that("Cohort-based covariates: binary, non-aggregated, temporal on Oracle", { - skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -850,7 +829,6 @@ test_that("Cohort-based covariates: binary, non-aggregated, temporal on Oracle", }) test_that("Cohort-based covariates: binary, aggregated, temporal on Oracle", { - skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -863,7 +841,6 @@ test_that("Cohort-based covariates: binary, aggregated, temporal on Oracle", { }) test_that("Cohort-based covariates: counts, non-aggregated on Oracle", { - skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -876,7 +853,6 @@ test_that("Cohort-based covariates: counts, non-aggregated on Oracle", { }) test_that("Cohort-based covariates: counts, aggregated on Oracle", { - skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -889,7 +865,6 @@ test_that("Cohort-based covariates: counts, aggregated on Oracle", { }) test_that("Cohort-based covariates: counts, non-aggregated, temporal on Oracle", { - skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -902,7 +877,6 @@ test_that("Cohort-based covariates: counts, non-aggregated, temporal on Oracle", }) test_that("Cohort-based covariates: counts, aggregated, temporal on Oracle", { - skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -915,7 +889,6 @@ test_that("Cohort-based covariates: counts, aggregated, temporal on Oracle", { }) test_that("Cohort-based covariates: counts, aggregated, using multiple cohort IDs on Oracle", { - skip_on_cran() skip_if_not(dbms == "oracle") connection <- DatabaseConnector::connect(oracleConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -929,7 +902,6 @@ test_that("Cohort-based covariates: counts, aggregated, using multiple cohort ID # RedShift tests ------------ test_that("Cohort-based covariates: binary, non-aggregated on RedShift", { - skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -942,7 +914,6 @@ test_that("Cohort-based covariates: binary, non-aggregated on RedShift", { }) test_that("Cohort-based covariates: binary, aggregated on RedShift", { - skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -955,7 +926,6 @@ test_that("Cohort-based covariates: binary, aggregated on RedShift", { }) test_that("Cohort-based covariates: binary, non-aggregated, temporal on RedShift", { - skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -968,7 +938,6 @@ test_that("Cohort-based covariates: binary, non-aggregated, temporal on RedShift }) test_that("Cohort-based covariates: binary, aggregated, temporal on RedShift", { - skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -981,7 +950,6 @@ test_that("Cohort-based covariates: binary, aggregated, temporal on RedShift", { }) test_that("Cohort-based covariates: counts, non-aggregated on RedShift", { - skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -994,7 +962,6 @@ test_that("Cohort-based covariates: counts, non-aggregated on RedShift", { }) test_that("Cohort-based covariates: counts, aggregated on RedShift", { - skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -1007,7 +974,6 @@ test_that("Cohort-based covariates: counts, aggregated on RedShift", { }) test_that("Cohort-based covariates: counts, non-aggregated, temporal on RedShift", { - skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -1020,7 +986,6 @@ test_that("Cohort-based covariates: counts, non-aggregated, temporal on RedShift }) test_that("Cohort-based covariates: counts, aggregated, temporal on RedShift", { - skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -1033,7 +998,6 @@ test_that("Cohort-based covariates: counts, aggregated, temporal on RedShift", { }) test_that("Cohort-based covariates: counts, aggregated, using multiple cohort IDs on RedShift", { - skip_on_cran() skip_if_not(dbms == "redshift") connection <- DatabaseConnector::connect(redshiftConnectionDetails) on.exit(DatabaseConnector::disconnect(connection)) @@ -1048,7 +1012,6 @@ test_that("Cohort-based covariates: counts, aggregated, using multiple cohort ID # Non-database specific tests --------------- test_that("Cohort-based covariates: warning if using pre-defined analysis ID", { - skip_on_cran() expect_warning( createCohortBasedCovariateSettings( analysisId = 1, diff --git a/tests/testthat/test-GetCovariates.R b/tests/testthat/test-GetCovariates.R index 42d75d64..1c4d1df7 100644 --- a/tests/testthat/test-GetCovariates.R +++ b/tests/testthat/test-GetCovariates.R @@ -34,7 +34,6 @@ getCovariateSettings <- function() { # } test_that("getDbCovariateData enforces specification of database details", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) # No database details specified expect_error(getDbCovariateData( @@ -73,7 +72,6 @@ test_that("getDbCovariateData CDM v4 not supported", { }) test_that("getDbCovariateData cohortTableIsTemp tests when table name lacks # symbol", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) result <- getDbCovariateData( connection = eunomiaConnection, diff --git a/tests/testthat/test-GetCovariatesFromCohortAttributes.R b/tests/testthat/test-GetCovariatesFromCohortAttributes.R index 952e521b..6f9aa30b 100644 --- a/tests/testthat/test-GetCovariatesFromCohortAttributes.R +++ b/tests/testthat/test-GetCovariatesFromCohortAttributes.R @@ -7,7 +7,6 @@ # covr::file_report(covr::file_coverage("R/GetCovariatesFromCohortAttributes.R", "tests/testthat/test-GetCovariatesFromCohortAttributes.R")) test_that("getDbCohortAttrCovariatesData aggregation not supported check", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) expect_error(getDbCohortAttrCovariatesData( connection = eunomiaConnection, @@ -18,7 +17,6 @@ test_that("getDbCohortAttrCovariatesData aggregation not supported check", { }) test_that("getDbCohortAttrCovariatesData CDM v4 not supported check", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) expect_error(getDbCohortAttrCovariatesData( connection = eunomiaConnection, @@ -72,7 +70,6 @@ test_that("getDbCohortAttrCovariatesData hasIncludedAttributes > 0", { }) test_that("createCohortAttrCovariateSettings check", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) result <- createCohortAttrCovariateSettings(attrDatabaseSchema = "main") expect_equal(class(result), "covariateSettings") diff --git a/tests/testthat/test-GetCovariatesTemporalSequence.R b/tests/testthat/test-GetCovariatesTemporalSequence.R index 45767243..8b1d4c11 100644 --- a/tests/testthat/test-GetCovariatesTemporalSequence.R +++ b/tests/testthat/test-GetCovariatesTemporalSequence.R @@ -3,7 +3,6 @@ # covr::file_report(covr::file_coverage("R/DefaultTemporalSequenceCovariateSettings.R", "tests/testthat/test-GetCovariatesTemporalSequence.R")) test_that("createTemporalSequenceCovariateSettings correctly sets list", { - skip_on_cran() settings <- createTemporalSequenceCovariateSettings( useDemographicsGender = T, useConditionEraGroupStart = T, @@ -31,7 +30,6 @@ test_that("createTemporalSequenceCovariateSettings correctly sets list", { test_that("createTemporalSequenceCovariateSettings correctly sets function", { - skip_on_cran() settings <- createTemporalSequenceCovariateSettings( useDemographicsGender = T, useConditionEraGroupStart = T, @@ -48,7 +46,6 @@ test_that("createTemporalSequenceCovariateSettings correctly sets function", { # check extraction test_that("getDbCovariateData works with createTemporalSequenceCovariateSettings", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) covSet <- createTemporalSequenceCovariateSettings( useDemographicsGender = T, diff --git a/tests/testthat/test-HelperFunctions.R b/tests/testthat/test-HelperFunctions.R index 398b84d8..fd9ab8e8 100644 --- a/tests/testthat/test-HelperFunctions.R +++ b/tests/testthat/test-HelperFunctions.R @@ -3,7 +3,6 @@ # covr::file_report(covr::file_coverage("R/HelperFunctions.R", "tests/testthat/test-HelperFunctions.R")) test_that("Test helper functions for non-aggregated covariate data", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) expect_error(filterByRowId("blah", 1), "not of class CovariateData") diff --git a/tests/testthat/test-PostcoordConcepts.R b/tests/testthat/test-PostcoordConcepts.R index 290954a6..e7e687b1 100644 --- a/tests/testthat/test-PostcoordConcepts.R +++ b/tests/testthat/test-PostcoordConcepts.R @@ -3,7 +3,6 @@ library(FeatureExtraction) library(dplyr) test_that("Postcoordinated concepts on Eunomia", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) # eunomiaConnection <- DatabaseConnector::connect(Eunomia::getEunomiaConnectionDetails()) cohort <- data.frame( diff --git a/tests/testthat/test-PrespecAnalyses.R b/tests/testthat/test-PrespecAnalyses.R index ad053819..20fb1b34 100644 --- a/tests/testthat/test-PrespecAnalyses.R +++ b/tests/testthat/test-PrespecAnalyses.R @@ -1,7 +1,6 @@ # This file contains tests for all the PrespecAnalyses files in the inst/csv folder. test_that("PrespecAnalyses check for uniqueness", { - skip_on_cran() analysesFiles <- list.files(system.file("csv", package = "FeatureExtraction"), pattern = "^.*.Analyses*.csv$", full.names = TRUE diff --git a/tests/testthat/test-Table1.R b/tests/testthat/test-Table1.R index 421c9b92..ad169f8e 100644 --- a/tests/testthat/test-Table1.R +++ b/tests/testthat/test-Table1.R @@ -3,7 +3,6 @@ # covr::file_report(covr::file_coverage("R/Table1.R", "tests/testthat/test-Table1.R")) test_that("getDefaultTable1Specifications works", { - skip_on_cran() spec <- getDefaultTable1Specifications() expect_s3_class(spec, "data.frame") expect_equal(names(spec), c("label", "analysisId", "covariateIds")) @@ -11,7 +10,6 @@ test_that("getDefaultTable1Specifications works", { test_that("createTable1 works with categorical covariates", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) settings <- createCovariateSettings( @@ -145,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, @@ -169,7 +168,6 @@ test_that("createTable1 works with other covariates", { }) test_that("createTable1CovariateSettings works", { - skip_on_cran() covariateSettings <- createTable1CovariateSettings() expect_s3_class(covariateSettings, "covariateSettings") }) diff --git a/tests/testthat/test-query-no-fail.R b/tests/testthat/test-query-no-fail.R index 98cdb33e..8605d038 100644 --- a/tests/testthat/test-query-no-fail.R +++ b/tests/testthat/test-query-no-fail.R @@ -143,7 +143,6 @@ runExtractionPerPerson <- function(connection, cdmDatabaseSchema, ohdsiDatabaseS } test_that("Run all analysis at per-person level on PostgreSQL", { - skip_on_cran() skip_if_not(dbms == "postgresql") pgConnection <- createUnitTestData(pgConnectionDetails, pgCdmDatabaseSchema, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(pgConnection, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -152,7 +151,6 @@ test_that("Run all analysis at per-person level on PostgreSQL", { }) test_that("Run all analysis at per-person level on SQL Server", { - skip_on_cran() skip_if_not(dbms == "sql server") sqlServerConnection <- createUnitTestData(sqlServerConnectionDetails, sqlServerCdmDatabaseSchema, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(sqlServerConnection, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -161,7 +159,6 @@ test_that("Run all analysis at per-person level on SQL Server", { }) test_that("Run all analysis at per-person level on Oracle", { - skip_on_cran() skip_if_not(dbms == "oracle") oracleConnection <- createUnitTestData(oracleConnectionDetails, oracleCdmDatabaseSchema, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(oracleConnection, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -170,7 +167,6 @@ test_that("Run all analysis at per-person level on Oracle", { }) test_that("Run all analysis at per-person level on Redshift", { - skip_on_cran() skip_if_not(dbms == "redshift") redshiftConnection <- createUnitTestData(redshiftConnectionDetails, redshiftCdmDatabaseSchema, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(redshiftConnection, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -179,7 +175,6 @@ test_that("Run all analysis at per-person level on Redshift", { }) test_that("Run all analysis at per-person level on Eunomia", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) covariateData <- runExtractionPerPerson(eunomiaConnection, eunomiaCdmDatabaseSchema, eunomiaOhdsiDatabaseSchema, cohortTable) expect_true(is(covariateData, "CovariateData")) @@ -329,7 +324,6 @@ runExtractionAggregated <- function(connection, cdmDatabaseSchema, ohdsiDatabase } test_that("Run all analysis at aggregated level on PostgreSQL", { - skip_on_cran() skip_if_not(dbms == "postgresql") pgConnection <- createUnitTestData(pgConnectionDetails, pgCdmDatabaseSchema, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(pgConnection, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -338,7 +332,6 @@ test_that("Run all analysis at aggregated level on PostgreSQL", { }) test_that("Run all analysis at aggregated level on SQL Server", { - skip_on_cran() skip_if_not(dbms == "sql server") sqlServerConnection <- createUnitTestData(sqlServerConnectionDetails, sqlServerCdmDatabaseSchema, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(sqlServerConnection, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -347,7 +340,6 @@ test_that("Run all analysis at aggregated level on SQL Server", { }) test_that("Run all analysis at aggregated level on Oracle", { - skip_on_cran() skip_if_not(dbms == "oracle") oracleConnection <- createUnitTestData(oracleConnectionDetails, oracleCdmDatabaseSchema, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(oracleConnection, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -356,7 +348,6 @@ test_that("Run all analysis at aggregated level on Oracle", { }) test_that("Run all analysis at aggregated level on Redshift", { - skip_on_cran() skip_if_not(dbms == "redshift") redshiftConnection <- createUnitTestData(redshiftConnectionDetails, redshiftCdmDatabaseSchema, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(redshiftConnection, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -365,7 +356,6 @@ test_that("Run all analysis at aggregated level on Redshift", { }) test_that("Run all analysis at aggregated level on Eunomia", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) covariateData <- runExtractionAggregated(eunomiaConnection, eunomiaCdmDatabaseSchema, eunomiaOhdsiDatabaseSchema, cohortTable) expect_true(is(covariateData, "CovariateData")) @@ -440,7 +430,6 @@ runExtractionTemporalPerPerson <- function(connection, cdmDatabaseSchema, ohdsiD } test_that("Run all temporalanalysis at per-person level on PostgreSQL", { - skip_on_cran() skip_if_not(dbms == "postgresql") pgConnection <- createUnitTestData(pgConnectionDetails, pgCdmDatabaseSchema, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(pgConnection, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -449,7 +438,6 @@ test_that("Run all temporalanalysis at per-person level on PostgreSQL", { }) test_that("Run all temporalanalysis at per-person level on SQL Server", { - skip_on_cran() skip_if_not(dbms == "sql server") sqlServerConnection <- createUnitTestData(sqlServerConnectionDetails, sqlServerCdmDatabaseSchema, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(sqlServerConnection, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -458,7 +446,6 @@ test_that("Run all temporalanalysis at per-person level on SQL Server", { }) test_that("Run all temporalanalysis at per-person level on Oracle", { - skip_on_cran() skip_if_not(dbms == "oracle") oracleConnection <- createUnitTestData(oracleConnectionDetails, oracleCdmDatabaseSchema, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(oracleConnection, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -467,7 +454,6 @@ test_that("Run all temporalanalysis at per-person level on Oracle", { }) test_that("Run all temporalanalysis at per-person level on Redshift", { - skip_on_cran() skip_if_not(dbms == "redshift") redshiftConnection <- createUnitTestData(redshiftConnectionDetails, redshiftCdmDatabaseSchema, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(redshiftConnection, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -476,7 +462,6 @@ test_that("Run all temporalanalysis at per-person level on Redshift", { }) test_that("Run all temporalanalysis at per-person level on Eunomia", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) covariateData <- runExtractionTemporalPerPerson(eunomiaConnection, eunomiaCdmDatabaseSchema, eunomiaOhdsiDatabaseSchema, cohortTable) expect_true(is(covariateData, "CovariateData")) @@ -552,7 +537,6 @@ runExtractionTemporalAggregated <- function(connection, cdmDatabaseSchema, ohdsi } test_that("Run all temporalanalysis at aggregated level on PostgreSQL", { - skip_on_cran() skip_if_not(dbms == "postgresql") pgConnection <- createUnitTestData(pgConnectionDetails, pgCdmDatabaseSchema, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(pgConnection, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -561,7 +545,6 @@ test_that("Run all temporalanalysis at aggregated level on PostgreSQL", { }) test_that("Run all temporalanalysis at aggregated level on SQL Server", { - skip_on_cran() skip_if_not(dbms == "sql server") sqlServerConnection <- createUnitTestData(sqlServerConnectionDetails, sqlServerCdmDatabaseSchema, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(sqlServerConnection, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -570,7 +553,6 @@ test_that("Run all temporalanalysis at aggregated level on SQL Server", { }) test_that("Run all temporalanalysis at aggregated level on Oracle", { - skip_on_cran() skip_if_not(dbms == "oracle") oracleConnection <- createUnitTestData(oracleConnectionDetails, oracleCdmDatabaseSchema, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(oracleConnection, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -579,7 +561,6 @@ test_that("Run all temporalanalysis at aggregated level on Oracle", { }) test_that("Run all temporalanalysis at aggregated level on Redshift", { - skip_on_cran() skip_if_not(dbms == "redshift") redshiftConnection <- createUnitTestData(redshiftConnectionDetails, redshiftCdmDatabaseSchema, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(redshiftConnection, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -588,7 +569,6 @@ test_that("Run all temporalanalysis at aggregated level on Redshift", { }) test_that("Run all temporalanalysis at aggregated level on Eunomia", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) covariateData <- runExtractionTemporalAggregated(eunomiaConnection, eunomiaCdmDatabaseSchema, eunomiaOhdsiDatabaseSchema, cohortTable) expect_true(is(covariateData, "CovariateData")) diff --git a/tests/testthat/test-spot-checks.R b/tests/testthat/test-spot-checks.R index 619af44f..4f11c4ce 100644 --- a/tests/testthat/test-spot-checks.R +++ b/tests/testthat/test-spot-checks.R @@ -187,7 +187,6 @@ runSpotChecks <- function(connection, cdmDatabaseSchema, ohdsiDatabaseSchema, co } test_that("Run spot-checks at per-person level on PostgreSQL", { - skip_on_cran() skip_if_not(dbms == "postgresql") pgConnection <- createUnitTestData(pgConnectionDetails, pgCdmDatabaseSchema, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(pgConnection, pgOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -195,7 +194,6 @@ test_that("Run spot-checks at per-person level on PostgreSQL", { }) test_that("Run spot-checks at per-person level on SQL Server", { - skip_on_cran() skip_if_not(dbms == "sql server") sqlServerConnection <- createUnitTestData(sqlServerConnectionDetails, sqlServerCdmDatabaseSchema, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(sqlServerConnection, sqlServerOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -203,7 +201,6 @@ test_that("Run spot-checks at per-person level on SQL Server", { }) test_that("Run spot-checks at per-person level on Oracle", { - skip_on_cran() skip_if_not(dbms == "oracle") oracleConnection <- createUnitTestData(oracleConnectionDetails, oracleCdmDatabaseSchema, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(oracleConnection, oracleOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -211,7 +208,6 @@ test_that("Run spot-checks at per-person level on Oracle", { }) test_that("Run spot-checks at per-person level on Redshift", { - skip_on_cran() skip_if_not(dbms == "redshift") redshiftConnection <- createUnitTestData(redshiftConnectionDetails, redshiftCdmDatabaseSchema, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable) on.exit(dropUnitTestData(redshiftConnection, redshiftOhdsiDatabaseSchema, cohortTable, cohortAttributeTable, attributeDefinitionTable)) @@ -219,7 +215,6 @@ test_that("Run spot-checks at per-person level on Redshift", { }) test_that("Run spot-checks at per-person level on Eunomia", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) runSpotChecks(eunomiaConnection, eunomiaCdmDatabaseSchema, eunomiaOhdsiDatabaseSchema, cohortTable) }) diff --git a/tests/testthat/test-tidyCovariates.R b/tests/testthat/test-tidyCovariates.R index b9065de1..59637f68 100644 --- a/tests/testthat/test-tidyCovariates.R +++ b/tests/testthat/test-tidyCovariates.R @@ -3,7 +3,6 @@ # covr::file_report(covr::file_coverage("R/Normalization.R", "tests/testthat/test-tidyCovariates.R")) test_that("Test exit conditions ", { - skip_on_cran() # Covariate Data object check expect_error(tidyCovariateData(covariateData = list())) # CovariateData object closed @@ -24,7 +23,6 @@ test_that("Test exit conditions ", { }) test_that("Test empty covariateData", { - skip_on_cran() cvData <- FeatureExtraction::createEmptyCovariateData( cohortIds = 1, aggregated = FALSE, @@ -35,7 +33,6 @@ test_that("Test empty covariateData", { }) test_that("tidyCovariates works", { - skip_on_cran() # Generate some data: createCovariate <- function(i, analysisId) { return(tibble( @@ -81,7 +78,6 @@ test_that("tidyCovariates works", { }) test_that("tidyCovariateData on Temporal Data", { - skip_on_cran() skip_if_not(dbms == "sqlite" && exists("eunomiaConnection")) covariateSettings <- createTemporalCovariateSettings( useDrugExposure = TRUE,