From 0e8f2307fc33a94bfd53664c073a1771c84b0dc1 Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Tue, 7 Apr 2020 13:31:06 -0400 Subject: [PATCH] Remove tower-cli from Zuul CI for AWX collection --- Makefile | 10 ++-------- awx_collection/test/awx/conftest.py | 2 ++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index c804ff43bf..b3f0eac2e6 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,6 @@ COMPOSE_TAG ?= $(GIT_BRANCH) COMPOSE_HOST ?= $(shell hostname) VENV_BASE ?= /venv -COLLECTION_VENV ?= /awx_devel/awx_collection_test_venv SCL_PREFIX ?= CELERY_SCHEDULE_FILE ?= /var/lib/awx/beat.db @@ -365,11 +364,6 @@ test: cd awxkit && $(VENV_BASE)/awx/bin/tox -re py2,py3 awx-manage check_migrations --dry-run --check -n 'vNNN_missing_migration_file' -prepare_collection_venv: - rm -rf $(COLLECTION_VENV) - mkdir $(COLLECTION_VENV) - $(VENV_BASE)/awx/bin/pip install --target=$(COLLECTION_VENV) git+https://github.com/ansible/tower-cli.git - COLLECTION_TEST_DIRS ?= awx_collection/test/awx COLLECTION_TEST_TARGET ?= COLLECTION_PACKAGE ?= awx @@ -380,12 +374,12 @@ test_collection: @if [ "$(VENV_BASE)" ]; then \ . $(VENV_BASE)/awx/bin/activate; \ fi; \ - PYTHONPATH=$(COLLECTION_VENV):$PYTHONPATH:/usr/lib/python3.6/site-packages py.test $(COLLECTION_TEST_DIRS) + PYTHONPATH=$PYTHONPATH:/usr/lib/python3.6/site-packages py.test $(COLLECTION_TEST_DIRS) flake8_collection: flake8 awx_collection/ # Different settings, in main exclude list -test_collection_all: prepare_collection_venv test_collection flake8_collection +test_collection_all: test_collection flake8_collection # WARNING: symlinking a collection is fundamentally unstable # this is for rapid development iteration with playbooks, do not use with other test targets diff --git a/awx_collection/test/awx/conftest.py b/awx_collection/test/awx/conftest.py index a36d1a7377..5278f380cb 100644 --- a/awx_collection/test/awx/conftest.py +++ b/awx_collection/test/awx/conftest.py @@ -163,6 +163,8 @@ def run_module(request, collection_import): raise Exception('Module did not write valid JSON, error: {0}, stdout:\n{1}'.format(str(e), module_stdout)) # A module exception should never be a test expectation if 'exception' in result: + if "ModuleNotFoundError: No module named 'tower_cli'" in result['exception']: + pytest.skip('The tower-cli library is needed to run this test, module no longer supported.') raise Exception('Module encountered error:\n{0}'.format(result['exception'])) return result