test_database: Test Database

Description Usage Arguments Value Examples

Description

A test executor that iterates over multiple datasources and executes the testing suite on each. Output is organized in such a way as to give nice, consolidated results.

Usage

1
2
3
4
test_database(datasource = NULL, tests = pkg_test(), skip = NULL, ...,
  return_list = TRUE)

test_databases(datasource = NULL, tests = pkg_test())

Arguments

datasource

optional Defaults to using a SQLite database. Pass "dsn" to use all DSNs available on the system. Use "config" or a path to a "config.yml" file to use connection parameters in a YAML file. Connection parameters will be passed to 'dbConnect' as-is

tests

optional A character vector of yaml tests to execute. References 'dbtest' test suite by default

skip

optional The path to one or more YAML files that will be used to skip tests

...

Additional parameters passed on to methods

return_list

optional Whether to return a list of 'dbtest_results' objects. Defaults to TRUE. Provide FALSE if you desire a single database test to return a 'dbtest_results' object directly.

Value

Returns a list of lists containing the respective datasource labels and testthat output

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# test all dsns with default test suite -----------------------
## Not run: 
test_database(datasource = "dsn")

## End(Not run)
# test sqlite with custom suite -------------------------
## Not run: 
test_database(tests = "./path/to/my.yml")

## End(Not run)
# test connection yaml file with default test suite -----------
## Not run: 
test_database(datasource = "./path/to/conn.yml")

## End(Not run)

rstudio/dbtest documentation built on May 6, 2019, 10:47 a.m.