Running ‘spelling.R’
  Running ‘testthat.R’ [35s/42s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/tests.html
  > # * https://testthat.r-lib.org/reference/test_package.html#special-files
  > 
  > library(testthat)
  > library(SCDB)
  
  Attaching package: 'SCDB'
  
  The following object is masked from 'package:base':
  
      nrow
  
  > 
  > # Run the test using the default system connection
  > test_check("SCDB")
  [conflicted] Will prefer SCDB::id over any other package.
  No useful drivers (other than SQLite) were found!
  #####
  Following drivers will be tested:
    RSQLite::SQLite (SQLite)
  
  Following drivers were not found and will NOT be tested:
    RPostgres::Postgres (PostgreSQL)
    odbc::odbc (MSSQL)
  #####
  Error in `purrr::map_chr()`:
  i In index: 2.
  Caused by error:
  ! invalid 'envir' argument of type 'character'
  Backtrace:
       x
    1. +-logger$finalize() at test-Logger.R:209:5
    2. | +-dplyr::pull(...)
    3. | +-dplyr::count(dplyr::filter(self$log_tbl, log_file == !!self$log_filename))
    4. | \-dbplyr:::count.tbl_lazy(...)
    5. |   +-dplyr::tally(...)
    6. |   \-dbplyr:::tally.tbl_lazy(...)
    7. |     +-dplyr::summarise(x, `:=`(!!name, !!n), .groups = "drop")
    8. |     \-dbplyr:::summarise.tbl_lazy(x, `:=`(!!name, !!n), .groups = "drop")
    9. |       \-dbplyr:::summarise_eval_dots(.data, ...)
   10. |         \-dbplyr:::summarise_bind_error(cur_data, dots, i, error_env)
   11. |           \-dbplyr:::summarise_bind_error1(error_env, dot_name)
   12. |             \-cli::format_message(...)
   13. |               \-cli::cli_fmt(...)
   14. |                 \-cli:::cli__fmt(rec, collapse, strip_newline)
   15. |                   +-base::do.call(app[[msg$type]], msg$args)
   16. |                   \-cli (local) `<fn>`(text = `<named list>`, id = "cli-728136-35", class = NULL)
   17. |                     \-cli:::clii_bullets(app, text, id, class)
   18. |                       \-base::lapply(...)
   19. |                         \-cli (local) FUN(X[[i]], ...)
   20. |                           \-app$text(text[[i]])
   21. |                             \-cli:::clii_text(app, text)
   22. |                               \-app$xtext(text)
   23. |                                 \-cli:::clii__xtext(...)
   24. |                                   \-cli::ansi_strwrap(text, exdent = exdent, width = app$get_width(extra = padding))
   25. |                                     \-base::strwrap(xs, width = width, indent = indent, exdent = exdent)
   26. +-`<fn>`(`<Logger>`)
   27. | \-.subset2(e, "finalize")()
   28. |   +-dbplyr::build_sql(...)
   29. |   | \-purrr::map_chr(enexprs(...), escape_expr, con = con)
   30. |   |   \-purrr:::map_("character", .x, .f, ..., .progress = .progress)
   31. |   |     +-purrr:::with_indexed_errors(...)
   32. |   |     | \-base::withCallingHandlers(...)
   33. |   |     +-purrr:::call_with_cleanup(...)
   34. |   |     \-dbplyr (local) .f(.x[[i]], ...)
   35. |   |       \-rlang::eval_bare(x, .env)
   36. |   +-dbplyr::as.sql(id(self$log_tbl, conn = private$log_conn), con = private$log_conn)
   37. |   +-SCDB::id(self$log_tbl, conn = private$log_conn)
   38. |   \-SCDB:::id.tbl_dbi(self$log_tbl, conn = private$log_conn)
   39. |     +-base::with(...)
   40. |     \-base::with.default(...)
   41. |       \-base::eval(substitute(expr), data, enclos = parent.frame())
   42. \-base::.handleSimpleError(...)
   43.   \-purrr (local) h(simpleError(msg, call))
   44.     \-cli::cli_abort(...)
   45.       \-rlang::abort(...)
  [ FAIL 4 | WARN 1 | SKIP 0 | PASS 294 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-Logger.R:72:3'): Logger works ──────────────────────────────────
  Error in `h(simpleError(msg, call))`: error in evaluating the argument 'name' in selecting a method for function 'dbRemoveTable': invalid 'envir' argument of type 'character'
  Backtrace:
      ▆
   1. ├─logger$log_to_db(n_insertions = 42) at test-Logger.R:72:3
   2. │ ├─DBI::dbRemoveTable(...)
   3. │ ├─SCDB::id(patch, conn = private$log_conn, allow_table_only = FALSE)
   4. │ └─SCDB:::id.tbl_dbi(patch, conn = private$log_conn, allow_table_only = FALSE)
   5. │   ├─base::with(...)
   6. │   └─base::with.default(...)
   7. │     └─base::eval(substitute(expr), data, enclos = parent.frame())
   8. └─base::.handleSimpleError(...)
   9.   └─base (local) h(simpleError(msg, call))
  ── Error ('test-Logger.R:209:5'): Logger sets log_file to NULL in DB if not writing to file ──
  <purrr_error_indexed/rlang_error/error/condition>
  Error in `purrr::map_chr(enexprs(...), escape_expr, con = con)`: i In index: 2.
  Caused by error:
  ! invalid 'envir' argument of type 'character'
  Backtrace:
       ▆
    1. ├─logger$finalize() at test-Logger.R:209:5
    2. │ ├─dbplyr::build_sql(...)
    3. │ │ └─purrr::map_chr(enexprs(...), escape_expr, con = con)
    4. │ │   └─purrr:::map_("character", .x, .f, ..., .progress = .progress)
    5. │ │     ├─purrr:::with_indexed_errors(...)
    6. │ │     │ └─base::withCallingHandlers(...)
    7. │ │     ├─purrr:::call_with_cleanup(...)
    8. │ │     └─dbplyr (local) .f(.x[[i]], ...)
    9. │ │       └─rlang::eval_bare(x, .env)
   10. │ ├─dbplyr::as.sql(id(self$log_tbl, conn = private$log_conn), con = private$log_conn)
   11. │ ├─SCDB::id(self$log_tbl, conn = private$log_conn)
   12. │ └─SCDB:::id.tbl_dbi(self$log_tbl, conn = private$log_conn)
   13. │   ├─base::with(...)
   14. │   └─base::with.default(...)
   15. │     └─base::eval(substitute(expr), data, enclos = parent.frame())
   16. └─base::.handleSimpleError(...)
   17.   └─purrr (local) h(simpleError(msg, call))
   18.     └─cli::cli_abort(...)
   19.       └─rlang::abort(...)
  ── Error ('test-connection.R:45:3'): id() is consistent for DBI connections ────
  Error in `eval(substitute(expr), data, enclos = parent.frame())`: invalid 'envir' argument of type 'character'
  Backtrace:
      ▆
   1. ├─SCDB::id(dplyr::tbl(conn, DBI::Id(schema = "test", table = "mtcars"))) at test-connection.R:45:3
   2. └─SCDB:::id.tbl_dbi(dplyr::tbl(conn, DBI::Id(schema = "test", table = "mtcars")))
   3.   ├─base::with(...)
   4.   └─base::with.default(...)
   5.     └─base::eval(substitute(expr), data, enclos = parent.frame())
  ── Error ('test-update_snapshot.R:39:3'): update_snapshot() works ──────────────
  Error in `db_copy_to(dest$con, name, df, overwrite = overwrite, types = types, 
      temporary = temporary, unique_indexes = unique_indexes, indexes = indexes, 
      analyze = analyze, in_transaction = in_transaction, ...)`: Can't copy data to table `SCDB_log_patch`.
  Caused by error in `dplyr::db_write_table()`:
  ! Can't write table table `SCDB_log_patch`.
  Caused by error:
  ! Table `SCDB_log_patch` exists in database, and both overwrite and append are FALSE
  
  [ FAIL 4 | WARN 1 | SKIP 0 | PASS 294 ]
  Error: Test failures
  Execution halted