Charmed MySQL

  • By Canonical Data Platform
  • Cloud
Channel Revision Published Runs on
8.0/stable 196 29 Sep 2023
Ubuntu 22.04
8.0/candidate 196 27 Sep 2023
Ubuntu 22.04
8.0/beta 196 25 Sep 2023
Ubuntu 22.04
8.0/edge 196 08 Sep 2023
Ubuntu 22.04
juju deploy mysql --channel 8.0/stable
Show information




:information_source: Hint: Use Juju 3. Otherwise replace juju run ... with juju run-action --wait ... for Juju 2.9.

There are a lot of test types available and most of them are well applicable for Charmed MySQL. Here is a list prepared by Canonical:

  • Smoke test
  • Unit tests
  • Integration tests
  • System test
  • Performance test

Smoke test

Complexity: trivial
Speed: fast
Goal: ensure basic functionality works over short amount of time.

Setup an Juju 3.x environment, deploy DB with test application and start “continuous write” test:

juju add-model smoke-test

juju deploy mysql --channel 8.0/edge --config profile=testing
juju add-unit mysql -n 2 # (optional)

juju deploy mysql-test-app --channel latest/edge
juju relate mysql-test-app mysql:database

# Make sure random data inserted into DB by test application:
juju run mysql-test-app/leader get-inserted-data

# Start "continuous write" test:
juju run mysql-test-app/leader start-continuous-writes
export password=$(juju run mysql/leader get-password username=root | yq '.. | select(. | has("password")).password')
watch -n1 -x juju ssh mysql/leader "mysql -h -uroot -p${password} -e \"select count(*) from\""

# Watch the counter is growing!

Expected results:

  • mysql-test-app continuously inserts records in database continuous_writes_database table data.
  • the counters (amount of records in table) are growing on all cluster members


# Stop "continuous write" test
juju run mysql-test-app/leader stop-continuous-writes

# Truncate "continuous write" table (delete all records from DB)
juju run mysql-test-app/leader clear-continuous-writes

Unit tests

Please check the “Contributing” guide and follow tox run -e unit examples there.

Integration tests

Please check the “Contributing” guide and follow tox run -e integration examples there.

System test

Please check/deploy the charm mysql-bundle (Git). It deploy and test all the necessary parts at once.

Performance test

Please check the separate document.

Help us improve this documentation

Most of this documentation can be collaboratively discussed and changed on the respective topic in the doc category of the Charmhub forum. See the documentation guidelines if you’d like to contribute.

Last updated 25 days ago. Help improve this document in the forum.