doc/local-tests.md
gh-ost is continuously tested in production via --test-on-replica alter='engine=innodb'. These tests check the GitHub workload and usage, but not necessarily the general case.
Local tests are an additional layer of tests used for continuous integration tests and local development.
Local tests test explicit use cases, such as column renames, mix of time zones, special types and alters. Traits of a single test:
engine=innodb, but this can be overridden per-testevent_scheduler.gh-ost is set to execute and throttle for 5 seconds, at which time all tested DMLs are expected to operate.--test-on-replica*) columns, but this can be overridden per-testTests are found under localtests. A single test is a subdirectory and tests are iterated alphabetically.
New data-integrity, synchronization issues or otherwise concerns are expected to be tested by new test cases.
Local tests can be run locally with docker compose using the helper script script/docker-gh-ost-replica-tests.
Example usage:
# create primary-replica containers with specified mysql image
TEST_MYSQL_IMAGE="mysql-server:8.0.16" ./script/docker-gh-ost-replica-tests up
# run all tests
./script/docker-gh-ost-replica-tests run
# cleanup containers
./script/docker-gh-ost-replica-tests down
Pass the -t flag to run the tests with a toxiproxy between gh-ost and the MySQL replica. This simulates network conditions where MySQL connections are closed unexpectedly.
# run tests with toxiproxy
./script/docker-gh-ost-replica-tests up -t
./script/docker-gh-ost-replica-tests run -t