Files
wordpress/tests/run.sh
T
2026-06-02 23:36:02 +01:00

50 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
ROOT="$(dirname "$(realpath "$0")")"
echo "==================================="
echo " WordPress Recipe Test Suite"
echo "==================================="
echo ""
# Collect all compose files
COMPOSE_FILES=()
while IFS= read -r f; do
COMPOSE_FILES+=("$f")
done < <(find "$ROOT/.." -maxdepth 1 -name 'compose*.yml' | sort)
# Collect all tmpl files with bash content
SHELL_TMPL_FILES=()
while IFS= read -r f; do
SHELL_TMPL_FILES+=("$f")
done < <(find "$ROOT/.." -maxdepth 1 -name '*.tmpl' | sort)
TMPL_FILES=()
while IFS= read -r f; do
TMPL_FILES+=("$f")
done < <(find "$ROOT/.." -maxdepth 1 -name '*.tmpl' | sort)
failures=0
echo "========================================================================"
"$ROOT/test_yaml.sh" "${COMPOSE_FILES[@]}" || failures=$((failures + 1))
echo ""
echo "========================================================================"
"$ROOT/test_shell.sh" "${SHELL_TMPL_FILES[@]}" || failures=$((failures + 1))
echo ""
echo "========================================================================"
"$ROOT/test_templates.sh" || failures=$((failures + 1))
echo ""
echo "==================================="
if [ "$failures" -eq 0 ]; then
echo " All tests passed!"
else
echo " $failures test suite(s) failed"
fi
echo "==================================="
exit "$failures"