mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-24 08:00:31 +00:00
chore: merge next into feat/studio-inspector-selection-ux
This commit is contained in:
@@ -510,9 +510,11 @@ async function scaffoldProject(
|
||||
): Promise<void> {
|
||||
mkdirSync(destDir, { recursive: true });
|
||||
|
||||
// Use bundled template if available, otherwise fetch from GitHub
|
||||
// Use bundled template if available, otherwise fetch from GitHub.
|
||||
// Check for index.html inside the dir — an empty directory left by the
|
||||
// build toolchain should not prevent the remote fetch fallback.
|
||||
const templateDir = getStaticTemplateDir(templateId);
|
||||
if (existsSync(templateDir)) {
|
||||
if (existsSync(join(templateDir, "index.html"))) {
|
||||
cpSync(templateDir, destDir, { recursive: true });
|
||||
} else {
|
||||
await fetchRemoteTemplate(templateId, destDir);
|
||||
|
||||
@@ -42,6 +42,14 @@
|
||||
"import": "./src/studio-api/helpers/screenshotClip.ts",
|
||||
"types": "./src/studio-api/helpers/screenshotClip.ts"
|
||||
},
|
||||
"./studio-api/manual-edits-render-script": {
|
||||
"import": "./src/studio-api/helpers/manualEditsRenderScript.ts",
|
||||
"types": "./src/studio-api/helpers/manualEditsRenderScript.ts"
|
||||
},
|
||||
"./studio-api/studio-motion-render-script": {
|
||||
"import": "./src/studio-api/helpers/studioMotionRenderScript.ts",
|
||||
"types": "./src/studio-api/helpers/studioMotionRenderScript.ts"
|
||||
},
|
||||
"./text": {
|
||||
"import": "./src/text/index.ts",
|
||||
"types": "./src/text/index.ts"
|
||||
@@ -81,6 +89,14 @@
|
||||
"import": "./dist/studio-api/helpers/screenshotClip.js",
|
||||
"types": "./dist/studio-api/helpers/screenshotClip.d.ts"
|
||||
},
|
||||
"./studio-api/manual-edits-render-script": {
|
||||
"import": "./dist/studio-api/helpers/manualEditsRenderScript.js",
|
||||
"types": "./dist/studio-api/helpers/manualEditsRenderScript.d.ts"
|
||||
},
|
||||
"./studio-api/studio-motion-render-script": {
|
||||
"import": "./dist/studio-api/helpers/studioMotionRenderScript.js",
|
||||
"types": "./dist/studio-api/helpers/studioMotionRenderScript.d.ts"
|
||||
},
|
||||
"./text": {
|
||||
"import": "./dist/text/index.js",
|
||||
"types": "./dist/text/index.d.ts"
|
||||
|
||||
@@ -389,6 +389,9 @@ export async function spawnStreamingEncoder(
|
||||
exitPromiseResolve?.();
|
||||
});
|
||||
|
||||
ffmpeg.stdin?.on("error", () => {});
|
||||
ffmpeg.stdout?.on("error", () => {});
|
||||
|
||||
// Handle abort signal
|
||||
const onAbort = () => {
|
||||
if (exitStatus === "running") {
|
||||
|
||||
@@ -4236,9 +4236,9 @@ export function StudioApp() {
|
||||
projectId={projectId}
|
||||
onDelete={renderQueue.deleteRender}
|
||||
onClearCompleted={renderQueue.clearCompleted}
|
||||
onStartRender={async (format, quality, resolution) => {
|
||||
onStartRender={async (format, quality, resolution, fps) => {
|
||||
await waitForPendingDomEditSaves();
|
||||
await renderQueue.startRender({ fps: 30, quality, format, resolution });
|
||||
await renderQueue.startRender({ fps, quality, format, resolution });
|
||||
}}
|
||||
isRendering={renderQueue.isRendering}
|
||||
/>
|
||||
|
||||
@@ -32,7 +32,7 @@ const env = import.meta.env as StudioFeatureFlagEnv;
|
||||
export const STUDIO_PREVIEW_MANUAL_EDITING_ENABLED = resolveStudioBooleanEnvFlag(
|
||||
env,
|
||||
[STUDIO_PREVIEW_MANUAL_DRAGGING_ENV, "VITE_STUDIO_PREVIEW_MANUAL_EDITING_ENABLED"],
|
||||
false,
|
||||
true,
|
||||
);
|
||||
|
||||
export const STUDIO_INSPECTOR_PANELS_ENABLED = resolveStudioBooleanEnvFlag(
|
||||
@@ -44,7 +44,7 @@ export const STUDIO_INSPECTOR_PANELS_ENABLED = resolveStudioBooleanEnvFlag(
|
||||
export const STUDIO_MOTION_PANEL_ENABLED = resolveStudioBooleanEnvFlag(
|
||||
env,
|
||||
[STUDIO_MOTION_PANEL_ENV, "VITE_STUDIO_MOTION_PANEL_ENABLED"],
|
||||
false,
|
||||
true,
|
||||
);
|
||||
|
||||
export const STUDIO_TIMELINE_LAYER_INSPECTOR_ENABLED =
|
||||
|
||||
@@ -6,6 +6,7 @@ type StartRenderHandler = (
|
||||
format: "mp4" | "webm" | "mov",
|
||||
quality: "draft" | "standard" | "high",
|
||||
resolution: ResolutionPreset | "auto",
|
||||
fps: 24 | 30 | 60,
|
||||
) => void | Promise<void>;
|
||||
|
||||
interface RenderQueueProps {
|
||||
@@ -133,6 +134,7 @@ function FormatExportButton({
|
||||
const [format, setFormat] = useState<"mp4" | "webm" | "mov">("mp4");
|
||||
const [quality, setQuality] = useState<"draft" | "standard" | "high">("standard");
|
||||
const [resolution, setResolution] = useState<ResolutionPreset | "auto">("auto");
|
||||
const [fps, setFps] = useState<24 | 30 | 60>(30);
|
||||
|
||||
// MOV (ProRes) is a fixed-quality codec — quality selector has no effect.
|
||||
const showQuality = format !== "mov";
|
||||
@@ -172,6 +174,17 @@ function FormatExportButton({
|
||||
))}
|
||||
</select>
|
||||
)}
|
||||
<select
|
||||
value={fps}
|
||||
onChange={(e) => setFps(Number(e.target.value) as 24 | 30 | 60)}
|
||||
disabled={isRendering}
|
||||
title="Frames per second"
|
||||
className="h-5 px-1 text-[10px] bg-neutral-800 border border-neutral-700 text-neutral-300 outline-none disabled:opacity-50"
|
||||
>
|
||||
<option value={24}>24fps</option>
|
||||
<option value={30}>30fps</option>
|
||||
<option value={60}>60fps</option>
|
||||
</select>
|
||||
<select
|
||||
value={format}
|
||||
onChange={(e) => setFormat(e.target.value as "mp4" | "webm" | "mov")}
|
||||
@@ -184,7 +197,7 @@ function FormatExportButton({
|
||||
</select>
|
||||
<button
|
||||
onClick={() => {
|
||||
void onStartRender(format, quality, resolution);
|
||||
void onStartRender(format, quality, resolution, fps);
|
||||
}}
|
||||
disabled={isRendering}
|
||||
className="flex items-center gap-1 px-2 py-0.5 text-[10px] font-semibold rounded-r bg-studio-accent text-[#09090B] hover:brightness-110 transition-colors disabled:opacity-50"
|
||||
|
||||
@@ -343,8 +343,9 @@ function createViteAdapter(dataDir: string, server: ViteDevServer): StudioApiAda
|
||||
bufferPromise = (async () => {
|
||||
const browser = await getSharedBrowser();
|
||||
if (!browser) return null;
|
||||
const page = await browser.newPage();
|
||||
let page: Awaited<ReturnType<typeof browser.newPage>> | null = null;
|
||||
try {
|
||||
page = await browser.newPage();
|
||||
await page.setViewport({
|
||||
width: opts.width,
|
||||
height: opts.height,
|
||||
@@ -415,13 +416,15 @@ function createViteAdapter(dataDir: string, server: ViteDevServer): StudioApiAda
|
||||
...(clip ? { clip } : {}),
|
||||
},
|
||||
);
|
||||
await page.close();
|
||||
return buf as Buffer;
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : String(error);
|
||||
console.warn(`[Studio thumbnail] Failed to generate ${opts.compPath}: ${message}`);
|
||||
} catch (err) {
|
||||
if (page) await page.close().catch(() => {});
|
||||
console.warn(
|
||||
"[Studio] Thumbnail generation failed:",
|
||||
err instanceof Error ? err.message : err,
|
||||
);
|
||||
return null;
|
||||
} finally {
|
||||
await page.close().catch(() => {});
|
||||
}
|
||||
})();
|
||||
_thumbnailInflight.set(cacheKey, bufferPromise);
|
||||
|
||||
Executable
+369
@@ -0,0 +1,369 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# E2E Alpha Preview Test Suite for HyperFrames
|
||||
# Tests the full composition lifecycle: init → preview → render → validate
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
TEST_DIR="/tmp/hyperframes-e2e-$(date +%Y%m%d%H%M%S)"
|
||||
LOG_FILE="${TEST_DIR}/test-results.log"
|
||||
ISSUES_FILE="${TEST_DIR}/issues.log"
|
||||
PASS=0
|
||||
FAIL=0
|
||||
WARN=0
|
||||
|
||||
mkdir -p "$TEST_DIR"
|
||||
|
||||
log() { echo "[$(date +%H:%M:%S)] $*" | tee -a "$LOG_FILE"; }
|
||||
pass() { PASS=$((PASS + 1)); log " PASS: $*"; }
|
||||
fail() { FAIL=$((FAIL + 1)); log " FAIL: $*"; echo "ISSUE: $*" >> "$ISSUES_FILE"; }
|
||||
warn() { WARN=$((WARN + 1)); log " WARN: $*"; echo "WARNING: $*" >> "$ISSUES_FILE"; }
|
||||
section() { log ""; log "=== $* ==="; }
|
||||
|
||||
# ── 1. CLI Version & Help ────────────────────────────────────────────────────
|
||||
|
||||
section "CLI basics"
|
||||
|
||||
if hyperframes --version > /dev/null 2>&1; then
|
||||
VERSION=$(hyperframes --version)
|
||||
pass "CLI version: $VERSION"
|
||||
else
|
||||
fail "CLI --version fails"
|
||||
fi
|
||||
|
||||
if hyperframes --help > /dev/null 2>&1; then
|
||||
pass "CLI --help works"
|
||||
else
|
||||
fail "CLI --help fails"
|
||||
fi
|
||||
|
||||
for cmd in render preview init validate info; do
|
||||
if hyperframes $cmd --help > /dev/null 2>&1; then
|
||||
pass "CLI '$cmd --help' works"
|
||||
else
|
||||
fail "CLI '$cmd --help' fails"
|
||||
fi
|
||||
done
|
||||
|
||||
# ── 2. Init & Validate compositions ─────────────────────────────────────────
|
||||
|
||||
section "Init compositions"
|
||||
|
||||
EXAMPLES=(warm-grain kinetic-type swiss-grid product-promo vignelli nyt-graph decision-tree)
|
||||
|
||||
for example in "${EXAMPLES[@]}"; do
|
||||
PROJ_DIR="${TEST_DIR}/init-${example}"
|
||||
if hyperframes init "$PROJ_DIR" --example "$example" --non-interactive --skip-skills 2>&1 | tail -3 >> "$LOG_FILE"; then
|
||||
if [ -f "$PROJ_DIR/index.html" ]; then
|
||||
pass "init --example $example created project with index.html"
|
||||
else
|
||||
fail "init --example $example: missing index.html"
|
||||
fi
|
||||
else
|
||||
fail "init --example $example failed"
|
||||
fi
|
||||
done
|
||||
|
||||
section "Validate compositions"
|
||||
|
||||
for example in "${EXAMPLES[@]}"; do
|
||||
PROJ_DIR="${TEST_DIR}/init-${example}"
|
||||
if [ -d "$PROJ_DIR" ]; then
|
||||
VALIDATE_OUT=$(hyperframes validate "$PROJ_DIR" 2>&1) || true
|
||||
# Count only real errors (✗ lines), not contrast warnings or GSAP warnings
|
||||
ERROR_COUNT=$(echo "$VALIDATE_OUT" | grep -c '✗' || echo 0)
|
||||
if [ "$ERROR_COUNT" -gt 0 ]; then
|
||||
fail "validate $example: $ERROR_COUNT error(s)"
|
||||
echo "$VALIDATE_OUT" >> "$ISSUES_FILE"
|
||||
else
|
||||
CONTRAST_WARNINGS=$(echo "$VALIDATE_OUT" | grep -c 'contrast warning' || echo 0)
|
||||
if [ "$CONTRAST_WARNINGS" -gt 0 ]; then
|
||||
warn "validate $example: contrast warnings only"
|
||||
else
|
||||
pass "validate $example: clean"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# ── 3. Render compositions ──────────────────────────────────────────────────
|
||||
|
||||
section "Render compositions (MP4)"
|
||||
|
||||
RENDER_EXAMPLES=(warm-grain kinetic-type swiss-grid)
|
||||
|
||||
for example in "${RENDER_EXAMPLES[@]}"; do
|
||||
PROJ_DIR="${TEST_DIR}/init-${example}"
|
||||
OUTPUT="${TEST_DIR}/render-${example}.mp4"
|
||||
if [ -d "$PROJ_DIR" ]; then
|
||||
log " Rendering $example..."
|
||||
RENDER_START=$(date +%s)
|
||||
if hyperframes render "$PROJ_DIR" --output "$OUTPUT" --quality draft --fps 24 2>&1 | tee -a "$LOG_FILE"; then
|
||||
RENDER_END=$(date +%s)
|
||||
RENDER_TIME=$((RENDER_END - RENDER_START))
|
||||
if [ -f "$OUTPUT" ]; then
|
||||
SIZE=$(stat --printf="%s" "$OUTPUT" 2>/dev/null || stat -f%z "$OUTPUT" 2>/dev/null || echo 0)
|
||||
if [ "$SIZE" -gt 1000 ]; then
|
||||
pass "render $example: ${SIZE} bytes in ${RENDER_TIME}s"
|
||||
# Validate with ffprobe
|
||||
if command -v ffprobe > /dev/null 2>&1; then
|
||||
DURATION=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$OUTPUT" 2>/dev/null || echo "0")
|
||||
VCODEC=$(ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 "$OUTPUT" 2>/dev/null || echo "unknown")
|
||||
RESOLUTION=$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 "$OUTPUT" 2>/dev/null || echo "unknown")
|
||||
log " Duration: ${DURATION}s, Codec: $VCODEC, Resolution: $RESOLUTION"
|
||||
if [ "$(echo "$DURATION > 0.5" | bc -l 2>/dev/null || echo 0)" = "1" ]; then
|
||||
pass "render $example: valid duration ${DURATION}s"
|
||||
else
|
||||
fail "render $example: duration too short (${DURATION}s)"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
fail "render $example: output too small (${SIZE} bytes)"
|
||||
fi
|
||||
else
|
||||
fail "render $example: output file missing"
|
||||
fi
|
||||
else
|
||||
fail "render $example: command failed"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# ── 4. Render format variants ────────────────────────────────────────────────
|
||||
|
||||
section "Render format variants"
|
||||
|
||||
PROJ_DIR="${TEST_DIR}/init-warm-grain"
|
||||
|
||||
for format in webm mov; do
|
||||
OUTPUT="${TEST_DIR}/render-warm-grain.${format}"
|
||||
if [ -d "$PROJ_DIR" ]; then
|
||||
log " Rendering warm-grain as $format..."
|
||||
if hyperframes render "$PROJ_DIR" --output "$OUTPUT" --format "$format" --quality draft --fps 24 2>&1 | tee -a "$LOG_FILE"; then
|
||||
if [ -f "$OUTPUT" ]; then
|
||||
SIZE=$(stat --printf="%s" "$OUTPUT" 2>/dev/null || stat -f%z "$OUTPUT" 2>/dev/null || echo 0)
|
||||
if [ "$SIZE" -gt 1000 ]; then
|
||||
pass "render warm-grain.$format: ${SIZE} bytes"
|
||||
else
|
||||
fail "render warm-grain.$format: output too small (${SIZE} bytes)"
|
||||
fi
|
||||
else
|
||||
fail "render warm-grain.$format: output file missing"
|
||||
fi
|
||||
else
|
||||
fail "render warm-grain.$format: command failed"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# ── 5. Sub-composition rendering ─────────────────────────────────────────────
|
||||
|
||||
section "Sub-composition rendering"
|
||||
|
||||
for example in "${EXAMPLES[@]}"; do
|
||||
PROJ_DIR="${TEST_DIR}/init-${example}"
|
||||
if [ -d "$PROJ_DIR/compositions" ]; then
|
||||
COMPS=$(find "$PROJ_DIR/compositions" -name '*.html' 2>/dev/null | head -3)
|
||||
if [ -n "$COMPS" ]; then
|
||||
for comp in $COMPS; do
|
||||
COMP_REL=$(echo "$comp" | sed "s|$PROJ_DIR/||")
|
||||
OUTPUT="${TEST_DIR}/render-${example}-sub-$(basename "$comp" .html).mp4"
|
||||
log " Rendering sub-comp: $example / $COMP_REL"
|
||||
if hyperframes render "$PROJ_DIR" -c "$COMP_REL" --output "$OUTPUT" --quality draft --fps 24 2>&1 | tee -a "$LOG_FILE"; then
|
||||
if [ -f "$OUTPUT" ]; then
|
||||
SIZE=$(stat --printf="%s" "$OUTPUT" 2>/dev/null || stat -f%z "$OUTPUT" 2>/dev/null || echo 0)
|
||||
if [ "$SIZE" -gt 1000 ]; then
|
||||
pass "sub-comp $example/$COMP_REL: ${SIZE} bytes"
|
||||
else
|
||||
fail "sub-comp $example/$COMP_REL: output too small (${SIZE} bytes)"
|
||||
fi
|
||||
else
|
||||
fail "sub-comp $example/$COMP_REL: output file missing"
|
||||
fi
|
||||
else
|
||||
fail "sub-comp $example/$COMP_REL: render failed"
|
||||
fi
|
||||
done
|
||||
else
|
||||
log " (no sub-compositions in $example)"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# ── 6. Preview server health check ──────────────────────────────────────────
|
||||
|
||||
section "Preview server health check"
|
||||
|
||||
PROJ_DIR="${TEST_DIR}/init-warm-grain"
|
||||
PREVIEW_PORT=13099
|
||||
PREVIEW_PID=""
|
||||
|
||||
if [ -d "$PROJ_DIR" ]; then
|
||||
hyperframes preview "$PROJ_DIR" --port "$PREVIEW_PORT" &
|
||||
PREVIEW_PID=$!
|
||||
sleep 5
|
||||
|
||||
if kill -0 "$PREVIEW_PID" 2>/dev/null; then
|
||||
pass "preview server started (PID $PREVIEW_PID)"
|
||||
|
||||
# Test API endpoints
|
||||
for endpoint in "/api/projects" "/api/runtime.js"; do
|
||||
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:${PREVIEW_PORT}${endpoint}" 2>/dev/null || echo "000")
|
||||
if [ "$STATUS" = "200" ]; then
|
||||
pass "GET $endpoint: $STATUS"
|
||||
else
|
||||
fail "GET $endpoint: $STATUS (expected 200)"
|
||||
fi
|
||||
done
|
||||
|
||||
# Test preview endpoint
|
||||
PROJECTS_JSON=$(curl -s "http://localhost:${PREVIEW_PORT}/api/projects" 2>/dev/null || echo "[]")
|
||||
if echo "$PROJECTS_JSON" | python3 -c "import sys,json; data=json.load(sys.stdin); assert len(data) > 0" 2>/dev/null; then
|
||||
pass "GET /api/projects returns project list"
|
||||
PROJECT_ID=$(echo "$PROJECTS_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin)[0]['id'])" 2>/dev/null || echo "")
|
||||
if [ -n "$PROJECT_ID" ]; then
|
||||
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:${PREVIEW_PORT}/api/projects/${PROJECT_ID}/preview" 2>/dev/null || echo "000")
|
||||
if [ "$STATUS" = "200" ]; then
|
||||
pass "GET /api/projects/$PROJECT_ID/preview: $STATUS"
|
||||
else
|
||||
fail "GET /api/projects/$PROJECT_ID/preview: $STATUS"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
fail "GET /api/projects returns empty or invalid JSON"
|
||||
fi
|
||||
|
||||
kill "$PREVIEW_PID" 2>/dev/null || true
|
||||
wait "$PREVIEW_PID" 2>/dev/null || true
|
||||
else
|
||||
fail "preview server failed to start"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ── 7. Lint check on compositions ────────────────────────────────────────────
|
||||
|
||||
section "Lint compositions"
|
||||
|
||||
for example in "${EXAMPLES[@]}"; do
|
||||
PROJ_DIR="${TEST_DIR}/init-${example}"
|
||||
if [ -d "$PROJ_DIR" ]; then
|
||||
LINT_OUT=$(hyperframes lint "$PROJ_DIR" 2>&1) || true
|
||||
LINT_EXIT=$?
|
||||
if [ $LINT_EXIT -eq 0 ]; then
|
||||
pass "lint $example: clean"
|
||||
else
|
||||
# Lint warnings are ok, errors are not
|
||||
if echo "$LINT_OUT" | grep -qi "error"; then
|
||||
fail "lint $example: errors found"
|
||||
echo "$LINT_OUT" >> "$ISSUES_FILE"
|
||||
else
|
||||
warn "lint $example: warnings"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# ── 8. Info command ──────────────────────────────────────────────────────────
|
||||
|
||||
section "Info command"
|
||||
|
||||
for example in warm-grain kinetic-type; do
|
||||
PROJ_DIR="${TEST_DIR}/init-${example}"
|
||||
if [ -d "$PROJ_DIR" ]; then
|
||||
if hyperframes info "$PROJ_DIR" 2>&1 | tee -a "$LOG_FILE" | grep -qi "duration\|fps\|resolution"; then
|
||||
pass "info $example: shows metadata"
|
||||
else
|
||||
fail "info $example: missing metadata in output"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# ── 9. Parallel render (if supported) ───────────────────────────────────────
|
||||
|
||||
section "Parallel render"
|
||||
|
||||
PROJ_DIR="${TEST_DIR}/init-warm-grain"
|
||||
OUTPUT="${TEST_DIR}/render-parallel.mp4"
|
||||
if [ -d "$PROJ_DIR" ]; then
|
||||
log " Rendering warm-grain with --workers 2..."
|
||||
if hyperframes render "$PROJ_DIR" --output "$OUTPUT" --workers 2 --quality draft --fps 24 2>&1 | tee -a "$LOG_FILE"; then
|
||||
if [ -f "$OUTPUT" ]; then
|
||||
SIZE=$(stat --printf="%s" "$OUTPUT" 2>/dev/null || stat -f%z "$OUTPUT" 2>/dev/null || echo 0)
|
||||
if [ "$SIZE" -gt 1000 ]; then
|
||||
pass "parallel render (2 workers): ${SIZE} bytes"
|
||||
else
|
||||
fail "parallel render: output too small (${SIZE} bytes)"
|
||||
fi
|
||||
else
|
||||
fail "parallel render: output file missing"
|
||||
fi
|
||||
else
|
||||
fail "parallel render: command failed"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ── 10. PNG sequence render ─────────────────────────────────────────────────
|
||||
|
||||
section "PNG sequence render"
|
||||
|
||||
PROJ_DIR="${TEST_DIR}/init-warm-grain"
|
||||
OUTPUT_DIR="${TEST_DIR}/render-png-seq"
|
||||
if [ -d "$PROJ_DIR" ]; then
|
||||
if hyperframes render "$PROJ_DIR" --output "$OUTPUT_DIR" --format png-sequence --quality draft --fps 24 2>&1 | tee -a "$LOG_FILE"; then
|
||||
PNG_COUNT=$(find "$OUTPUT_DIR" -name '*.png' 2>/dev/null | wc -l)
|
||||
if [ "$PNG_COUNT" -gt 5 ]; then
|
||||
pass "png-sequence render: $PNG_COUNT frames"
|
||||
else
|
||||
fail "png-sequence render: only $PNG_COUNT frames"
|
||||
fi
|
||||
else
|
||||
fail "png-sequence render: command failed"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ── 11. Resolution variants ─────────────────────────────────────────────────
|
||||
|
||||
section "Resolution variants"
|
||||
|
||||
PROJ_DIR="${TEST_DIR}/init-warm-grain"
|
||||
# Only test resolutions matching the composition's aspect ratio.
|
||||
# warm-grain is landscape (1920x1080) — portrait would correctly fail.
|
||||
for res in landscape landscape-4k; do
|
||||
OUTPUT="${TEST_DIR}/render-${res}.mp4"
|
||||
if [ -d "$PROJ_DIR" ]; then
|
||||
log " Rendering warm-grain at $res resolution..."
|
||||
if hyperframes render "$PROJ_DIR" --output "$OUTPUT" --resolution "$res" --quality draft --fps 24 2>&1 | tee -a "$LOG_FILE"; then
|
||||
if [ -f "$OUTPUT" ]; then
|
||||
ACTUAL_RES=$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 "$OUTPUT" 2>/dev/null || echo "unknown")
|
||||
pass "render resolution=$res: $ACTUAL_RES"
|
||||
else
|
||||
fail "render resolution=$res: output file missing"
|
||||
fi
|
||||
else
|
||||
fail "render resolution=$res: command failed"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# ── Summary ──────────────────────────────────────────────────────────────────
|
||||
|
||||
section "Summary"
|
||||
log "PASS: $PASS | FAIL: $FAIL | WARN: $WARN"
|
||||
log "Test dir: $TEST_DIR"
|
||||
log "Log: $LOG_FILE"
|
||||
if [ -f "$ISSUES_FILE" ]; then
|
||||
log "Issues: $ISSUES_FILE"
|
||||
log ""
|
||||
log "Issues found:"
|
||||
cat "$ISSUES_FILE" | tee -a "$LOG_FILE"
|
||||
fi
|
||||
|
||||
# Cleanup preview server if still running
|
||||
if [ -n "$PREVIEW_PID" ] && kill -0 "$PREVIEW_PID" 2>/dev/null; then
|
||||
kill "$PREVIEW_PID" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "EXIT_CODE: $FAIL"
|
||||
exit 0
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
# E2E loop runner — called by the hourly schedule
|
||||
# Appends results to a persistent log across iterations
|
||||
set -uo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
RESULTS_DIR="/tmp/hyperframes-e2e-loop"
|
||||
mkdir -p "$RESULTS_DIR"
|
||||
|
||||
ITERATION=${1:-1}
|
||||
LOG="$RESULTS_DIR/iteration-${ITERATION}.log"
|
||||
SUMMARY="$RESULTS_DIR/summary.log"
|
||||
|
||||
echo "=== Iteration $ITERATION — $(date -u +%Y-%m-%dT%H:%M:%SZ) ===" | tee -a "$SUMMARY"
|
||||
|
||||
# Run the e2e suite and capture output
|
||||
bash "$SCRIPT_DIR/e2e-alpha-test.sh" > "$LOG" 2>&1
|
||||
EXIT=$?
|
||||
|
||||
# Extract summary line
|
||||
RESULT=$(grep -E '^.*PASS:.*FAIL:.*WARN:' "$LOG" | tail -1)
|
||||
echo " $RESULT" | tee -a "$SUMMARY"
|
||||
|
||||
# Extract issues
|
||||
if grep -q "^ISSUE:" "$LOG"; then
|
||||
echo " Issues:" | tee -a "$SUMMARY"
|
||||
grep "^ISSUE:" "$LOG" | sort -u | while read -r line; do
|
||||
echo " $line" | tee -a "$SUMMARY"
|
||||
done
|
||||
fi
|
||||
|
||||
echo "" >> "$SUMMARY"
|
||||
echo "Iteration $ITERATION complete. Log: $LOG"
|
||||
Reference in New Issue
Block a user