Test runner: Utility to run generated tests

Runs SQL script(s) that tests that the content of the database has not changed. The scripts are presumed to be generated by Utility to generate test queries. Python module, but can be also written manually or generated by other tools as long as the query produces a string column named “passed” that contains values passed or failed.

Used by The gen_dbt_cwl Module.

Usage

python -m dorieh.platform.dbt.dbt_runner [-h] --script SCRIPT [SCRIPT ...]
    [--autocommit] [--db DB] [--connection CONNECTION]
    [--verbose] [--table TABLE]

Options:

Options

Option

Alias

Description

--help

-h

Show this help message and exit

--script SCRIPT [SCRIPT...]

-s SCRIPT [SCRIPT...]

Path to the file(s) containing test scripts to execute

--autocommit

Use autocommit, default: False

--database DB

--db DB

Path to a database connection parameters file, default: database.ini (in the working directory)

--connection CONNECTION

--connection_name CONNECTION

Section in the database connection parameters file

--table TABLE

-t TABLE

Name of the table to test, default: None

--verbose

Verbose output, default: False

Details

A utility that executes test cases generated by dorieh.platform.dbt.create_test.py tool.

exception TestFailedError[source]
class DBTRunner(context: Optional[DBTConfig] = None)[source]
reset()[source]
run()[source]
run_script(script, cnxn)[source]
classmethod report_row(row: List, lengths: List[int]) str[source]
test()[source]