From b2aca6c55045bc90eb56ee929392f3f4ae304c49 Mon Sep 17 00:00:00 2001 From: YuBaoku <49938469+EmmonsCurse@users.noreply.github.com> Date: Sat, 18 Apr 2026 19:41:21 +0800 Subject: [PATCH] [CI] Improve logging check accuracy and unify error log cleanup (#7473) --- scripts/check_approval.sh | 18 +++++++++++------- scripts/coverage_run.sh | 10 ++++++---- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/scripts/check_approval.sh b/scripts/check_approval.sh index 5edf62eb2c..8311b2bdac 100644 --- a/scripts/check_approval.sh +++ b/scripts/check_approval.sh @@ -78,20 +78,24 @@ if [ "${HAS_ENV_MODIFY}" != "" ] && [ "${PR_ID}" != "" ]; then fi LOG_KEYWORDS=( - "\.info\(" - "\.debug\(" - "\.error\(" - "log_request\(" - "log_request_error" + "\.info[[:space:]]*\(" + "\.debug[[:space:]]*\(" + "\.error[[:space:]]*\(" + "\blog_request[[:space:]]*\(" + "\blog_request_error\b" ) +LOG_PATTERN="$(printf -- "%s|" "${LOG_KEYWORDS[@]}" | sed 's/|$//')" + HAS_LOG_MODIFY=$(git diff upstream/$BRANCH \ - -- . ':(exclude)scripts/check_approval.sh' \ + -- . ':(exclude)scripts/check_approval.sh' ':(exclude)tests/**' \ | grep -E "^\+" \ | grep -vE "^\+\+\+" \ - | grep -E $(printf -- "%s|" "${LOG_KEYWORDS[@]}" | sed 's/|$//') || true) + | grep -E "${LOG_PATTERN}" || true) if [ -n "${HAS_LOG_MODIFY}" ] && [ -n "${PR_ID}" ]; then + echo "Detected log modification in diff:" + echo "${HAS_LOG_MODIFY}" echo_line1="You must have one FastDeploy RD (xyxinyang(zhouchong), zyyzghb(zhangyongyue)) approval for modifying logging behavior (.info/.debug/.error/log_request)." check_approval "$echo_line1" 1 xyxinyang zyyzghb fi diff --git a/scripts/coverage_run.sh b/scripts/coverage_run.sh index d9e5b627c0..a188a89a06 100644 --- a/scripts/coverage_run.sh +++ b/scripts/coverage_run.sh @@ -43,12 +43,14 @@ classify_tests() { fi # Rule 5: high-risk OOM tests (treat as multi_gpu for sequential execution) - if [[ "$test_file" == "tests/entrypoints/cli/test_main.py" || - "$test_file" == "tests/entrypoints/cli/test_serve.py" || + if [[ "$test_file" =~ ^tests/entrypoints/cli/ || + "$test_file" == "tests/layers/test_append_attention_with_output.py" || + "$test_file" == "tests/operators/test_get_position_ids_and_mask_encoder_batch.py" || "$test_file" == "tests/operators/test_group_swiglu_with_masked.py" || "$test_file" == "tests/operators/test_hybrid_mtp_ngram.py" || "$test_file" == "tests/operators/test_moe_top_k_select.py" || "$test_file" == "tests/operators/test_noaux_tc.py" || + "$test_file" == "tests/operators/test_qk_rmsnorm_fused.py" || "$test_file" == "tests/output/test_get_save_output_v1.py" || "$test_file" == "tests/output/test_process_batch_draft_tokens.py" || "$test_file" == "tests/output/test_process_batch_output.py" ]]; then @@ -344,8 +346,8 @@ if [ "$failed_count" -ne 0 ]; then if [ -d "${run_path}/unittest_logs" ]; then echo "Cleaning empty directories..." - # remove console_error.log files (cleanup logs from stopped processes) - find "${run_path}/unittest_logs" -name "console_error.log*" -delete || true + # remove *error.log* files (cleanup logs from stopped processes) + find "${run_path}/unittest_logs" \( -name "console_error.log*" -o -name "error.log*" \) -delete || true # perform multi-round clean until no more empty directories are found while true; do