73138475dc
- Add molecule support to test ansible roles. - Also fix flake8 failures. - Also drop python36 from the templates Change-Id: Ib647d93144a02a6be7340991c31f65842fdf3f29 Signed-off-by: Charles Short <chucks@redhat.com>
28 lines
505 B
Bash
Executable File
28 lines
505 B
Bash
Executable File
#!/bin/bash
|
|
|
|
|
|
# Run molecule tests. Any arguments passed to this script will be passed onto
|
|
# molecule.
|
|
|
|
set -e
|
|
|
|
molecules="$(find ansible/install/roles/ -name molecule -type d)"
|
|
|
|
failed=0
|
|
ran=0
|
|
for molecule in $molecules; do
|
|
pushd $(dirname $molecule)
|
|
if ! molecule test --all $*; then
|
|
failed=$((failed + 1))
|
|
fi
|
|
ran=$((ran + 1))
|
|
popd
|
|
done
|
|
|
|
if [[ $failed -ne 0 ]]; then
|
|
echo "Failed $failed / $ran molecule tests"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Ran $ran molecule tests successfully"
|