diff --git a/scripts/test_component_once_prefetch.sh b/scripts/test_component_once_prefetch.sh index bd6e873..0d6146f 100755 --- a/scripts/test_component_once_prefetch.sh +++ b/scripts/test_component_once_prefetch.sh @@ -11,12 +11,22 @@ if [[ -z "${UCE_TEST_SITE_DIRECTORY:-}" && -r /etc/uce/settings.cfg ]]; then fi fi source_dir="$site_directory/$test_name" +bin_directory="${BIN_DIRECTORY:-}" +if [[ -z "$bin_directory" && -r /etc/uce/settings.cfg ]]; then + bin_directory=$(awk -F= '/^[[:space:]]*BIN_DIRECTORY[[:space:]]*=/ {gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2); print $2; exit}' /etc/uce/settings.cfg) +fi +bin_directory="${bin_directory:-/tmp/uce/work}" +cache_dir="" cleanup() { rm -rf "$source_dir" + if [[ -n "$cache_dir" ]]; then + rm -rf "$cache_dir" + fi } trap cleanup EXIT mkdir -p "$source_dir" +cache_dir="$(scripts/unit_cache_directory "$bin_directory")$(realpath "$source_dir")" printf '%s\n' \ 'CLI(Request& context) {' \ diff --git a/scripts/test_component_resolution_ttl.sh b/scripts/test_component_resolution_ttl.sh index 0e2329e..ae8b503 100755 --- a/scripts/test_component_resolution_ttl.sh +++ b/scripts/test_component_resolution_ttl.sh @@ -17,12 +17,22 @@ if [[ -r /etc/uce/settings.cfg ]]; then fi http_host="${UCE_TEST_HTTP_HOST:-uce.openfu.com}" source_dir="$site_directory/$test_name" +bin_directory="${BIN_DIRECTORY:-}" +if [[ -z "$bin_directory" && -r /etc/uce/settings.cfg ]]; then + bin_directory=$(awk -F= '/^[[:space:]]*BIN_DIRECTORY[[:space:]]*=/ {gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2); print $2; exit}' /etc/uce/settings.cfg) +fi +bin_directory="${bin_directory:-/tmp/uce/work}" +cache_dir="" cleanup() { rm -rf "$source_dir" + if [[ -n "$cache_dir" ]]; then + rm -rf "$cache_dir" + fi } trap cleanup EXIT mkdir -p "$source_dir" +cache_dir="$(scripts/unit_cache_directory "$bin_directory")$(realpath "$source_dir")" printf '%s\n' 'RENDER(Request& context) { print("parent:", request_perf()["worker_pid"].to_string(), ":", component("chosen", context)); }' >"$source_dir/parent.uce" printf '%s\n' 'COMPONENT(Request& context) { print("a"); }' >"$source_dir/a.uce" diff --git a/scripts/test_nested_component_props.sh b/scripts/test_nested_component_props.sh index 6175c6a..5c76efa 100755 --- a/scripts/test_nested_component_props.sh +++ b/scripts/test_nested_component_props.sh @@ -12,12 +12,22 @@ if [[ -z "${UCE_TEST_SITE_DIRECTORY:-}" && -r /etc/uce/settings.cfg ]]; then fi source_dir="$site_directory/$test_name" threshold_ms="${UCE_NESTED_COMPONENT_PROPS_MAX_MS:-1500}" +bin_directory="${BIN_DIRECTORY:-}" +if [[ -z "$bin_directory" && -r /etc/uce/settings.cfg ]]; then + bin_directory=$(awk -F= '/^[[:space:]]*BIN_DIRECTORY[[:space:]]*=/ {gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2); print $2; exit}' /etc/uce/settings.cfg) +fi +bin_directory="${bin_directory:-/tmp/uce/work}" +cache_dir="" cleanup() { rm -rf "$source_dir" + if [[ -n "$cache_dir" ]]; then + rm -rf "$cache_dir" + fi } trap cleanup EXIT mkdir -p "$source_dir" +cache_dir="$(scripts/unit_cache_directory "$bin_directory")$(realpath "$source_dir")" printf '%s\n' \ 'CLI(Request& context) {' \ diff --git a/scripts/test_relative_component_cache.sh b/scripts/test_relative_component_cache.sh index 5c2d555..493e268 100755 --- a/scripts/test_relative_component_cache.sh +++ b/scripts/test_relative_component_cache.sh @@ -11,12 +11,22 @@ if [[ -z "${UCE_TEST_SITE_DIRECTORY:-}" && -r /etc/uce/settings.cfg ]]; then fi fi source_dir="$site_directory/$test_name" +bin_directory="${BIN_DIRECTORY:-}" +if [[ -z "$bin_directory" && -r /etc/uce/settings.cfg ]]; then + bin_directory=$(awk -F= '/^[[:space:]]*BIN_DIRECTORY[[:space:]]*=/ {gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2); print $2; exit}' /etc/uce/settings.cfg) +fi +bin_directory="${bin_directory:-/tmp/uce/work}" +cache_dir="" cleanup() { rm -rf "$source_dir" + if [[ -n "$cache_dir" ]]; then + rm -rf "$cache_dir" + fi } trap cleanup EXIT mkdir -p "$source_dir/a" "$source_dir/b" +cache_dir="$(scripts/unit_cache_directory "$bin_directory")$(realpath "$source_dir")" printf '%s\n' \ 'CLI(Request& context) {' \