-
Notifications
You must be signed in to change notification settings - Fork 86
Testing your changes
Tests are extremely important for stability of stuff in this repository, so:
-
cover your changes as completely as possible
-
be sure your tests cover
check_mode
if applicable -
be sure that functionality that can be affected by your changes is also covered, if not, cover it
We are assuming that you:
-
downloaded community.mysql repository
-
made some changes
-
added integration tests that cover your changes to one of the files in the
tests/integration/targets/test_mysql_*
directory (or you just want to run existing tests in order to check that your changes do not break currently covered code) -
if you do not know how to add tests for your case, create a pull request and ask other contributors there for help
-
Install docker daemon on your system, run it.
-
Download ansible-base repository.
-
Go to the ansible-base repository root directory.
-
Run
source hacking/env-setup
.
-
Be sure you ran
source hacking/env-setup
as described above. -
Go to the
community.mysql
repository root directory. -
Run (change
test_mysql_query
to an appropriate test directory name):ansible-test integration test_mysql_query --docker --docker-no-pull -vvv > /tmp/test.log
Be sure you use default docker container, use the
--docker default
or just--docker
command-line option. -
If something goes wrong, you can check the output stored in
/tmp/test.log
.
To run sanity tests:
-
Be sure you ran
source hacking/env-setup
as described above. -
Run (change
mysql_query.py
to an appropriate file path):ansible-test sanity plugins/modules/mysql_query.py --docker --docker-no-pull
Be sure you use default docker container, use the
--docker default
or just--docker
command-line option.
-
You can just create a pull request in this repository and all sanity and integration tests (including yours) will run here automatically and you'll get a detailed report
-
Create a pull request and ask other contributors to help with running tests locally there.