Skip to content

Commit ab96ddc

Browse files
committed
pr-media prefers film.mp4 — the whole session, not just the browser hop
1 parent a91fd35 commit ab96ddc

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

e2e/scripts/pr-media.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
// the PR description.
99
//
1010
// Usage: bun e2e/scripts/pr-media.ts <run-dir-or-artifact> [...more]
11-
// run dir e2e/runs/<target>/<scenario-slug> — picks session.mp4 or
12-
// terminal.cast and labels the gif from result.json
11+
// run dir e2e/runs/<target>/<scenario-slug> — picks film.mp4 (the
12+
// whole session), else session.mp4, else terminal.cast;
13+
// labels the gif from result.json
1314
// session.mp4 browser recording (ffmpeg -> gif)
1415
// terminal.cast terminal recording (agg -> gif; brew install agg)
1516
// *.png run screenshot, uploaded as-is
@@ -48,10 +49,13 @@ const resolveArtifact = (input: string): Artifact => {
4849
slug: basename(path).replace(/\.[^.]+$/, ""),
4950
};
5051
}
51-
const recording = ["session.mp4", "terminal.cast"]
52+
// film.mp4 (scripts/film.ts) is the whole session — terminal chat AND the
53+
// browser hop, cut in time order; the bare browser session.mp4 is only the
54+
// hop, so it must never win when a film exists.
55+
const recording = ["film.mp4", "session.mp4", "terminal.cast"]
5256
.map((name) => join(path, name))
5357
.find(existsSync);
54-
if (!recording) throw new Error(`${input} has no session.mp4 or terminal.cast`);
58+
if (!recording) throw new Error(`${input} has no film.mp4, session.mp4, or terminal.cast`);
5559
let label = basename(path);
5660
try {
5761
const result = JSON.parse(readFileSync(join(path, "result.json"), "utf8")) as {

0 commit comments

Comments
 (0)