From 8416187d86485388a4e7dfe567b9178a09bfe681 Mon Sep 17 00:00:00 2001 From: ismail Date: Fri, 12 Sep 2025 11:23:06 +0300 Subject: [PATCH] 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. --- scripts/run_tests.sh | 5 ++--- scripts/run_tests_all_profiles.sh | 9 +++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index 459c81d..197333b 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -98,8 +98,7 @@ fi script_dir=$(dirname "$(readlink -f "$0")") project_root=$(dirname "$script_dir") -echo "๐Ÿ” Searching for 'test_apps' directory in '$project_root'..." -test_apps_dir=$(find "$project_root" -type d -name "test_apps" | head -n 1) +test_apps_dir="${project_root}/test_apps" if [[ -z "$test_apps_dir" || ! -d "$test_apps_dir" ]]; then echo "โŒ 'test_apps' directory not found within the project root: '$project_root'" @@ -107,7 +106,7 @@ if [[ -z "$test_apps_dir" || ! -d "$test_apps_dir" ]]; then exit 1 fi -echo "โœ… Found 'test_apps' at: $test_apps_dir" +echo "โณ Current time is: $(date +"%Y-%m-%d %H:%M:%S")" echo "๐Ÿงช Test mode: $arg_tag | Profile: $arg_profile" echo "๐Ÿงน Clean: $arg_clean | ๐Ÿ“„ Log: $arg_log" diff --git a/scripts/run_tests_all_profiles.sh b/scripts/run_tests_all_profiles.sh index 4a04ab4..ce1fc60 100755 --- a/scripts/run_tests_all_profiles.sh +++ b/scripts/run_tests_all_profiles.sh @@ -14,10 +14,15 @@ project_root=$(dirname "$script_dir") echo "Script dir: ${script_dir}" echo "Project root: ${project_root}" -echo "๐Ÿ” Searching for 'test_apps' directory in '$project_root'..." -test_apps_dir=$(find "$project_root" -type d -name "test_apps" | head -n 1) +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)