1
0
Fork 0
mirror of https://passt.top/passt synced 2025-06-01 05:45:42 +02:00

demo, ci: Switch to asciinema(1) for terminal recordings

For demos, cool-retro-term(1) looked fancier, but several threads of
that and ffmpeg(1) are just messing up with performance testing.

The CI videos started getting really big as well, and they were
difficult to read.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2022-02-22 18:29:45 +01:00
parent be2a7898e9
commit 337f55166f
7 changed files with 146 additions and 112 deletions
test/lib

View file

@ -539,33 +539,22 @@ pause_continue() {
info_nolog ""
}
# run_term() - Start tmux session, X terminal if requested, running entry point
# run_term() - Start tmux session, running entry point, with recording if needed
run_term() {
export SHELL="/bin/sh"
tmux set-option -g default-shell "/bin/sh"
tmux set-option -g update-environment "PCAP DEBUG"
if [ ${CI} -eq 1 ]; then
__xterm_done="$(mktemp)"
if [ ${XVFB} -eq 1 ]; then
xvfb-run -s "-screen 0 4000x4000x24 -ac" ${CI_XTERM} "$(pwd)" -e "sh -c \"printf '\e[8;50;240t'; tmux new-session -s passt_test ./ci from_term; echo >${__xterm_done}\""
else
${CI_XTERM} "$(pwd)" -e "sh -c \"printf '\e[8;50;240t'; tmux new-session -s passt_test ./ci from_term; echo >${__xterm_done}\""
fi
while ! [ -s "${__xterm_done}" ]; do sleep 1; done
rm "${__xterm_done}"
printf '\e[8;50;240t'
asciinema rec --overwrite ci.uncut -c 'tmux new-session -s passt_test ./ci from_term'
video_postprocess ci.uncut
elif [ ${DEMO} -eq 1 ]; then
while true; do
if [ ${XVFB} -eq 1 ]; then
xvfb-run -s "-screen 0 4000x4000x24 -ac" ${DEMO_XTERM} "$(pwd)" -e sh -c 'tmux new-session -s passt_test ./run_demo from_term'
else
${DEMO_XTERM} "$(pwd)" -e sh -c 'tmux new-session -s passt_test ./run_demo from_term'
fi
[ $? -ne 0 ] && { tmux kill-session -t passt_test; continue; }
break
done
printf '\e[8;40;130t'
asciinema rec --overwrite demo.uncut -c 'tmux new-session -s passt_test ./run_demo from_term'
video_postprocess demo.uncut
else
tmux new-session -s passt_test ./run from_term
tmux new-session -s passt_test ./run_demo from_term
fi
}