[CI] Improve logging check accuracy and unify error log cleanup (#7473)

This commit is contained in:
YuBaoku
2026-04-18 19:41:21 +08:00
committed by GitHub
parent 22a4f6019d
commit b2aca6c550
2 changed files with 17 additions and 11 deletions
+11 -7
View File
@@ -78,20 +78,24 @@ if [ "${HAS_ENV_MODIFY}" != "" ] && [ "${PR_ID}" != "" ]; then
fi fi
LOG_KEYWORDS=( LOG_KEYWORDS=(
"\.info\(" "\.info[[:space:]]*\("
"\.debug\(" "\.debug[[:space:]]*\("
"\.error\(" "\.error[[:space:]]*\("
"log_request\(" "\blog_request[[:space:]]*\("
"log_request_error" "\blog_request_error\b"
) )
LOG_PATTERN="$(printf -- "%s|" "${LOG_KEYWORDS[@]}" | sed 's/|$//')"
HAS_LOG_MODIFY=$(git diff upstream/$BRANCH \ HAS_LOG_MODIFY=$(git diff upstream/$BRANCH \
-- . ':(exclude)scripts/check_approval.sh' \ -- . ':(exclude)scripts/check_approval.sh' ':(exclude)tests/**' \
| grep -E "^\+" \ | grep -E "^\+" \
| grep -vE "^\+\+\+" \ | 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 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)." 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 check_approval "$echo_line1" 1 xyxinyang zyyzghb
fi fi
+6 -4
View File
@@ -43,12 +43,14 @@ classify_tests() {
fi fi
# Rule 5: high-risk OOM tests (treat as multi_gpu for sequential execution) # Rule 5: high-risk OOM tests (treat as multi_gpu for sequential execution)
if [[ "$test_file" == "tests/entrypoints/cli/test_main.py" || if [[ "$test_file" =~ ^tests/entrypoints/cli/ ||
"$test_file" == "tests/entrypoints/cli/test_serve.py" || "$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_group_swiglu_with_masked.py" ||
"$test_file" == "tests/operators/test_hybrid_mtp_ngram.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_moe_top_k_select.py" ||
"$test_file" == "tests/operators/test_noaux_tc.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_get_save_output_v1.py" ||
"$test_file" == "tests/output/test_process_batch_draft_tokens.py" || "$test_file" == "tests/output/test_process_batch_draft_tokens.py" ||
"$test_file" == "tests/output/test_process_batch_output.py" ]]; then "$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 if [ -d "${run_path}/unittest_logs" ]; then
echo "Cleaning empty directories..." echo "Cleaning empty directories..."
# remove console_error.log files (cleanup logs from stopped processes) # remove *error.log* files (cleanup logs from stopped processes)
find "${run_path}/unittest_logs" -name "console_error.log*" -delete || true 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 # perform multi-round clean until no more empty directories are found
while true; do while true; do