diff --git a/fe-app-tachyon/locales/tachyon.pot b/fe-app-tachyon/locales/tachyon.pot index 23859cfb..c213ceec 100644 --- a/fe-app-tachyon/locales/tachyon.pot +++ b/fe-app-tachyon/locales/tachyon.pot @@ -2396,6 +2396,87 @@ msgstr "" msgid "Global check" msgstr "" +msgid "Global check failed" +msgstr "" + +msgid "View logs failed" +msgstr "" + +msgid "Show sing-box config failed" +msgstr "" + +msgid "Action failed" +msgstr "" + +msgid "Active routes" +msgstr "" + +msgid "All services" +msgstr "" + +msgid "Avg. latency" +msgstr "" + +msgid "Basic connectivity" +msgstr "" + +msgid "Blocked resources" +msgstr "" + +msgid "Check again" +msgstr "" + +msgid "Check all" +msgstr "" + +msgid "Check domain" +msgstr "" + +msgid "Check mode:" +msgstr "" + +msgid "Custom domains" +msgstr "" + +msgid "Enter a domain or IP to check (e.g. example.com)..." +msgstr "" + +msgid "Failed to parse target list." +msgstr "" + +msgid "Failed to start service check." +msgstr "" + +msgid "Filter by service:" +msgstr "" + +msgid "Loading service list..." +msgstr "" + +msgid "No check targets found in the configuration." +msgstr "" + +msgid "Pending..." +msgstr "" + +msgid "Search domain or service..." +msgstr "" + +msgid "Service / Target" +msgstr "" + +msgid "Service availability check" +msgstr "" + +msgid "Testing..." +msgstr "" + +msgid "Total targets" +msgstr "" + +msgid "UDP / QUIC protocols" +msgstr "" + #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/server.js:2961 msgid "gRPC service" msgstr "" diff --git a/fe-app-tachyon/locales/tachyon.ru.po b/fe-app-tachyon/locales/tachyon.ru.po index 16633994..a7ae7d07 100644 --- a/fe-app-tachyon/locales/tachyon.ru.po +++ b/fe-app-tachyon/locales/tachyon.ru.po @@ -1523,6 +1523,87 @@ msgstr "Дайте снапшоту имя. Он сохраняется с те msgid "Global check" msgstr "Глобальная проверка" +msgid "Global check failed" +msgstr "Не удалось выполнить глобальную проверку" + +msgid "View logs failed" +msgstr "Не удалось открыть логи" + +msgid "Show sing-box config failed" +msgstr "Не удалось показать конфигурацию sing-box" + +msgid "Action failed" +msgstr "Действие не выполнено" + +msgid "Active routes" +msgstr "Активные маршруты" + +msgid "All services" +msgstr "Все сервисы" + +msgid "Avg. latency" +msgstr "Ср. задержка" + +msgid "Basic connectivity" +msgstr "Базовая связность" + +msgid "Blocked resources" +msgstr "Заблокированные ресурсы" + +msgid "Check again" +msgstr "Проверить снова" + +msgid "Check all" +msgstr "Проверить все" + +msgid "Check domain" +msgstr "Проверить домен" + +msgid "Check mode:" +msgstr "Режим проверки:" + +msgid "Custom domains" +msgstr "Собственные домены" + +msgid "Enter a domain or IP to check (e.g. example.com)..." +msgstr "Введите домен или IP для проверки (напр. example.com)..." + +msgid "Failed to parse target list." +msgstr "Ошибка разбора списка целей." + +msgid "Failed to start service check." +msgstr "Не удалось запустить проверку сервисов." + +msgid "Filter by service:" +msgstr "Фильтр по сервису:" + +msgid "Loading service list..." +msgstr "Получение списка сервисов..." + +msgid "No check targets found in the configuration." +msgstr "Цели для проверки не найдены в конфигурации." + +msgid "Pending..." +msgstr "Ожидание..." + +msgid "Search domain or service..." +msgstr "Поиск домена или сервиса..." + +msgid "Service / Target" +msgstr "Сервис / Цель" + +msgid "Service availability check" +msgstr "Проверка доступности сервисов" + +msgid "Testing..." +msgstr "Проверка..." + +msgid "Total targets" +msgstr "Всего целей" + +msgid "UDP / QUIC protocols" +msgstr "UDP / QUIC протоколы" + msgid "gRPC service" msgstr "Сервис gRPC" diff --git a/tests/run_all.sh b/tests/run_all.sh index 245d6821..560b5501 100644 --- a/tests/run_all.sh +++ b/tests/run_all.sh @@ -1,13 +1,99 @@ #!/usr/bin/env bash -set -eo pipefail +# Runs the whole test suite. Mirrors CI (backend-ci.yml): syntax check first, +# then every standalone test in parallel with a pass/fail summary at the end. +# +# Usage: bash tests/run_all.sh [-P N] [test-name...] +# -P N run N tests in parallel (default: 4) +# test-name... only run tests whose file name contains these substrings +set -uo pipefail + +PARALLEL=4 +while getopts "P:" opt; do + case "$opt" in + P) PARALLEL="$OPTARG" ;; + *) echo "Usage: bash tests/run_all.sh [-P N] [test-name...]" >&2; exit 2 ;; + esac +done +shift $((OPTIND - 1)) echo "=== Syntax Checking ===" -bash tests/ucode_syntax_lint.sh +if ! bash tests/ucode_syntax_lint.sh; then + echo "" + echo "=== Syntax check failed, aborting ===" + exit 1 +fi -echo "=== Running Tests ===" +test_files=() for f in tests/*.sh; do - if [ "$f" != "tests/run_all.sh" ] && [ "$f" != "tests/ucode_syntax_lint.sh" ] && [ "$f" != "tests/docker_e2e_test.sh" ] && [ "$f" != "tests/container_entrypoint.sh" ]; then - echo "Running: $f" - bash "$f" + case "$f" in + tests/run_all.sh | tests/ucode_syntax_lint.sh | tests/docker_e2e_test.sh | tests/container_entrypoint.sh) + continue + ;; + esac + if [ $# -gt 0 ]; then + name="$(basename "$f")" + keep=0 + for pattern in "$@"; do + case "$name" in + *"$pattern"*) keep=1; break ;; + esac + done + [ "$keep" -eq 1 ] || continue + fi + test_files+=("$f") +done + +if [ "${#test_files[@]}" -eq 0 ]; then + echo "No matching tests found." + exit 1 +fi + +echo "=== Running ${#test_files[@]} Tests (-P $PARALLEL) ===" + +results_dir="$(mktemp -d)" +cleanup() { rm -rf "$results_dir"; } +trap cleanup EXIT + +run_one() { + f="$1" + log="$2" + name="$(basename "$f")" + echo "--- START $name ---" + if bash "$f" >"$log" 2>&1; then + echo "--- PASS $name ---" + else + echo "--- FAIL $name ---" + fi +} +export -f run_one + +printf '%s\0' "${test_files[@]}" | xargs -0 -n1 -I'{}' bash -c 'run_one "$1" "$2/$(basename "${1%.sh}").log"' _ '{}' "$results_dir" | tee "$results_dir/progress.log" + +pass_count=0 +fail_count=0 +failed_names=() +for f in "${test_files[@]}"; do + name="$(basename "$f")" + log="$results_dir/${name%.sh}.log" + # shellcheck disable=SC1091 + if grep -q -- "--- PASS $name ---" "$results_dir/progress.log"; then + pass_count=$((pass_count + 1)) + else + fail_count=$((fail_count + 1)) + failed_names+=("$name") fi done + +echo "" +echo "=== Summary: $pass_count passed, $fail_count failed / total ${#test_files[@]} ===" + +if [ "$fail_count" -gt 0 ]; then + for name in "${failed_names[@]}"; do + echo "" + echo "--- Failure output: $name ---" + cat "$results_dir/${name%.sh}.log" + done + exit 1 +fi + +echo "ALL PASSED"