This is a set of changes mostly focused around on making it easier to test mazer.
This includes some config tweaks to let the configs be injected by tests or overridden by env VARS
add MAZER_HOME to define where whatever the equilivent of ~/.ansible is
so MAZER_HOME=/tmp/some_test_home can point to a different set of configs/logs/tmp/etc
MAZER_HOME can also be injected/monkeypatched by unit tests to avoid dragging default ~/.ansible configs into test runs
py test conftest sets MAZER_HOME to tests/_mazer_home
tests/_mazer_home/mazer.yml points content roots to relative path 'user_collections/' which ends up being tests/_mazer_work_dir/user_collections/ for the unit tests runs
py test conftest changes dir to tests/_mazer_work_dir before running tests. Could be replaced with a tmp dir at some point.
One motivation for this is that tox doesn't change $HOME or the current user so all the code that uses
~/.ansible based paths (config, logging config, etc) ends up being used by unit tests. If config or logging config do something (like use a custom log handler) the tox tests can fail because the python modules with the custom logger dont exist in the tox roots.
ISSUE TYPE
Bugfix Pull Request
MAZER VERSION
name = mazer
version = 0.4.0
config_file = /home/adrian/.ansible/mazer.yml
uname = Linux, newswoop, 5.0.5-200.fc29.x86_64, #1 SMP Wed Mar 27 20:58:04 UTC 2019, x86_64
executable_location = /home/adrian/venvs/galaxy-cli-py27/bin/mazer
python_version = 2.7.15 (default, Oct 15 2018, 15:26:09) [GCC 8.2.1 20180801 (Red Hat 8.2.1-2)]
python_executable = /home/adrian/venvs/galaxy-cli-py27/bin/python
SUMMARY
This is a set of changes mostly focused around on making it easier to test mazer.
This includes some config tweaks to let the configs be injected by tests or overridden by env VARS
One motivation for this is that
tox
doesn't change $HOME or the current user so all the code that uses ~/.ansible based paths (config, logging config, etc) ends up being used by unit tests. If config or logging config do something (like use a custom log handler) the tox tests can fail because the python modules with the custom logger dont exist in the tox roots.ISSUE TYPE
MAZER VERSION