You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/ansible-test-units-assertions/runme.sh

23 lines
558 B
Bash

#!/usr/bin/env bash
source ../collection/setup.sh
set -x
options=$("${TEST_DIR}"/../ansible-test/venv-pythons.py --only-versions)
IFS=', ' read -r -a pythons <<< "${options}"
for python in "${pythons[@]}"; do
if ansible-test units --truncate 0 --python "${python}" --requirements "${@}" 2>&1 | tee pytest.log; then
echo "Test did not fail as expected."
exit 1
fi
if [ "${python}" = "2.7" ]; then
grep "^E *AssertionError$" pytest.log
else
grep "^E *AssertionError: assert {'yes': True} == {'no': False}$" pytest.log
fi
done