Integrate Ansible core tower modules content into AWX

This commit includes all the changes involved in
converting the old Ansible Tower modules from commits
in Ansible core into the AWX collection that replaces it.
Also includes work needed to integrate it into the
AWX processes like tests, docs, and the Makefile.

Apply changes from content_collector tool

Add integrated module tests
  operate via run_module fixture
  add makefile target for them

Add flake8 target and fix flake8 errors

Update README

Make consolidated target for testing modules
This commit is contained in:
AlanCoding
2019-08-30 17:11:01 -04:00
parent 5271c993ac
commit 2f0f692f4a
32 changed files with 333 additions and 30 deletions

View File

@@ -18,6 +18,7 @@ COMPOSE_TAG ?= $(GIT_BRANCH)
COMPOSE_HOST ?= $(shell hostname)
VENV_BASE ?= /venv
MODULES_VENV ?= /awx_devel/awx_modules_test_venv
SCL_PREFIX ?=
CELERY_SCHEDULE_FILE ?= /var/lib/awx/beat.db
@@ -373,8 +374,31 @@ test:
fi; \
PYTHONDONTWRITEBYTECODE=1 py.test -p no:cacheprovider -n auto $(TEST_DIRS)
cd awxkit && $(VENV_BASE)/awx/bin/tox -re py2,py3
make test_modules_all
awx-manage check_migrations --dry-run --check -n 'vNNN_missing_migration_file'
prepare_modules_venv:
cd /awx_devel
rm -rf $(MODULES_VENV)
mkdir $(MODULES_VENV)
ln -s /usr/lib/python2.7/site-packages/ansible $(MODULES_VENV)/ansible
$(VENV_BASE)/awx/bin/pip install --target=$(MODULES_VENV) git+https://github.com/ansible/tower-cli.git
MODULES_TEST_DIRS ?= awx_modules/test/awx
test_modules:
@if [ "$(VENV_BASE)" ]; then \
. $(VENV_BASE)/awx/bin/activate; \
fi; \
PYTHONPATH=$(MODULES_VENV):/awx_devel/awx_modules:$PYTHONPATH py.test $(MODULES_TEST_DIRS)
flake8_modules:
flake8 awx_modules/ # Different settings, in main exclude list
prepare_test_modules: prepare_modules_venv test_modules # deprecated
test_modules_all: prepare_modules_venv test_modules flake8_modules
test_unit:
@if [ "$(VENV_BASE)" ]; then \
. $(VENV_BASE)/awx/bin/activate; \