tests/e2e: local runs turn each kept recording into an MP4
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start in tests/e2e/run.sh, where the tool check loop and on_exit's summary line are, and in the loader from #170, which must land first. The new file tests/e2e/lib/mp4.sh holds mp4_tools and make_mp4s, and tests/e2e-mp4.sh tests them with fake agg and ffmpeg on a restricted PATH. Done means the no-root test passes in lint.yml, the MP4s appear only for kept casts, and results.json gains recording.mp4 without changing duration_s.
由索引模型根据 Issue 内容生成。
描述
Epic #164 · Milestone Phase 1: Community & CI · Priority medium · Size S · Depends on #170, #172
Why
A .cast needs a player. An MP4 opens in any video player and can be attached to an issue, so a local failure can be shown to someone who does not run the tests.
MP4 files are binary and come from VMs that may run pull request code, so they stay local: CI makes none. The tools are optional, and a missing or failing tool never changes a scenario's result.
Decide first
- MP4 playback (question 4 of #164).
- Proposed: idle limit 2 s and speed 1x (
agg --idle-time-limit 2 --speed 1), the same idle limit as the cast header. - Alternative: a faster speed, such as 2x, for shorter videos of long scenarios like
prep-run. - Reason: the video keeps the pace of the report player and of an operator, so prompts and questions stay readable. The idle limit already cuts the waits, and every video player can speed up.
- Proposed: idle limit 2 s and speed 1x (
- Installing agg (question 6 of #164).
- Proposed: a documented download in
docs/e2e-tests.md: a pinned release with its SHA-256, checked withsha256sum -c. The harness only looks onPATH. - Alternative: the harness downloads the pinned release into
$CACHE_DIR/bin(theE2E_CACHEfolder) and checks it, likeimage_getchecks the cloud images. - Reason: an e2e run never fetches and runs a binary on the host by itself. Only people who want videos need agg, and CI never does.
- Proposed: a documented download in
What to do
-
VIDEO_MP4=auto|yes|noin the loader of #170:autoine2e.cfg,noin its CI branch. A bad value exits 2.- Its environment variable is
E2E_VIDEO_MP4, andVIDEOisE2E_VIDEO: theE2E_<SETTING>form ofE2E_DEADLINE_MINforDEADLINE_MIN. If #170 merges with other names, use those here and in the tests. --helplistsE2E_VIDEO_MP4underEnvironment:.
- Its environment variable is
- New
tests/e2e/lib/mp4.sh, sourced byrun.shwith a# shellcheck source=line like the other libs. It holds:mp4_tools: returns 0 whencommand -vfinds bothaggandffmpeg, 1 otherwise. Prints nothing.make_mp4s, below.
- Tool check in
tests/e2e/run.sh, right after thefor tool in qemu-system-x86_64 qemu-img xorriso ...loop and beforerm -rf "$OUT":yes: whenmp4_toolsfails, print the install steps and exit 2.auto: when it fails, the MP4 step is off. Right after the summary line, the run prints one line that says so and points to the docs.no, orVIDEO=off: nothing is checked.
-
make_mp4sconverts each$OUT/<id>.castnamed in$OUT/results.json.- Contract with #172: a scenario's
recordingis an object,{"cast": "<id>.cast"}, and this issue adds"mp4": "<id>.mp4"to it. With a string, the jq patch below exits 5 (Cannot index string with string "mp4"). - Run the secret check of #172 on the cast first. A cast that fails it gets no agg call and no MP4: a video would show the password as pixels, which no grep finds.
- Work in
tmp="$(mktemp -d "$OUT/.mp4.XXXXXX")", not in$WORK(deleted by then). The next run'srm -rf "$OUT"clears a folder left by a Ctrl-C. agg --idle-time-limit 2 --speed 1 "$OUT/$id.cast" "$tmp/$id.gif", thenffmpeg -loglevel error -y -i "$tmp/$id.gif" -c:v libx264 -pix_fmt yuv420p -movflags +faststart -vf 'scale=trunc(iw/2)*2:trunc(ih/2)*2' "$tmp/$id.mp4", thenmvit to$OUT/$id.mp4and remove$tmp.-c:v libx264makes an ffmpeg build without x264 fail instead of writingmpeg4. H.264 withyuv420pneeds an even width and height.- Patch
$OUT/results.jsonwith jq (.scenarios |= map(if .id == $id then .recording.mp4 = $f else . end)) into a temp file in$OUT, thenmvit over. Do not callwrite_resultsagain: it rebuilds the file from$WORK/scenarios.jsonland recomputesduration_s. - Return 1 when a conversion failed.
- Contract with #172: a scenario's
- Call
make_mp4sinon_exitright after the summary line (<os>: N passed, ...). By thenvm_killandrm -rf "$WORK"have run, and the secret check of #172 has scanned$OUT. A Ctrl-C during a conversion then endson_exit(the INT trap'sexit 1) with the VM already stopped and its disk gone from$CACHE_DIR/runs/, unless the VM is kept.- Skip it when
[[ $ABORT == interrupted ]]. The INT/TERM trap sets that, and itsexit 1still runson_exit. Do not test[[ -n $ABORT ]]:ABORTis alsotime limit reachedon a run that ended normally. - Its lines, where the MP4s are or the
autoinstall hint, come right after the summary line. - When a VM is kept, the kept-VM lines that #176 moves after the summary come after the MP4 lines and stay the last lines of the run. Whichever of the two PRs merges second keeps this order.
- Skip it when
- A failed conversion prints a warning with
auto. Withyes,on_exitcallsexit 1itself as its last command: the status of an EXIT trap's last command does not change the exit code. Scenario results do not change. - CI makes none: a step after
Scenariosin.github/workflows/e2e.yml, withif: always(), fails the job whene2e-out/holds an.mp4. Withoutif: always()it would be skipped when a scenario fails, and those are the only CI runs that keep casts. - No-root tests:
- The
VIDEO_MP4cases of the loader go in the no-root test of #170: defaultauto,nowithCI=true,E2E_VIDEO_MP4wins over the file, a bad value exits 2. - New
tests/e2e-mp4.sh. It sourcestests/e2e/lib/record.shandtests/e2e/lib/mp4.sh, and callsmake_mp4son a fakeout/<os>/with.castfiles and aresults.jsonwhoserecordingfields have the object shape above. Fakeaggandffmpegrecord their arguments and write their output file. Cases: good fakes, a failing fake, a cast that holds$E2E_ADMIN_PASSWORD, andmp4_toolswithout agg. - Fakes first on
PATHcannot hide a real agg in~/.local/binor ffmpeg in/usr/bin, next tojq. For the "without agg" cases the test setsPATHto its own folder: links to every command of the realPATHexceptaggandffmpeg, plus the fakes.tests/exit-status.shmeets the same problem withtailscaleand overrideshave, butrun.shcallscommand -v, so onlyPATHworks here. - The same file runs
run.sh --os debian-13 --out <tmp>withE2E_VIDEO_MP4=yes,E2E_VIDEO=on, thatPATH, and fakeqemu-system-x86_64,qemu-imgandxorriso.E2E_VIDEO=onkeeps a developer'se2e.local.cfgwithVIDEO=offfrom skipping the check. - A new step in
.github/workflows/lint.yml, next toE2E report builder, runsbash tests/e2e-mp4.sh. CONTRIBUTING.md, "Before you open a pull request": addbash tests/e2e-mp4.shunderbash tests/e2e-report.sh, with a one-line comment, and the same line to the## Commandsblock ofAGENTS.md.
- The
-
docs/e2e-tests.md, under## Run it on your machine: installing agg (pinned release, SHA-256 check, into~/.local/bin) and ffmpeg (sudo apt install ffmpeg), theVIDEO_MP4row of the settings table, where the MP4s are, and how to attach one to an issue. -
CHANGELOG.md: one line under## [Unreleased].
Acceptance criteria
-
tests/e2e-mp4.shpasses in the lint workflow and is listed inCONTRIBUTING.md. - With good fakes: one
.mp4per kept cast, agg got--idle-time-limit 2 --speed 1, ffmpeg got-c:v libx264, no GIF or.mp4.*folder is left, andresults.jsonhasrecording.mp4next torecording.cast, with an unchangedduration_s. - With a failing fake: a warning,
make_mp4sreturns 1, no half.mp4, andresults.jsonis still valid JSON with the same scenario statuses. - A cast that holds
$E2E_ADMIN_PASSWORDgets no.mp4, and agg is not called for it. -
mp4_toolsreturns 1 without agg, even on a host with agg and ffmpeg installed.E2E_VIDEO_MP4=yeswithout agg onPATHexits 2 with the agg/ffmpeg message, and the--outfolder has nodebian-13/. - Locally,
E2E_VIDEO_MP4=auto tests/e2e/run.sh --os debian-13 --only audit-freshwith agg offPATHprints the install hint after the summary line and exits 0. - With
CI=true, the loader givesVIDEO_MP4=no. No code intests/e2e/downloads agg or ffmpeg, or puts an executable in$E2E_CACHE. - Locally, with agg and ffmpeg installed,
tests/e2e/run.shwith no flag readse2e.cfg(debian-13) and leaves a.castand an.mp4for every passed scenario. ThenE2E_FAIL_SCENARIO=audit-fresh tests/e2e/run.sh(the test hook of #170) leaves both for every passed scenario and for the failedaudit-fresh. -
ffprobeshowsh264andyuv420pfor each MP4, andprep-interactive.mp4plays in Firefox and Chrome. - A Ctrl-C during the MP4 step of a passed run leaves no run folder in
$CACHE_DIR/runs/, no half$OUT/<id>.mp4, and a validresults.json. A.mp4.XXXXXX/folder may remain until the next run. - The no-MP4 step in
e2e.ymlhasif: always()and passes on every system in this PR's e2e run. ShellCheck stays clean.
Not in this issue
- Writing the casts, the
recordingfield, theVIDEOmodes and the secret check: #172. - The loader,
e2e.cfg, its CI branch, theE2E_<SETTING>names andE2E_FAIL_SCENARIO: #170. - Keeping a VM and the kept-VM lines: #176.
- Running without
--oson several systems: #177. - Keeping MP4 files out of the report and off the Pages site: #173.
- 主要语言
- Shell
- 星标
- 2
- 派生
- 3
- 平均合并
- 2 天 14 分钟
- 30 天内合并 PR
- 47
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
exceev-consulting/server-prep 的其他 Issue
-
area: docs bug claude documentation good first issue priority: low size: S triaged
难度 2/5 1-3 小时 新手友好度 82/100
exceev-consulting/server-prep#225 ·
维护者通常 2 天内回复
-
area: preconfig bug claude priority: medium size: S triaged
难度 2/5 1-3 小时 新手友好度 88/100
exceev-consulting/server-prep#224 ·
维护者通常 2 天内回复
-
claude enhancement priority: low size: S
难度 2/5 1-3 小时 新手友好度 85/100
exceev-consulting/server-prep#222 ·
维护者通常 2 天内回复
-
e2e flake: boot fails on debian-13 when its genericcloud image is missing from SHA512SUMS可能已有人在做 @exceev-claude 于 1 天前认领。 未关闭area: ci bug claude priority: high size: S
难度 2/5 1-3 小时 新手友好度 62/100
exceev-consulting/server-prep#212 · 2 条评论 ·
维护者通常 2 天内回复
-
server-audit.sh: flag world-writable directories in /etc such as /etc/dokploy (GHSA-qxjv-6cvh-32c6)未关闭area: audit claude enhancement panel: dokploy priority: high security size: S triaged
难度 2/5 1-3 小时 新手友好度 72/100
exceev-consulting/server-prep#211 ·
维护者通常 2 天内回复
查看 exceev-consulting/server-prep 的全部 Issue
相似的 Issue
-
bot-found documentation priority: P3
难度 1/5 1-3 小时 新手友好度 88/100
madenvel/KalinkaPlayer#602 ·
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
huggingface/kernels#1006 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 94/100
维护者通常 2 天内回复
-
severity: low
难度 2/5 1-3 小时 新手友好度 84/100
luainkernel/lunatik#2594 ·
维护者通常 1 天内回复