ansible/test/integration/targets/ansible-test/collection-tests/venv.sh
Matt Clay 7bff3d312f
Split out and install sanity test requirements. (#69971)
* Split out sanity test requirements.

* Run each --venv test separately.

This provides verification that the requirements for each test are properly specified.

* Use a separate requirements file per sanity test.

* Skip setuptools/cryptography setup for sanity.

* Eliminate pyyaml missing warning.

* Eliminate more pip noise.

* Fix conflicting generate_pip_install commands.

* Add changelog fragment.
2020-06-09 13:38:36 -07:00

39 lines
765 B
Bash
Executable file

#!/usr/bin/env bash
set -eux -o pipefail
cp -a "${TEST_DIR}/ansible_collections" "${WORK_DIR}"
cd "${WORK_DIR}/ansible_collections/ns/col"
# common args for all tests
# each test will be run in a separate venv to verify that requirements have been properly specified
common=(--venv --python "${ANSIBLE_TEST_PYTHON_VERSION}" --color --truncate 0 "${@}")
# sanity tests
tests=()
set +x
while IFS='' read -r line; do
tests+=("$line");
done < <(
ansible-test sanity --list-tests
)
set -x
for test in "${tests[@]}"; do
rm -rf "tests/output"
ansible-test sanity "${common[@]}" --test "${test}"
done
# unit tests
rm -rf "tests/output"
ansible-test units "${common[@]}"
# integration tests
rm -rf "tests/output"
ansible-test integration "${common[@]}"