Running ‘spelling.R’ [0s/1s]
  Running ‘testthat.R’ [8m/12m]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(PatientProfiles)
  > 
  > availableConnections <- list(list(
  +   con = DBI::dbConnect(duckdb::duckdb(), ":memory:"),
  +   write_schema = "main"
  + ))
  > 
  > # if (Sys.getenv("CDM5_REDSHIFT_DBNAME") != "") {
  > #   availableConnections <- availableConnections %>%
  > #     append(value = list(list(
  > #       con = DBI::dbConnect(
  > #         RPostgres::Redshift(),
  > #         dbname = Sys.getenv("CDM5_REDSHIFT_DBNAME"),
  > #         port = Sys.getenv("CDM5_REDSHIFT_PORT"),
  > #         host = Sys.getenv("CDM5_REDSHIFT_HOST"),
  > #         user = Sys.getenv("CDM5_REDSHIFT_USER"),
  > #         password = Sys.getenv("CDM5_REDSHIFT_PASSWORD")
  > #       ),
  > #       scratch_schema = Sys.getenv("CDM5_REDSHIFT_SCRATCH_SCHEMA"),
  > #       write_schema = Sys.getenv("CDM5_REDSHIFT_OHDSI_SCHEMA")
  > #     )))
  > # }
  > #
  > # if (Sys.getenv("CDM5_SQL_SERVER_USER") != "") {
  > #   availableConnections <- availableConnections %>%
  > #     append(value = list(list(
  > #       con = DBI::dbConnect(
  > #         odbc::odbc(),
  > #         Driver   = "ODBC Driver 18 for SQL Server",
  > #         Server   = Sys.getenv("CDM5_SQL_SERVER_SERVER"),
  > #         Database = Sys.getenv("CDM5_SQL_SERVER_CDM_DATABASE"),
  > #         UID      = Sys.getenv("CDM5_SQL_SERVER_USER"),
  > #         PWD      = Sys.getenv("CDM5_SQL_SERVER_PASSWORD"),
  > #         TrustServerCertificate = "yes",
  > #         Port     = 1433
  > #       ),
  > #       scratch_schema = Sys.getenv("CDM5_SQL_SERVER_OHDSI_SCHEMA"),
  > #       write_schema = Sys.getenv("CDM5_SQL_SERVER_OHDSI_SCHEMA")
  > #     )))
  > # }
  > 
  > 
  > for (k in seq_along(availableConnections)) {
  +   connectionDetails <- availableConnections[[k]]
  +   test_check("PatientProfiles")
  +   PatientProfiles:::disconnectMockCdm(connectionDetails)
  + }
  [ FAIL 9 | WARN 32 | SKIP 0 | PASS 477 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-checks.R:13:3'): test checkX: subject_id and person_id ─────────
  Error in `new_generated_cohort_set(cohort_ref = cdm[[cohort_table]], cohort_set_ref = cohort_set_ref, 
      cohort_count_ref = cohort_count_ref, cohort_attrition_ref = cohort_attrition_ref)`: cohort table column names should be cohort_definition_id, subject_id, cohort_start_date, cohort_end_date but are cohort_definition_id, subject_id, person_id, cohort_start_date!
  Backtrace:
      ▆
   1. └─PatientProfiles::mockPatientProfiles(connectionDetails, cohort1 = cohort1) at test-checks.R:13:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─CDMConnector::new_generated_cohort_set(...)
   4.       └─rlang::abort(glue::glue("cohort table column names should be {paste(expected_columns, collapse = ', ')} but are {paste(actual_columns, collapse = ', ')}!"))
  ── Error ('test-checks.R:96:3'): test #checkValue: multiple value   ────────────
  Error in `new_generated_cohort_set(cohort_ref = cdm[[cohort_table]], cohort_set_ref = cohort_set_ref, 
      cohort_count_ref = cohort_count_ref, cohort_attrition_ref = cohort_attrition_ref)`: cohort table column names should be cohort_definition_id, subject_id, cohort_start_date, cohort_end_date but are cohort_definition_id, subject_id, flag, cohort_start_date!
  Backtrace:
      ▆
   1. └─PatientProfiles::mockPatientProfiles(...) at test-checks.R:96:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─CDMConnector::new_generated_cohort_set(...)
   4.       └─rlang::abort(glue::glue("cohort table column names should be {paste(expected_columns, collapse = ', ')} but are {paste(actual_columns, collapse = ', ')}!"))
  ── Error ('test-mockPatientProfiles.R:28:3'): test user define table ───────────
  Error in `CDMConnector::cdm_from_con(con = db, cdm_schema = c(schema = writeSchema, 
      prefix = connectionDetails$mock_prefix), write_schema = c(schema = writeSchema, 
      prefix = connectionDetails$mock_prefix), cohort_tables = cohorts, 
      cdm_name = "PP_MOCK")`: CDM database tables should be either all upppercase or all lowercase!
  Backtrace:
      ▆
   1. └─PatientProfiles::mockPatientProfiles(connectionDetails, testTable1 = testTable1) at test-mockPatientProfiles.R:28:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─rlang::abort("CDM database tables should be either all upppercase or all lowercase!")
  ── Error ('test-mockPatientProfiles.R:50:3'): check working example with cohort table ──
  Error in `CDMConnector::cdm_from_con(con = db, cdm_schema = c(schema = writeSchema, 
      prefix = connectionDetails$mock_prefix), write_schema = c(schema = writeSchema, 
      prefix = connectionDetails$mock_prefix), cohort_tables = cohorts, 
      cdm_name = "PP_MOCK")`: CDM database tables should be either all upppercase or all lowercase!
  Backtrace:
      ▆
   1. └─PatientProfiles::mockPatientProfiles(connectionDetails, cohort1 = testTable1) at test-mockPatientProfiles.R:50:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─rlang::abort("CDM database tables should be either all upppercase or all lowercase!")
  ── Error ('test-mockPatientProfiles.R:61:3'): check working example with defaults ──
  Error in `CDMConnector::cdm_from_con(con = db, cdm_schema = c(schema = writeSchema, 
      prefix = connectionDetails$mock_prefix), write_schema = c(schema = writeSchema, 
      prefix = connectionDetails$mock_prefix), cohort_tables = cohorts, 
      cdm_name = "PP_MOCK")`: CDM database tables should be either all upppercase or all lowercase!
  Backtrace:
      ▆
   1. └─PatientProfiles::mockPatientProfiles(connectionDetails) at test-mockPatientProfiles.R:61:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─rlang::abort("CDM database tables should be either all upppercase or all lowercase!")
  ── Error ('test-mockPatientProfiles.R:69:3'): check dug exposure and patient table size ──
  Error in `CDMConnector::cdm_from_con(con = db, cdm_schema = c(schema = writeSchema, 
      prefix = connectionDetails$mock_prefix), write_schema = c(schema = writeSchema, 
      prefix = connectionDetails$mock_prefix), cohort_tables = cohorts, 
      cdm_name = "PP_MOCK")`: CDM database tables should be either all upppercase or all lowercase!
  Backtrace:
      ▆
   1. └─PatientProfiles::mockPatientProfiles(...) at test-mockPatientProfiles.R:69:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─rlang::abort("CDM database tables should be either all upppercase or all lowercase!")
  ── Error ('test-mockPatientProfiles.R:76:3'): add cdm with person, cohort1 and observation_period ──
  Error in `CDMConnector::cdm_from_con(con = db, cdm_schema = c(schema = writeSchema, 
      prefix = connectionDetails$mock_prefix), write_schema = c(schema = writeSchema, 
      prefix = connectionDetails$mock_prefix), cohort_tables = cohorts, 
      cdm_name = "PP_MOCK")`: CDM database tables should be either all upppercase or all lowercase!
  Backtrace:
      ▆
   1. └─PatientProfiles::mockPatientProfiles(...) at test-mockPatientProfiles.R:76:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─rlang::abort("CDM database tables should be either all upppercase or all lowercase!")
  ── Error ('test-mockPatientProfiles.R:120:3'): attributes for cohort table ─────
  Error in `CDMConnector::cdm_from_con(con = db, cdm_schema = c(schema = writeSchema, 
      prefix = connectionDetails$mock_prefix), write_schema = c(schema = writeSchema, 
      prefix = connectionDetails$mock_prefix), cohort_tables = cohorts, 
      cdm_name = "PP_MOCK")`: CDM database tables should be either all upppercase or all lowercase!
  Backtrace:
      ▆
   1. └─PatientProfiles::mockPatientProfiles(connectionDetails, testTable1 = testTable1) at test-mockPatientProfiles.R:120:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─rlang::abort("CDM database tables should be either all upppercase or all lowercase!")
  ── Error ('test-summariseCharacteristics.R:57:3'): test summariseCharacteristics ──
  Error in `CDMConnector::cdm_from_con(con = db, cdm_schema = c(schema = writeSchema, 
      prefix = connectionDetails$mock_prefix), write_schema = c(schema = writeSchema, 
      prefix = connectionDetails$mock_prefix), cohort_tables = cohorts, 
      cdm_name = "PP_MOCK")`: CDM database tables should be either all upppercase or all lowercase!
  Backtrace:
      ▆
   1. └─PatientProfiles::mockPatientProfiles(...) at test-summariseCharacteristics.R:57:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─rlang::abort("CDM database tables should be either all upppercase or all lowercase!")
  
  [ FAIL 9 | WARN 32 | SKIP 0 | PASS 477 ]
  Error: Test failures
  In addition: Warning messages:
  1: Connection is garbage-collected, use dbDisconnect() to avoid this. 
  2: Database is garbage-collected, use dbDisconnect(con, shutdown=TRUE) or duckdb::duckdb_shutdown(drv) to avoid this. 
  Execution halted
  Warning messages:
  1: Connection is garbage-collected, use dbDisconnect() to avoid this. 
  2: Database is garbage-collected, use dbDisconnect(con, shutdown=TRUE) or duckdb::duckdb_shutdown(drv) to avoid this.