Skip to content

Latest commit

 

History

History
36 lines (20 loc) · 1.24 KB

HACKING.md

File metadata and controls

36 lines (20 loc) · 1.24 KB

Build Status

Hacking mysql_query module/role

This module is TDD, the setup is inspired by ansible module-unit-tests (although the tests here are no strict unit-tests, as they interact with a database).

development setup

pipenv

For python-development it's common to use pipenv.

Combined with direnv you just need to cd into this directory.

database

I recommend to use docker-compose for the development infrastructure, but any MySQL/MariaDB-Server should do (e.g.: installed via your local package-manager, run via docker directly).

Start the mariadb container with docker-compose:

$ docker-compose up -d

Then tests are executable via:

$ pytest tests/

or use your favorite IDE (e.g. PyCharm) to execute your tests.

If you don't use the docker-compose file, you might need to pass the db-connection settings via env, see settings.py for available options, e.g:

$ MYSQL_PASSWORD=secret pytest tests/