Files
relay_chn/scripts/run_tests_all_profiles.sh
ismail 8416187d86 Fix test_apps directory issue
Fixed test_apps directory locating issue by fixing the path to
"project_root/test_apps" and removed find command since it
searches recursively and founds the similar directories in
managed_components directory. Also added current time to the output.
2025-09-12 15:10:37 +03:00

39 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
# Check tag argument
arg_tag=$1
if [[ -z "$arg_tag" ]]; then
arg_tag="all"
fi
# Resolve Paths and Switch to Working Directory
script_dir=$(dirname "$(readlink -f "$0")")
project_root=$(dirname "$script_dir")
echo "Script dir: ${script_dir}"
echo "Project root: ${project_root}"
test_apps_dir="${project_root}/test_apps"
echo "test_apps dir: ${test_apps_dir}"
if [[ -z "$test_apps_dir" || ! -d "$test_apps_dir" ]]; then
echo "❌ 'test_apps' directory not found within the project root: '$project_root'"
echo " Please ensure the script is in a 'scripts' directory and 'test_apps' is a sibling."
exit 1
fi
# Execute tests for all profiles
mapfile -t profiles < <(find "${test_apps_dir}/profiles" -maxdepth 1 -type f)
for profile in "${profiles[@]}"; do
# Get only the name of the profile file
profile=$(basename "${profile}")
echo "🔧 Running tests with profile: $profile"
"${script_dir}"/run_tests.sh -c -p "$profile" -t "$arg_tag" || {
echo "❌ Tests failed with profile: $profile"
exit 1
}
done