mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-06 01:15:29 +08:00
refactor: replace processed output comparison with baseline-based validation in SSE simulator
This commit is contained in:
35
tests/scripts/compare-raw-stream-sample.sh
Executable file
35
tests/scripts/compare-raw-stream-sample.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
SAMPLE_ID="${1:-}"
|
||||
BASELINE_ROOT="${2:-}"
|
||||
|
||||
if [[ -z "$SAMPLE_ID" ]]; then
|
||||
echo "usage: $0 <sample-id> [baseline-root]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RUN_ID="$(date -u +%Y%m%dT%H%M%SZ)"
|
||||
RUN_DIR="artifacts/raw-stream-sim/compare-${SAMPLE_ID}-${RUN_ID}"
|
||||
REPORT_PATH="$RUN_DIR/report.json"
|
||||
mkdir -p "$RUN_DIR"
|
||||
|
||||
cmd=(
|
||||
node tests/tools/deepseek-sse-simulator.mjs
|
||||
--samples-root tests/raw_stream_samples
|
||||
--sample-id "$SAMPLE_ID"
|
||||
--output-root "$RUN_DIR"
|
||||
--report "$REPORT_PATH"
|
||||
)
|
||||
|
||||
if [[ -n "$BASELINE_ROOT" ]]; then
|
||||
cmd+=(--baseline-root "$BASELINE_ROOT")
|
||||
fi
|
||||
|
||||
"${cmd[@]}"
|
||||
|
||||
echo "[compare-raw-stream-sample] output: $RUN_DIR"
|
||||
echo "[compare-raw-stream-sample] report: $REPORT_PATH"
|
||||
@@ -4,13 +4,16 @@ set -euo pipefail
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
REPORT_DIR="artifacts/raw-stream-sim"
|
||||
mkdir -p "$REPORT_DIR"
|
||||
REPORT_PATH="$REPORT_DIR/report-$(date -u +%Y%m%dT%H%M%SZ).json"
|
||||
RUN_ID="$(date -u +%Y%m%dT%H%M%SZ)"
|
||||
RUN_DIR="artifacts/raw-stream-sim/run-${RUN_ID}"
|
||||
REPORT_PATH="$RUN_DIR/report.json"
|
||||
mkdir -p "$RUN_DIR"
|
||||
|
||||
node tests/tools/deepseek-sse-simulator.mjs \
|
||||
--samples-root tests/raw_stream_samples \
|
||||
--output-root "$RUN_DIR" \
|
||||
--report "$REPORT_PATH" \
|
||||
"$@"
|
||||
|
||||
echo "[run-raw-stream-sim] output: $RUN_DIR"
|
||||
echo "[run-raw-stream-sim] report: $REPORT_PATH"
|
||||
|
||||
Reference in New Issue
Block a user