Running ‘testthat.R’ [139s/204s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(healthcareai)
  > 
  > test_check("healthcareai")
  ── 1. Error: XGBoost deploy pushes values to SQLite (@test-XGBoost-deploy-pushes
  attempt to write a readonly database
  1: expect_output(writeData(SQLiteFileName = sqliteFile, df = outDf, tableName = "dermatologyDeployMulticlassBASE"), 
         "20 rows were inserted into the SQLite table dermatologyDeployMulticlassBASE") at testthat/test-XGBoost-deploy-pushes-to-sql.R:91
  2: quasi_capture(enquo(object), capture_output, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: capture_output_lines(code, print, width = width)
  5: eval_with_output(code, print = print, width = width)
  6: withr::with_output_sink(temp, withVisible(code))
  7: force(code)
  8: withVisible(code)
  9: eval_bare(get_expr(quo), get_env(quo))
  10: writeData(SQLiteFileName = sqliteFile, df = outDf, tableName = "dermatologyDeployMulticlassBASE")
  11: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  12: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  13: .local(conn, name, value, ...)
  14: tryCatch(rsqlite_bind_rows(rs@ptr, value), finally = dbClearResult(rs))
  15: tryCatchList(expr, classes, parentenv, handlers)
  16: rsqlite_bind_rows(rs@ptr, value)
  
  ── 2. Error: LMM deploy classification pushes values to SQLite (@test-deploy-pus
  attempt to write a readonly database
  1: expect_output(writeData(SQLiteFileName = sqliteFile, df = dfOut, tableName = "HCRDeployClassificationBASE"), 
         "50 rows were inserted into the SQLite table HCRDeployClassificationBASE") at testthat/test-deploy-pushes-to-sqlite.R:55
  2: quasi_capture(enquo(object), capture_output, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: capture_output_lines(code, print, width = width)
  5: eval_with_output(code, print = print, width = width)
  6: withr::with_output_sink(temp, withVisible(code))
  7: force(code)
  8: withVisible(code)
  9: eval_bare(get_expr(quo), get_env(quo))
  10: writeData(SQLiteFileName = sqliteFile, df = dfOut, tableName = "HCRDeployClassificationBASE")
  11: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  12: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  13: .local(conn, name, value, ...)
  14: tryCatch(rsqlite_bind_rows(rs@ptr, value), finally = dbClearResult(rs))
  15: tryCatchList(expr, classes, parentenv, handlers)
  16: rsqlite_bind_rows(rs@ptr, value)
  
  ── 3. Error: LMM deploy regression pushes values to SQLite (@test-deploy-pushes-
  attempt to write a readonly database
  1: expect_output(writeData(SQLiteFileName = sqliteFile, df = dfOut, tableName = "HCRDeployRegressionBASE"), 
         "50 rows were inserted into the SQLite table HCRDeployRegressionBASE") at testthat/test-deploy-pushes-to-sqlite.R:82
  2: quasi_capture(enquo(object), capture_output, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: capture_output_lines(code, print, width = width)
  5: eval_with_output(code, print = print, width = width)
  6: withr::with_output_sink(temp, withVisible(code))
  7: force(code)
  8: withVisible(code)
  9: eval_bare(get_expr(quo), get_env(quo))
  10: writeData(SQLiteFileName = sqliteFile, df = dfOut, tableName = "HCRDeployRegressionBASE")
  11: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  12: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  13: .local(conn, name, value, ...)
  14: tryCatch(rsqlite_bind_rows(rs@ptr, value), finally = dbClearResult(rs))
  15: tryCatchList(expr, classes, parentenv, handlers)
  16: rsqlite_bind_rows(rs@ptr, value)
  
  ── 4. Error: Lasso deploy classification pushes values to SQLite (@test-deploy-p
  attempt to write a readonly database
  1: expect_output(writeData(SQLiteFileName = sqliteFile, df = dfOut, tableName = "HCRDeployClassificationBASE"), 
         "50 rows were inserted into the SQLite table HCRDeployClassificationBASE") at testthat/test-deploy-pushes-to-sqlite.R:112
  2: quasi_capture(enquo(object), capture_output, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: capture_output_lines(code, print, width = width)
  5: eval_with_output(code, print = print, width = width)
  6: withr::with_output_sink(temp, withVisible(code))
  7: force(code)
  8: withVisible(code)
  9: eval_bare(get_expr(quo), get_env(quo))
  10: writeData(SQLiteFileName = sqliteFile, df = dfOut, tableName = "HCRDeployClassificationBASE")
  11: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  12: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  13: .local(conn, name, value, ...)
  14: tryCatch(rsqlite_bind_rows(rs@ptr, value), finally = dbClearResult(rs))
  15: tryCatchList(expr, classes, parentenv, handlers)
  16: rsqlite_bind_rows(rs@ptr, value)
  
  ── 5. Error: Lasso deploy regression pushes values to SQLite (@test-deploy-pushe
  attempt to write a readonly database
  1: expect_output(writeData(SQLiteFileName = sqliteFile, df = dfOut, tableName = "HCRDeployRegressionBASE"), 
         "50 rows were inserted into the SQLite table HCRDeployRegressionBASE") at testthat/test-deploy-pushes-to-sqlite.R:138
  2: quasi_capture(enquo(object), capture_output, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: capture_output_lines(code, print, width = width)
  5: eval_with_output(code, print = print, width = width)
  6: withr::with_output_sink(temp, withVisible(code))
  7: force(code)
  8: withVisible(code)
  9: eval_bare(get_expr(quo), get_env(quo))
  10: writeData(SQLiteFileName = sqliteFile, df = dfOut, tableName = "HCRDeployRegressionBASE")
  11: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  12: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  13: .local(conn, name, value, ...)
  14: tryCatch(rsqlite_bind_rows(rs@ptr, value), finally = dbClearResult(rs))
  15: tryCatchList(expr, classes, parentenv, handlers)
  16: rsqlite_bind_rows(rs@ptr, value)
  
  ── 6. Error: rf deploy classification pushes values to SQLite (@test-deploy-push
  attempt to write a readonly database
  1: expect_output(writeData(SQLiteFileName = sqliteFile, df = dfOut, tableName = "HCRDeployClassificationBASE"), 
         "50 rows were inserted into the SQLite table HCRDeployClassificationBASE") at testthat/test-deploy-pushes-to-sqlite.R:166
  2: quasi_capture(enquo(object), capture_output, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: capture_output_lines(code, print, width = width)
  5: eval_with_output(code, print = print, width = width)
  6: withr::with_output_sink(temp, withVisible(code))
  7: force(code)
  8: withVisible(code)
  9: eval_bare(get_expr(quo), get_env(quo))
  10: writeData(SQLiteFileName = sqliteFile, df = dfOut, tableName = "HCRDeployClassificationBASE")
  11: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  12: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  13: .local(conn, name, value, ...)
  14: tryCatch(rsqlite_bind_rows(rs@ptr, value), finally = dbClearResult(rs))
  15: tryCatchList(expr, classes, parentenv, handlers)
  16: rsqlite_bind_rows(rs@ptr, value)
  
  ── 7. Error: rf deploy regression pushes values to SQLite (@test-deploy-pushes-t
  attempt to write a readonly database
  1: expect_output(writeData(SQLiteFileName = sqliteFile, df = dfOut, tableName = "HCRDeployRegressionBASE"), 
         "50 rows were inserted into the SQLite table HCRDeployRegressionBASE") at testthat/test-deploy-pushes-to-sqlite.R:192
  2: quasi_capture(enquo(object), capture_output, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: capture_output_lines(code, print, width = width)
  5: eval_with_output(code, print = print, width = width)
  6: withr::with_output_sink(temp, withVisible(code))
  7: force(code)
  8: withVisible(code)
  9: eval_bare(get_expr(quo), get_env(quo))
  10: writeData(SQLiteFileName = sqliteFile, df = dfOut, tableName = "HCRDeployRegressionBASE")
  11: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  12: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  13: .local(conn, name, value, ...)
  14: tryCatch(rsqlite_bind_rows(rs@ptr, value), finally = dbClearResult(rs))
  15: tryCatchList(expr, classes, parentenv, handlers)
  16: rsqlite_bind_rows(rs@ptr, value)
  
  ── 8. Error: SQLite - inserts df successfully into table (@test-write-data.r#14)
  attempt to write a readonly database
  1: expect_output(writeData(df = df, SQLiteFileName = sqliteFile, tableName = "HCRWriteData"), 
         "3 rows were inserted into the SQLite table HCRWriteData") at testthat/test-write-data.r:14
  2: quasi_capture(enquo(object), capture_output, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: capture_output_lines(code, print, width = width)
  5: eval_with_output(code, print = print, width = width)
  6: withr::with_output_sink(temp, withVisible(code))
  7: force(code)
  8: withVisible(code)
  9: eval_bare(get_expr(quo), get_env(quo))
  10: writeData(df = df, SQLiteFileName = sqliteFile, tableName = "HCRWriteData")
  11: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  12: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  13: .local(conn, name, value, ...)
  14: tryCatch(rsqlite_bind_rows(rs@ptr, value), finally = dbClearResult(rs))
  15: tryCatchList(expr, classes, parentenv, handlers)
  16: rsqlite_bind_rows(rs@ptr, value)
  
  ── 9. Error: SQLite - insert df into table that didn't exist (@test-write-data.r
  attempt to write a readonly database
  1: expect_output(writeData(df = df, SQLiteFileName = sqliteFile, tableName = "HCRWriteData1"), 
         "3 rows were inserted into the SQLite table HCRWriteData1") at testthat/test-write-data.r:43
  2: quasi_capture(enquo(object), capture_output, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: capture_output_lines(code, print, width = width)
  5: eval_with_output(code, print = print, width = width)
  6: withr::with_output_sink(temp, withVisible(code))
  7: force(code)
  8: withVisible(code)
  9: eval_bare(get_expr(quo), get_env(quo))
  10: writeData(df = df, SQLiteFileName = sqliteFile, tableName = "HCRWriteData1")
  ...
  15: dbExecute(conn, sql)
  16: dbSendStatement(conn, statement, ...)
  17: dbSendStatement(conn, statement, ...)
  18: dbSendQuery(conn, statement, ...)
  19: dbSendQuery(conn, statement, ...)
  20: .local(conn, statement, ...)
  21: new("SQLiteResult", sql = statement, ptr = rsqlite_send_query(conn@ptr, statement), 
         conn = conn)
  22: initialize(value, ...)
  23: initialize(value, ...)
  24: rsqlite_send_query(conn@ptr, statement)
  
  ── 10. Error: SQLite - check that table exists after inserting (@test-write-data
  attempt to write a readonly database
  1: capture.output(writeData(df = df, SQLiteFileName = sqliteFile, tableName = "HCRWriteData2")) at testthat/test-write-data.r:63
  2: evalVis(expr)
  3: withVisible(eval(expr, pf))
  4: eval(expr, pf)
  5: eval(expr, pf)
  6: writeData(df = df, SQLiteFileName = sqliteFile, tableName = "HCRWriteData2")
  7: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  8: DBI::dbWriteTable(conn = con, name = tableName, value = df, append = TRUE)
  9: .local(conn, name, value, ...)
  10: dbExecute(conn, sql)
  11: dbExecute(conn, sql)
  12: dbSendStatement(conn, statement, ...)
  13: dbSendStatement(conn, statement, ...)
  14: dbSendQuery(conn, statement, ...)
  15: dbSendQuery(conn, statement, ...)
  16: .local(conn, statement, ...)
  17: new("SQLiteResult", sql = statement, ptr = rsqlite_send_query(conn@ptr, statement), 
         conn = conn)
  18: initialize(value, ...)
  19: initialize(value, ...)
  20: rsqlite_send_query(conn@ptr, statement)
  
  Preparing data... 
  Building model... 
  Generating predictions... 
  Generating confusion matrix... 
  Confusion Matrix and Statistics
  
           True
  Predicted one two five six three four
      one    22   0    0   0     0    0
      two     0  12    0   0     0    1
      five    0   0   10   0     1    0
      six     0   0    0   4     0    0
      three   0   0    0   0    13    0
      four    0   0    0   0     0    8
  
  Overall Statistics
                                            
                 Accuracy : 0.9718          
                   95% CI : (0.9019, 0.9966)
      No Information Rate : 0.3099          
      P-Value [Acc > NIR] : < 2.2e-16       
                                            
                    Kappa : 0.9647          
   Mcnemar's Test P-Value : NA              
  
  Statistics by Class:
  
                       Class: one Class: two Class: five Class: six Class: three
  Sensitivity              1.0000     1.0000      1.0000    1.00000       0.9286
  Specificity              1.0000     0.9831      0.9836    1.00000       1.0000
  Pos Pred Value           1.0000     0.9231      0.9091    1.00000       1.0000
  Neg Pred Value           1.0000     1.0000      1.0000    1.00000       0.9828
  Prevalence               0.3099     0.1690      0.1408    0.05634       0.1972
  Detection Rate           0.3099     0.1690      0.1408    0.05634       0.1831
  Detection Prevalence     0.3099     0.1831      0.1549    0.05634       0.1831
  Balanced Accuracy        1.0000     0.9915      0.9918    1.00000       0.9643
                       Class: four
  Sensitivity               0.8889
  Specificity               1.0000
  Pos Pred Value            1.0000
  Neg Pred Value            0.9841
  Prevalence                0.1268
  Detection Rate            0.1127
  Detection Prevalence      0.1127
  Balanced Accuracy         0.9444
  Generating confusion matrix... 
  Confusion Matrix and Statistics
  
           True
  Predicted one two five six three four
      one    22   0    0   0     0    0
      two     0  12    0   0     0    1
      five    0   0   10   0     1    0
      six     0   0    0   4     0    0
      three   0   0    0   0    13    0
      four    0   0    0   0     0    8
  
  Overall Statistics
                                            
                 Accuracy : 0.9718          
                   95% CI : (0.9019, 0.9966)
      No Information Rate : 0.3099          
      P-Value [Acc > NIR] : < 2.2e-16       
                                            
                    Kappa : 0.9647          
   Mcnemar's Test P-Value : NA              
  
  Statistics by Class:
  
                       Class: one Class: two Class: five Class: six Class: three
  Sensitivity              1.0000     1.0000      1.0000    1.00000       0.9286
  Specificity              1.0000     0.9831      0.9836    1.00000       1.0000
  Pos Pred Value           1.0000     0.9231      0.9091    1.00000       1.0000
  Neg Pred Value           1.0000     1.0000      1.0000    1.00000       0.9828
  Prevalence               0.3099     0.1690      0.1408    0.05634       0.1972
  Detection Rate           0.3099     0.1690      0.1408    0.05634       0.1831
  Detection Prevalence     0.3099     0.1831      0.1549    0.05634       0.1831
  Balanced Accuracy        1.0000     0.9915      0.9918    1.00000       0.9643
                       Class: four
  Sensitivity               0.8889
  Specificity               1.0000
  Pos Pred Value            1.0000
  Neg Pred Value            0.9841
  Prevalence                0.1268
  Detection Rate            0.1127
  Detection Prevalence      0.1127
  Balanced Accuracy         0.9444
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 492 SKIPPED: 15 FAILED: 10
  1.  Error: XGBoost deploy pushes values to SQLite (@test-XGBoost-deploy-pushes-to-sql.R#91) 
  2.  Error: LMM deploy classification pushes values to SQLite (@test-deploy-pushes-to-sqlite.R#55) 
  3.  Error: LMM deploy regression pushes values to SQLite (@test-deploy-pushes-to-sqlite.R#82) 
  4.  Error: Lasso deploy classification pushes values to SQLite (@test-deploy-pushes-to-sqlite.R#112) 
  5.  Error: Lasso deploy regression pushes values to SQLite (@test-deploy-pushes-to-sqlite.R#138) 
  6.  Error: rf deploy classification pushes values to SQLite (@test-deploy-pushes-to-sqlite.R#166) 
  7.  Error: rf deploy regression pushes values to SQLite (@test-deploy-pushes-to-sqlite.R#192) 
  8.  Error: SQLite - inserts df successfully into table (@test-write-data.r#14) 
  9.  Error: SQLite - insert df into table that didn't exist (@test-write-data.r#43) 
  10. Error: SQLite - check that table exists after inserting (@test-write-data.r#63) 
  
  Error: testthat unit tests failed
  Execution halted