#!/bin/sh # Release 8 rollout smoke against the live editor on :3001 (from smoke7.sh + smoke7b.sh). B=http://localhost:3001; T=${CLAUDE_JOB_DIR:?set CLAUDE_JOB_DIR}/tmp; REL=${REL:-r9}; R=/home/user/Projects/yt-dlp-transcript-browser; fail=0 echo "SMOKE_START $(date +%T)" strip() { jq -S 'walk(if type=="object" then del(.heldMs,.fraction,.detail,.now,.rev,.builtAt,.updatedAt,.elapsedMs,.etaMs) else . end) | (if type=="object" and (.disk|type)=="object" then del(.disk.freeBytes) else . end)'; } for pair in "/api/pulse /api/view/pulse" "/api/workers /api/view/workers" "/api/jobs/active /api/view/activeJobs" "/api/auto-queue/status /api/view/autoQueueStatus" "/api/scheduler/status /api/view/schedulerStatus" "/api/widget/sync /api/view/widgetSync" "/api/widget/actionable /api/view/widgetActionable" "/api/widget/cleanable /api/view/cleanable"; do set -- $pair s=$(date +%s) a=$(curl -s --max-time 300 "$B$1" | strip); b=$(curl -s --max-time 300 "$B$2" | strip) e=$(( $(date +%s) - s )) if [ -n "$a" ] && [ "$a" = "$b" ]; then echo "PAIR_OK(live-stripped) $1 = $2 ($(printf %s "$a" | wc -c) bytes, ${e}s)"; else echo "PAIR_DIFF $1 vs $2 (a=$(printf %s "$a" | wc -c) b=$(printf %s "$b" | wc -c), ${e}s)"; fail=1; fi printf %s "$a" > "$T/$REL-smoke-old$(echo $1|tr / _).json"; printf %s "$b" > "$T/$REL-smoke-new$(echo $2|tr / _).json" done for p in /api/view/bogus /api/view/invalidate-cache; do c=$(curl -s -o /dev/null --max-time 300 -w %{http_code} "$B$p"); [ "$c" = 404 ] && echo "404_OK $p" || { echo "404_FAIL $p $c"; fail=1; }; done c=$(curl -s -o /dev/null --max-time 300 -w %{http_code} "$B/api/widget/presets"); [ "$c" = 200 ] && echo "PRESETS_OK" || { echo "PRESETS_FAIL $c"; fail=1; } rev=$(curl -s --max-time 300 "$B/api/view/pulse" | jq -r '.rev|@uri') for p in "/api/view/pulse?rev=$rev" "/api/pulse?rev=$rev"; do ch=$(curl -s --max-time 300 "$B$p" | jq -r .changed); [ "$ch" = false ] && echo "PULSE_OK $p changed=false" || echo "PULSE_CHANGED $p changed=$ch"; done echo "active downloads: $(curl -s --max-time 300 "$B/api/view/activeJobs" | jq -c '[.. | objects | select(has("kind")) | .kind] | group_by(.) | map({(.[0]):length}) | add' 2>/dev/null)" cb=$(curl -s --max-time 300 "$B/api/widget/cleanable" | jq -r .cleanableBytes); echo "cleanableBytes=$cb" for p in / /channels "/channels?sort=size" /jobs /operations/diarization /settings /storage /tags /channels/FearAnd /channels/FearAnd/videos/03Bgz7vkgbs; do f="$T/$REL-page$(echo "$p" | tr '/?=' '___').html" s=$(date +%s); c=$(curl -s -o "$f" --max-time 300 -w %{http_code} "$B$p"); e=$(( $(date +%s) - s )) [ "$c" = 200 ] && echo "PAGE_OK $p ${e}s $(wc -c < "$f")B" || { echo "PAGE_FAIL $p $c ${e}s"; fail=1; } done echo "BUILD_ID: $(cat $R/editor/.next/BUILD_ID)" echo "ZodError in start log: $(grep -c ZodError $T/editor-start-r8.log 2>/dev/null)" # release 7 additions d=$(curl -s --max-time 300 "$B/api/view/autoQueueStatus" | jq -c '.download.deferred | if type=="array" and all(.[]; type=="object" and has("videoId") and has("untilMs")) then "ok \(length)" else "bad" end' 2>/dev/null); case "$d" in '"ok '*) echo "DEFERRED_OK download.deferred well-formed ($d)";; *) echo "DEFERRED_UNEXPECTED $d"; fail=1;; esac f="$T/$REL-page_operations_download.html"; c=$(curl -s -o "$f" --max-time 300 -w %{http_code} "$B/operations/download"); n=$(grep -c 'aria-label="Rate-limit cooldown"' "$f") [ "$c" = 200 ] && echo "PAGE_OK /operations/download rate-limit-regions=$n" || { echo "PAGE_FAIL /operations/download $c"; fail=1; } f="$T/$REL-page_sites.html"; c=$(curl -s -o "$f" --max-time 300 -w %{http_code} "$B/sites"); echo "PAGE $c /sites Build hub=$(grep -c 'Build hub' "$f") Deploy hub=$(grep -c 'Deploy hub' "$f")" c=$(curl -s -o /dev/null --max-time 60 -w %{http_code} http://localhost:3050/); [ "$c" = 200 ] && echo "UMTOOL_OK / $c BUILD_ID $(cat $R/umtool/.next/BUILD_ID)" || { echo "UMTOOL_FAIL $c"; fail=1; } echo "videoDeferrals keys: $(jq -c '.download|keys' $R/transcripts/.auto-queue/state.json)" echo "SMOKE_FAIL=$fail $(date +%T)" # release 8 additions: a channel list renders a title; the undownloaded video page shows the scan note (paramount-tactical has scan-only ids once scanned) f="$T/$REL-page_channels_paramount-tactical_videos.html"; c=$(curl -s -o "$f" --max-time 300 -w %{http_code} "$B/channels/paramount-tactical/videos"); echo "PAGE $c /channels/paramount-tactical/videos $(wc -c < "$f")B open-rows=$(grep -o 'aria-label="open [^"]*"' "$f" | wc -l)" echo "SMOKE8_END $(date +%T)"