Files
llm-intelligence/scripts/verify_video_pipeline.sh
phamnazage-jpg 77e6610fd2
Some checks failed
CI / test (push) Has been cancelled
chore: prepare repository for publishing
2026-05-13 14:42:45 +08:00

38 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
. "$SCRIPT_DIR/verify_common.sh"
REPORT_PATH="${1:-$(find "$PROJECT_ROOT/reports/daily" -maxdepth 1 -type f -name 'daily_report_*.md' | sort | tail -1)}"
if [[ -z "$REPORT_PATH" || ! -f "$REPORT_PATH" ]]; then
echo "未找到日报 Markdown 文件" >&2
exit 1
fi
REPORT_DATE="$(basename "$REPORT_PATH" | sed -E 's/^daily_report_([0-9-]+)\.md$/\1/')"
OUTPUT_DIR="$PROJECT_ROOT/reports/daily/video/$REPORT_DATE"
echo "=== 视频日报验收检查 ==="
check_shell "视频日报生成器单元测试通过" "go test -tags llm_script scripts/generate_video_digest.go scripts/generate_video_digest_test.go"
check_shell "视频日报生成器真实产物落盘" "go run -tags llm_script scripts/generate_video_digest.go --report \"$REPORT_PATH\" --output-dir \"$OUTPUT_DIR\" >/tmp/llm_video_digest.out 2>/tmp/llm_video_digest.err && grep -q 'cards=5' /tmp/llm_video_digest.out"
check_file "reports/daily/video/$REPORT_DATE/manifest.json" "manifest 已生成"
check_file "reports/daily/video/$REPORT_DATE/video_digest.gif" "GIF 视频原型已生成"
check_file "reports/daily/video/$REPORT_DATE/narration.wav" "旁白音轨已生成"
check_shell "脚本分镜文件达到 5 份" "test \"\$(find '$OUTPUT_DIR/scripts' -maxdepth 1 -type f -name '*.md' | wc -l)\" -eq 5"
check_shell "PNG 帧达到 5 张" "test \"\$(find '$OUTPUT_DIR/frames' -maxdepth 1 -type f -name '*.png' | wc -l)\" -eq 5"
check_shell "GIF 文件头有效" "head -c 6 \"$OUTPUT_DIR/video_digest.gif\" | grep -Eq 'GIF8[79]a'"
check_shell "WAV 文件头有效" "head -c 4 \"$OUTPUT_DIR/narration.wav\" | grep -q 'RIFF'"
check_shell "manifest 引用了视频与音轨产物" "grep -q 'video_digest.gif' \"$OUTPUT_DIR/manifest.json\" && grep -q 'narration.wav' \"$OUTPUT_DIR/manifest.json\""
echo
echo "SUMMARY pass=$PASS_COUNT fail=$FAIL_COUNT warn=$WARN_COUNT"
if [ "$FAIL_COUNT" -eq 0 ]; then
echo "VIDEO_PIPELINE: PASS"
exit 0
fi
echo "VIDEO_PIPELINE: FAIL"
exit 1