1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/sanity/code-smell/test-constraints.sh

18 lines
521 B
Bash
Raw Normal View History

#!/bin/sh
constraints=$(
grep '.' test/runner/requirements/*.txt \
| grep -v '(sanity_ok)$' \
| sed 's/ *;.*$//; s/ #.*$//' \
| grep -v '/constraints.txt:' \
| grep -v '/integration.cloud.azure.txt:' \
| grep '[<>=]'
)
if [ "${constraints}" ]; then
echo 'Constraints for test requirements should be in "test/runner/requirements/constraints.txt".'
echo 'The following constraints were found outside the "constraints.txt" file:'
echo "${constraints}"
exit 1
fi