mysqltest #5
Description
A way to functionally test mysql by loading an example database
- Tags:
- databases ›
Overview
Mysqltest is a brief functional test that provides the following:
- Creates and loads a sample mysql database
- Execute simple functional tests from the mysql-testsuite package
-
Execute Lightweight stress tests on the sample database loaded by the dbload option
juju deploy mysqltest juju deploy mysql juju add-relation mysql:db-admin mysqltest:db-admin
The charm uses juju actions. To run the simple database execute the following command:
juju action do mysqltest/0 dbload
This will return an id that can be used to fetch the results:
juju action fetch --wait 0 id_value
Similarly actions can invoke the other options
juju action do mysqltest/0 {testsuite or stress}
This charm provides the option to run simple funtional or stress tests. The options in the config.yaml file that can be set is the test-type variable. The options are dbload, testsuite, or stress by default dbload is set. The option can be changed with the following command:
Descrptions of test-type option
- dbload - load a sample database
- testsuite - run a basic subset functional tests supplied by mysql-testsuite.
- stress - run a lightweight stress test on the sample database loaded by dbload
NOTES:
- The sample database can be downloaded from launchpad at the following location: https://launchpad.net/test-db/employees-db-1/1.0.6/+download/employees_db-full-1.0.6.tar.bz2
The database contains about 300,000 employee records with 2.8 million salary entries. The export data is 167 MB, which is not huge, but heavy enough to be non-trivial for testing.
TODO
-
Add more tests to the testsuite option. This will be easier in mysql 5.7 when the --do-test-list=file option is available and I can specify test cases instead of the wildcard function using the --do-test option
-
Add a heavier stress test such as mysql-stress-test.pl or run the Performance Schema suite provided by mysqltestsuite