Files
dolt/bats
..
2020-05-05 10:27:53 -07:00
2020-05-21 14:59:35 -05:00
2020-05-29 10:22:28 -07:00
2020-05-22 08:41:35 -05:00
2020-08-10 10:03:37 -07:00
2020-05-26 08:44:11 -07:00
2020-05-07 10:41:15 -07:00
2020-08-04 14:54:50 -07:00
2020-02-25 11:09:32 -08:00
2020-05-27 13:51:54 -07:00
2020-06-29 08:31:18 -07:00
2020-09-01 13:57:46 -07:00
2020-06-23 14:43:19 -07:00
2020-05-22 08:55:17 -05:00
2020-08-21 12:22:09 -07:00
2020-08-21 12:22:09 -07:00
2020-08-13 16:02:24 -07:00
2020-08-21 12:22:09 -07:00

BATS - Bash Automated Testing System

We are going to use bats to test the dolt command line.

First you need to install bats.

npm install -g bats

Then, go to the directory with the bats tests and run:

bats . 

This will run all the tests. Specify a particular .bats file to run only those tests.

Here Docs

BATS tests in Dolt make extensive use of Here Docs. Common patterns include piping SQL scripts to dolt sql:

    dolt sql <<SQL
CREATE TABLE my_table (pk int PRIMARY KEY);
SQL

And creating data files for import:

    cat <<DELIM > data.csv
pk,c1,c2
1,1,1
2,2,2
DELIM
    dolt table import -c -pk=pk my_table data.csv

Skipped BATS

Various tests are skipped as TODOs and/or as documentation of known bugs. Eg:

@test "..." {
    ...
    skip "this test is currently failing because..."
}

Skipped BATS can still be partially useful for testing as they execute normally up to skip statement.