Skip to content

Commit ce1770f

Browse files
committed
install ffmpeg to fix CI
1 parent 4604094 commit ce1770f

4 files changed

Lines changed: 67 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ jobs:
5151
- name: Set SDK_DIR
5252
run: echo "SDK_DIR=$PWD/renpy-${{ matrix.renpy }}-sdk" >> "$GITHUB_ENV"
5353

54+
# The video-variant testcases encode with real ffmpeg/ffprobe; the ubuntu
55+
# runner images don't ship them, so a job launch fails with OSError errno 2
56+
# (the "fix weird layout shift" era of CI failures). Install before run.
57+
- name: Install ffmpeg
58+
run: sudo apt-get update && sudo apt-get install -y ffmpeg
59+
5460
# The `test` command is uses_display=True and the 7.x leg forces
5561
# SDL_VIDEODRIVER=x11 -- both need a real X server. xvfb provides it.
5662
- name: Run testcases

cue_lib/ui/views/video_vfx.rpy

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ screen _cue_edit_queue_vbox():
2828
"xmark",
2929
Function(_cue.video_editor.job_queue.remove, job.job_id),
3030
"Remove from queue")
31-
text job.filename() + " " + job.speed_label size 11
31+
text job.filename() + " " + job.speed_label substitute False size 11
3232
text "(" + job.status_text() + ")" size 11
3333
if job.status != CueJobStatus.QUEUED:
3434
$ _elapsed = int(job.elapsed())
@@ -39,7 +39,10 @@ screen _cue_edit_queue_vbox():
3939
hbox:
4040
spacing 5
4141
null width 20
42-
text job.error_msg size 11 color _cue_color_error
42+
# An ffmpeg failure message (e.g. "[Errno 2] ...") is not
43+
# markup: substituting it would py_eval the brackets and
44+
# crash the whole overlay on every frame.
45+
text job.error_msg substitute False size 11 color _cue_color_error
4346
use cue_txt_button("Retry",
4447
Function(_cue.video_editor.job_queue.retry, job.job_id))
4548

test_game/templates/testcases_legacy.rpy

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,38 @@ testcase click_create_tab_opens_editor:
541541
$ if not _ok: renpy.quit(status=1)
542542
$ renpy.quit()
543543

544+
testcase video_queue_error_msg_substitute_guard:
545+
$ _cue.is_overlay_visible = True
546+
run Jump("start")
547+
pause 2.0
548+
$ renpy.show("cuevid")
549+
pause 1.0
550+
$ _cue.video_editor.create(1.5)
551+
python:
552+
import time as _time
553+
_queue = _cue.video_editor.job_queue
554+
_deadline = _time.time() + 30.0
555+
while _queue.processing and _time.time() < _deadline:
556+
_queue.poll()
557+
_time.sleep(0.1)
558+
# Regression for the CI crash on runners without ffmpeg: a failed encode
559+
# sets error_msg to "[Errno 2] ...". The queue text used to be substituted,
560+
# so those brackets were py_eval'd and crashed the whole overlay on every
561+
# render. Both dynamic text lines are `substitute False` now -- render the
562+
# queue with a bracketed error (and bracketed filename) to prove it.
563+
$ _cue.video_editor.open_editor()
564+
$ _job = _cue.video_editor.job_queue.jobs[-1]
565+
$ _job.status = CueJobStatus.ERROR
566+
$ _job.vpath = "videos/[bracket] scene.mp4"
567+
$ _job.error_msg = "[Errno 2] No such file or directory: 'ffmpeg'"
568+
$ renpy.restart_interaction()
569+
pause 0.5
570+
$ _ok = _job.error_msg == "[Errno 2] No such file or directory: 'ffmpeg'"
571+
$ _cue.video_editor.close_editor()
572+
$ renpy.restart_interaction()
573+
$ if not _ok: renpy.quit(status=1)
574+
$ renpy.quit()
575+
544576
testcase video_seamless_transition_preserves_position:
545577
$ _cue.is_overlay_visible = True
546578
run Jump("start")

test_game/templates/testcases_modern.rpy

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,30 @@ testcase click_create_tab_opens_editor:
434434
click "Create"
435435
assert eval (_cue.video_editor.active)
436436

437+
testcase video_queue_error_msg_substitute_guard:
438+
run Jump("start")
439+
$ _test.timeout = 10.0
440+
run Function(_cue_set_page, CuePage.SFX)
441+
$ renpy.show("cuevid")
442+
pause 1.0
443+
$ _cue.video_editor.create(1.5)
444+
pause 0.1 until eval (not _cue.video_editor.job_queue.processing) timeout 30.0
445+
# Regression for the CI crash on runners without ffmpeg: a failed encode
446+
# sets error_msg to "[Errno 2] ...". The queue text used to be substituted,
447+
# so those brackets were py_eval'd and crashed the whole overlay on every
448+
# render. Both dynamic text lines are `substitute False` now -- render the
449+
# queue with a bracketed error (and bracketed filename) to prove it.
450+
$ _cue.video_editor.open_editor()
451+
$ _job = _cue.video_editor.job_queue.jobs[-1]
452+
$ _job.status = CueJobStatus.ERROR
453+
$ _job.vpath = "videos/[bracket] scene.mp4"
454+
$ _job.error_msg = "[Errno 2] No such file or directory: 'ffmpeg'"
455+
$ renpy.restart_interaction()
456+
pause 0.3
457+
assert eval (_job.error_msg == "[Errno 2] No such file or directory: 'ffmpeg'")
458+
$ _cue.video_editor.close_editor()
459+
$ renpy.restart_interaction()
460+
437461
testcase video_seamless_transition_preserves_position:
438462
run Jump("start")
439463
$ renpy.show("cuevid")

0 commit comments

Comments
 (0)