Add explanatory comments to all test scripts
This commit is contained in:
+8
-7
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Root of the project directory
|
||||
ROOT="$(dirname "$(realpath "$0")")"
|
||||
|
||||
echo "==================================="
|
||||
@@ -8,37 +9,37 @@ echo " WordPress Recipe Test Suite"
|
||||
echo "==================================="
|
||||
echo ""
|
||||
|
||||
# Collect all compose files
|
||||
# Collect all compose files for YAML validation
|
||||
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
|
||||
# Collect all tmpl files for shellcheck (only those 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)
|
||||
|
||||
# Track total failures across all test suites
|
||||
failures=0
|
||||
|
||||
# Validate YAML syntax of all compose files
|
||||
echo "========================================================================"
|
||||
"$ROOT/test_yaml.sh" "${COMPOSE_FILES[@]}" || failures=$((failures + 1))
|
||||
echo ""
|
||||
|
||||
# Lint shell scripts inside Go templates (after stripping template tags)
|
||||
echo "========================================================================"
|
||||
"$ROOT/test_shell.sh" "${SHELL_TMPL_FILES[@]}" || failures=$((failures + 1))
|
||||
echo ""
|
||||
|
||||
# Render templates with fixture env files and verify expected output
|
||||
echo "========================================================================"
|
||||
"$ROOT/test_templates.sh" || failures=$((failures + 1))
|
||||
echo ""
|
||||
|
||||
# Validate compose files against the Docker Compose specification
|
||||
echo "========================================================================"
|
||||
"$ROOT/test_compose_config.sh" || failures=$((failures + 1))
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user