BATS is used to integration test dolt. Our BATS tests started as a humble suite of integration tests. Over two years
of development the suite has grown to over 1,000 tests. When we find a customer facing bug in the dolt command line or
SQL implementation, we cover it with a BATS test. These tests are run on every dolt PR on Mac, Windows, and Linux using
GitHub Actions.
These tests are also useful documentation. If you are wondering how a certain command or feature works in practice,
using grep to find the appropriate BATS test can give you some simple examples of happy path and error case behavior.
The naming conventions for the test files have evolved over time. Generally, the files are named after the feature the
file intends to test. However, some of the early tests are named after the schema of the table they implement
ie. 1pk5col-ints.bats. These files were implemented to reuse setup and teardown logic. This scheme was quickly
abandoned but the legacy remains.
If you find a bug in dolt, we would love a skipped bats test PR in addition to a GitHub issue.
Running for yourself
Install bats.
npm install -g bats
Install dolt and its utilities.
cd go/cmd/dolt && go install . && cd -
cd go/store/cmd/noms && go install . && cd -
cd go/utils/remotesrv && go install . && cd -
Make sure you have python3 installed.
This came with my Mac Developer Tools and was on my PATH.
pip install mysql-connector-python, pip install pyarrow and pip install pandas
I also needed this specific version on the python mysql.connector. pip install mysql.connector mostly worked but caused some SSL errors.
I used Homebrew on Mac to install parquet. You also need to install hadoop and set PARQUET_RUNTIME_JAR to get bats to work. Here's what I ended up running.