Only execute lint unit tests for the tests repo

We only need to execute the lint tests for the tests
repo, not all repositories. The path being used is
not suitable when executed in other repositories.

Change-Id: I8afbf53304ad9ac150ff6ddc3d44d256dadadd96
This commit is contained in:
Jesse Pretorius 2018-03-12 15:08:51 +00:00
parent 89e3c66946
commit 44761d390b

View File

@ -42,7 +42,11 @@ echo "ANSIBLE_LINT_PARAMS: ${ANSIBLE_LINT_PARAMS}"
source "${COMMON_TESTS_PATH}/test-ansible-env-prep.sh"
# Run unit tests for OSA ansible-lint rules
python -m unittest discover -s "${WORKING_DIR}/ansible-lint" -p 'Test*.py'
# Only do it if the repository being tested is the openstack-ansible-tests
# repository.
if [[ "$(basename ${WORKING_DIR})" == "openstack-ansible-tests" ]]; then
python -m unittest discover -s "${WORKING_DIR}/ansible-lint" -p 'Test*.py'
fi
# Execute ansible-lint. We do not want to test dependent roles located
# in $HOME/.ansible/roles since we only care about the role we are currently