[PATCH v4 00/12] Improve handling of test temporary files
Sigh. Even more silly errors The tests create temporary files and fifos in a number of places. Some of them can interfere with later test runs, and are awkward to clean up. Consolidate them in a single per-run directory in /tmp which gets cleaned up automatically. This is based on the earlier userns cleanup series. Changes since v3: * Fixed problem with ssh hosts file naming which caused a bunch of non-fatal warnings Changes since v2: * Reinstated patch to move the log pipe accidentally dropped during a rebase Chances since v1: * Fixed a number of straightforward bugs where things were missed * Also removed files we're no longer putting into the source tree from .gitignore * Added an extra patch moving the video processing files David Gibson (12): test: Group tests by context then protocol, rather than the reverse test: Remove unused variable FFMPEG_PID_FILE test: Actually run cleanup function test: Create common state directories for temporary files test: Move passt_test_log_pipe to state directory test: Move context temporary files to state dir test: Dont regnerate small test file in pasta/tcp test: Use paths in __STATEDIR__ instead of 'temp' and 'tempdir' directives test: Move pause temporary file to state directory test: Store pcap files in $LOGDIR instead of /tmp test: Move pidfiles and nsholder sockets into state directory test: Move video processing files to $STATEBASE .gitignore | 1 - test/.gitignore | 3 - test/build/all | 31 ++++--- test/demo/passt | 9 +- test/demo/pasta | 12 ++- test/demo/podman | 11 ++- test/distro/debian | 2 +- test/distro/fedora | 2 +- test/distro/opensuse | 16 ++-- test/distro/ubuntu | 8 +- test/lib/context | 61 +++++++------- test/lib/layout | 16 ++-- test/lib/setup | 84 ++++++++++--------- test/lib/term | 26 +++--- test/lib/test | 14 +--- test/lib/video | 20 ++--- test/{dhcp/passt => passt/dhcp} | 2 +- test/{ndp/passt => passt/ndp} | 2 +- test/{shutdown/passt => passt/shutdown} | 4 +- test/{tcp/passt => passt/tcp} | 6 +- test/{udp/passt => passt/udp} | 8 +- test/{icmp/passt_in_ns => passt_in_ns/icmp} | 2 +- .../passt_in_ns => passt_in_ns/shutdown} | 4 +- test/{tcp/passt_in_ns => passt_in_ns/tcp} | 10 +-- test/{udp/passt_in_ns => passt_in_ns/udp} | 8 +- test/{dhcp/pasta => pasta/dhcp} | 2 +- test/{ndp/pasta => pasta/ndp} | 2 +- test/{tcp/pasta => pasta/tcp} | 13 ++- test/{udp/pasta => pasta/udp} | 20 ++--- test/run | 48 +++++------ 30 files changed, 217 insertions(+), 230 deletions(-) rename test/{dhcp/passt => passt/dhcp} (98%) rename test/{ndp/passt => passt/ndp} (95%) rename test/{shutdown/passt => passt/shutdown} (80%) rename test/{tcp/passt => passt/tcp} (96%) rename test/{udp/passt => passt/udp} (88%) rename test/{icmp/passt_in_ns => passt_in_ns/icmp} (94%) rename test/{shutdown/passt_in_ns => passt_in_ns/shutdown} (79%) rename test/{tcp/passt_in_ns => passt_in_ns/tcp} (97%) rename test/{udp/passt_in_ns => passt_in_ns/udp} (97%) rename test/{dhcp/pasta => pasta/dhcp} (96%) rename test/{ndp/pasta => pasta/ndp} (95%) rename test/{tcp/pasta => pasta/tcp} (95%) rename test/{udp/pasta => pasta/udp} (74%) -- 2.37.3
e.g. passt/dhcp rather than dhcp/passt. This is more consistent with the
two_guests and other test groups, and makes some other cleanups simpler.
Signed-off-by: David Gibson
FFPMPEG_PID_FILE is set (creating a temporary file), then never used.
Signed-off-by: David Gibson
We install a cleanup() function with 'trap' in order to clean up temporary
files we generate during the tests. However, we deinstall it after
run_term, which means it won't run in most of the cases where it would be
useful. Even if "run from_term" exits with an error, that error will be
hidden from the run_term wrapper because it's within a tmux session, so we
will return from run_term normally, uninstall the trap and never clean up.
In fact there's no reason to uninstall the trap at all, it works just as
well on the success exit path as an error exit path.
Signed-off-by: David Gibson
The test scripts create a bunch of temporary files to keep track of
internal state. Some are made in /tmp with individual mktemp calls, some
go in the passt source directory, and some go in $LOGDIR. This can
sometimes make it messy to clean up after failed test runs.
Start cleaning this up by creating a single "state" directory ($STATEBASE)
in /tmp for all the state or temporary files used by a single test run.
Clean it up automatically in cleanup() - except when DEBUG==1, because
those files can be useful for debugging test script failures.
We create subdirectories under $STATEBASE for each setup function, exposed
as $STATESETUP. We also create subdirectories for each test script and
expose those to the scripts as __STATEDIR__.
Signed-off-by: David Gibson
We use this fifo to send messages to the information pane. Put it in the
state directory so it doesn't need its own cleanup.
Signed-off-by: David Gibson
Currently the context command dispatch subsystem creates a bunch of
temporary files in $LOGDIR, which is messy. Store them in $STATEDIR which
is for precisely this purpose. The logs from each context still go into
$LOGDIR.
Signed-off-by: David Gibson
In what looks like a copy/paste error, pasta/tcp generates its small test
file twice.
Signed-off-by: David Gibson
Instead of using the 'temp' and 'tempdir' DSL directives to create
temporary files, use fixed paths relative to __STATEDIR__. This has two
advantages:
1) The files are automatically cleaned up if the tests fail (and even if
that doesn't work they're easier to clean up manuall)
2) When debugging tests it's easier to figure out which of the temporary
files are relevant to whatever's going wrong
Signed-off-by: David Gibson
On Fri, 9 Sep 2022 13:30:24 +1000
David Gibson
Instead of using the 'temp' and 'tempdir' DSL directives to create temporary files, use fixed paths relative to __STATEDIR__. This has two advantages: 1) The files are automatically cleaned up if the tests fail (and even if that doesn't work they're easier to clean up manuall) 2) When debugging tests it's easier to figure out which of the temporary files are relevant to whatever's going wrong
Signed-off-by: David Gibson
[...]
+++ b/test/passt/udp @@ -15,9 +15,9 @@ gtools socat tee grep cat ip jq md5sum cut htools printf dd socat tee grep cat ip jq md5sum cut
test UDP/IPv4: host to guest -temp TEMP -temp SC_PID -guestb (socat -u UDP4-LISTEN:10001 STDOUT & echo $! > __SC_PID__) | tee test.bin | (grep -qm1 "END_OF_TEST" && kill $(cat __SC_PID__)) +set TEMP __STATEDIR__/data +set SC_PID __STATEDIR__/socat.pid +guestb (socat -u UDP4-LISTEN:10001 STDOUT & echo $! > sc.pid) | tee test.bin | (grep -qm1 "END_OF_TEST" && kill $(cat sc.pid))
Here it's sc.pid,
sleep 1 host dd if=/dev/urandom bs=1k count=5 > __TEMP__ && printf "\nEND_OF_TEST\n" >> __TEMP__ host socat -u OPEN:__TEMP__ UDP4:127.0.0.1:10001 diff --git a/test/passt_in_ns/tcp b/test/passt_in_ns/tcp index 5ec95e8..a2cb667 100644 --- a/test/passt_in_ns/tcp +++ b/test/passt_in_ns/tcp @@ -16,7 +16,7 @@ htools dd socat ip jq md5sum cut nstools socat ip jq md5sum cut
test TCP/IPv4: host to guest: big transfer -temp TEMP_BIG +set TEMP_BIG __STATEDIR__/big.img guestb socat -u TCP4-LISTEN:10001 OPEN:test_big.bin,create,trunc sleep 1 host dd if=/dev/urandom bs=1M count=10 of=__TEMP_BIG__ @@ -27,7 +27,7 @@ gout GUEST_MD5_BIG md5sum test_big.bin | cut -d' ' -f1 check [ "__GUEST_MD5_BIG__" = "__MD5_BIG__" ]
test TCP/IPv4: host to ns: big transfer -temp TEMP_NS_BIG +set TEMP_NS_BIG __STATEDIR__/big_ns.img nsb socat -u TCP4-LISTEN:10002 OPEN:__TEMP_NS_BIG__,create,trunc host socat -u OPEN:__TEMP_BIG__ TCP4:127.0.0.1:10002 nsw @@ -82,7 +82,7 @@ gout GUEST_MD5_BIG md5sum test_big.bin | cut -d' ' -f1 check [ "__GUEST_MD5_BIG__" = "__MD5_BIG__" ]
test TCP/IPv4: host to guest: small transfer -temp TEMP_SMALL +set TEMP_SMALL __STATEDIR__/small.img guestb socat -u TCP4-LISTEN:10001 OPEN:test_small.bin,create,trunc sleep 1 host dd if=/dev/urandom bs=2k count=100 of=__TEMP_SMALL__ @@ -93,7 +93,7 @@ gout GUEST_MD5_SMALL md5sum test_small.bin | cut -d' ' -f1 check [ "__GUEST_MD5_SMALL__" = "__MD5_SMALL__" ]
test TCP/IPv4: host to ns: small transfer -temp TEMP_NS_SMALL +set TEMP_NS_SMALL __STATEDIR__/small_ns.img nsb socat -u TCP4-LISTEN:10002 OPEN:__TEMP_NS_SMALL__,create,trunc host socat -u OPEN:__TEMP_SMALL__ TCP4:127.0.0.1:10002 nsw diff --git a/test/passt_in_ns/udp b/test/passt_in_ns/udp index c22a68f..3b1e521 100644 --- a/test/passt_in_ns/udp +++ b/test/passt_in_ns/udp @@ -16,8 +16,8 @@ nstools socat tee grep cat ip jq md5sum cut htools printf dd socat tee grep cat ip jq md5sum cut
test UDP/IPv4: host to guest -temp TEMP -temp SC_PID +set TEMP __STATEDIR__/data +set SC_PID __STATEDIR__/socat.pid guestb (socat -u UDP4-LISTEN:10001 STDOUT & echo $! > sc.pid) | tee test.bin | (grep -qm1 "END_OF_TEST" && kill $(cat sc.pid))
here, too,
sleep 1 host dd if=/dev/urandom bs=1k count=5 > __TEMP__ && printf "\nEND_OF_TEST\n" >> __TEMP__ @@ -28,7 +28,7 @@ gout GUEST_MD5 md5sum test.bin | cut -d' ' -f1 check [ "__GUEST_MD5__" = "__MD5__" ]
test UDP/IPv4: host to ns -temp TEMP_NS +set TEMP_NS __STATEDIR__/data_ns nsb (socat -u UDP4-LISTEN:10002 STDOUT & echo $! > __SC_PID__) | tee __TEMP_NS__ | (grep -qm1 "END_OF_TEST" && kill $(cat __SC_PID__))
...here it's __SC_PID__. It looks a bit random to me, but anyway all those go away with your (much needed) patch "test: Simpler termination handling for UDP tests", so I'm also fine to apply it like that. -- Stefano
On Fri, Sep 09, 2022 at 05:00:02PM +0200, Stefano Brivio wrote:
On Fri, 9 Sep 2022 13:30:24 +1000 David Gibson
wrote: Instead of using the 'temp' and 'tempdir' DSL directives to create temporary files, use fixed paths relative to __STATEDIR__. This has two advantages: 1) The files are automatically cleaned up if the tests fail (and even if that doesn't work they're easier to clean up manuall) 2) When debugging tests it's easier to figure out which of the temporary files are relevant to whatever's going wrong
Signed-off-by: David Gibson
[...]
+++ b/test/passt/udp @@ -15,9 +15,9 @@ gtools socat tee grep cat ip jq md5sum cut htools printf dd socat tee grep cat ip jq md5sum cut
test UDP/IPv4: host to guest -temp TEMP -temp SC_PID -guestb (socat -u UDP4-LISTEN:10001 STDOUT & echo $! > __SC_PID__) | tee test.bin | (grep -qm1 "END_OF_TEST" && kill $(cat __SC_PID__)) +set TEMP __STATEDIR__/data +set SC_PID __STATEDIR__/socat.pid +guestb (socat -u UDP4-LISTEN:10001 STDOUT & echo $! > sc.pid) | tee test.bin | (grep -qm1 "END_OF_TEST" && kill $(cat sc.pid))
Here it's sc.pid,
sleep 1 host dd if=/dev/urandom bs=1k count=5 > __TEMP__ && printf "\nEND_OF_TEST\n" >> __TEMP__ host socat -u OPEN:__TEMP__ UDP4:127.0.0.1:10001 diff --git a/test/passt_in_ns/tcp b/test/passt_in_ns/tcp index 5ec95e8..a2cb667 100644 --- a/test/passt_in_ns/tcp +++ b/test/passt_in_ns/tcp @@ -16,7 +16,7 @@ htools dd socat ip jq md5sum cut nstools socat ip jq md5sum cut
test TCP/IPv4: host to guest: big transfer -temp TEMP_BIG +set TEMP_BIG __STATEDIR__/big.img guestb socat -u TCP4-LISTEN:10001 OPEN:test_big.bin,create,trunc sleep 1 host dd if=/dev/urandom bs=1M count=10 of=__TEMP_BIG__ @@ -27,7 +27,7 @@ gout GUEST_MD5_BIG md5sum test_big.bin | cut -d' ' -f1 check [ "__GUEST_MD5_BIG__" = "__MD5_BIG__" ]
test TCP/IPv4: host to ns: big transfer -temp TEMP_NS_BIG +set TEMP_NS_BIG __STATEDIR__/big_ns.img nsb socat -u TCP4-LISTEN:10002 OPEN:__TEMP_NS_BIG__,create,trunc host socat -u OPEN:__TEMP_BIG__ TCP4:127.0.0.1:10002 nsw @@ -82,7 +82,7 @@ gout GUEST_MD5_BIG md5sum test_big.bin | cut -d' ' -f1 check [ "__GUEST_MD5_BIG__" = "__MD5_BIG__" ]
test TCP/IPv4: host to guest: small transfer -temp TEMP_SMALL +set TEMP_SMALL __STATEDIR__/small.img guestb socat -u TCP4-LISTEN:10001 OPEN:test_small.bin,create,trunc sleep 1 host dd if=/dev/urandom bs=2k count=100 of=__TEMP_SMALL__ @@ -93,7 +93,7 @@ gout GUEST_MD5_SMALL md5sum test_small.bin | cut -d' ' -f1 check [ "__GUEST_MD5_SMALL__" = "__MD5_SMALL__" ]
test TCP/IPv4: host to ns: small transfer -temp TEMP_NS_SMALL +set TEMP_NS_SMALL __STATEDIR__/small_ns.img nsb socat -u TCP4-LISTEN:10002 OPEN:__TEMP_NS_SMALL__,create,trunc host socat -u OPEN:__TEMP_SMALL__ TCP4:127.0.0.1:10002 nsw diff --git a/test/passt_in_ns/udp b/test/passt_in_ns/udp index c22a68f..3b1e521 100644 --- a/test/passt_in_ns/udp +++ b/test/passt_in_ns/udp @@ -16,8 +16,8 @@ nstools socat tee grep cat ip jq md5sum cut htools printf dd socat tee grep cat ip jq md5sum cut
test UDP/IPv4: host to guest -temp TEMP -temp SC_PID +set TEMP __STATEDIR__/data +set SC_PID __STATEDIR__/socat.pid guestb (socat -u UDP4-LISTEN:10001 STDOUT & echo $! > sc.pid) | tee test.bin | (grep -qm1 "END_OF_TEST" && kill $(cat sc.pid))
here, too,
sleep 1 host dd if=/dev/urandom bs=1k count=5 > __TEMP__ && printf "\nEND_OF_TEST\n" >> __TEMP__ @@ -28,7 +28,7 @@ gout GUEST_MD5 md5sum test.bin | cut -d' ' -f1 check [ "__GUEST_MD5__" = "__MD5__" ]
test UDP/IPv4: host to ns -temp TEMP_NS +set TEMP_NS __STATEDIR__/data_ns nsb (socat -u UDP4-LISTEN:10002 STDOUT & echo $! > __SC_PID__) | tee __TEMP_NS__ | (grep -qm1 "END_OF_TEST" && kill $(cat __SC_PID__))
...here it's __SC_PID__.
It looks a bit random to me, but anyway all those go away with your (much needed) patch "test: Simpler termination handling for UDP tests", so I'm also fine to apply it like that.
It's __SC_PID__ on host and namespace, sc.pid for the guest. The guest doesn't share a filesystem so __STATEDIR__ isn't meeaningful there. In any case they both go away with the test cleanup that goes along with the handling of 0-length UDP packets. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
On Sat, 10 Sep 2022 17:44:03 +1000
David Gibson
On Fri, Sep 09, 2022 at 05:00:02PM +0200, Stefano Brivio wrote:
On Fri, 9 Sep 2022 13:30:24 +1000 David Gibson
wrote: Instead of using the 'temp' and 'tempdir' DSL directives to create temporary files, use fixed paths relative to __STATEDIR__. This has two advantages: 1) The files are automatically cleaned up if the tests fail (and even if that doesn't work they're easier to clean up manuall) 2) When debugging tests it's easier to figure out which of the temporary files are relevant to whatever's going wrong
Signed-off-by: David Gibson
[...]
+++ b/test/passt/udp @@ -15,9 +15,9 @@ gtools socat tee grep cat ip jq md5sum cut htools printf dd socat tee grep cat ip jq md5sum cut
test UDP/IPv4: host to guest -temp TEMP -temp SC_PID -guestb (socat -u UDP4-LISTEN:10001 STDOUT & echo $! > __SC_PID__) | tee test.bin | (grep -qm1 "END_OF_TEST" && kill $(cat __SC_PID__)) +set TEMP __STATEDIR__/data +set SC_PID __STATEDIR__/socat.pid +guestb (socat -u UDP4-LISTEN:10001 STDOUT & echo $! > sc.pid) | tee test.bin | (grep -qm1 "END_OF_TEST" && kill $(cat sc.pid))
Here it's sc.pid,
sleep 1 host dd if=/dev/urandom bs=1k count=5 > __TEMP__ && printf "\nEND_OF_TEST\n" >> __TEMP__ host socat -u OPEN:__TEMP__ UDP4:127.0.0.1:10001 diff --git a/test/passt_in_ns/tcp b/test/passt_in_ns/tcp index 5ec95e8..a2cb667 100644 --- a/test/passt_in_ns/tcp +++ b/test/passt_in_ns/tcp @@ -16,7 +16,7 @@ htools dd socat ip jq md5sum cut nstools socat ip jq md5sum cut
test TCP/IPv4: host to guest: big transfer -temp TEMP_BIG +set TEMP_BIG __STATEDIR__/big.img guestb socat -u TCP4-LISTEN:10001 OPEN:test_big.bin,create,trunc sleep 1 host dd if=/dev/urandom bs=1M count=10 of=__TEMP_BIG__ @@ -27,7 +27,7 @@ gout GUEST_MD5_BIG md5sum test_big.bin | cut -d' ' -f1 check [ "__GUEST_MD5_BIG__" = "__MD5_BIG__" ]
test TCP/IPv4: host to ns: big transfer -temp TEMP_NS_BIG +set TEMP_NS_BIG __STATEDIR__/big_ns.img nsb socat -u TCP4-LISTEN:10002 OPEN:__TEMP_NS_BIG__,create,trunc host socat -u OPEN:__TEMP_BIG__ TCP4:127.0.0.1:10002 nsw @@ -82,7 +82,7 @@ gout GUEST_MD5_BIG md5sum test_big.bin | cut -d' ' -f1 check [ "__GUEST_MD5_BIG__" = "__MD5_BIG__" ]
test TCP/IPv4: host to guest: small transfer -temp TEMP_SMALL +set TEMP_SMALL __STATEDIR__/small.img guestb socat -u TCP4-LISTEN:10001 OPEN:test_small.bin,create,trunc sleep 1 host dd if=/dev/urandom bs=2k count=100 of=__TEMP_SMALL__ @@ -93,7 +93,7 @@ gout GUEST_MD5_SMALL md5sum test_small.bin | cut -d' ' -f1 check [ "__GUEST_MD5_SMALL__" = "__MD5_SMALL__" ]
test TCP/IPv4: host to ns: small transfer -temp TEMP_NS_SMALL +set TEMP_NS_SMALL __STATEDIR__/small_ns.img nsb socat -u TCP4-LISTEN:10002 OPEN:__TEMP_NS_SMALL__,create,trunc host socat -u OPEN:__TEMP_SMALL__ TCP4:127.0.0.1:10002 nsw diff --git a/test/passt_in_ns/udp b/test/passt_in_ns/udp index c22a68f..3b1e521 100644 --- a/test/passt_in_ns/udp +++ b/test/passt_in_ns/udp @@ -16,8 +16,8 @@ nstools socat tee grep cat ip jq md5sum cut htools printf dd socat tee grep cat ip jq md5sum cut
test UDP/IPv4: host to guest -temp TEMP -temp SC_PID +set TEMP __STATEDIR__/data +set SC_PID __STATEDIR__/socat.pid guestb (socat -u UDP4-LISTEN:10001 STDOUT & echo $! > sc.pid) | tee test.bin | (grep -qm1 "END_OF_TEST" && kill $(cat sc.pid))
here, too,
sleep 1 host dd if=/dev/urandom bs=1k count=5 > __TEMP__ && printf "\nEND_OF_TEST\n" >> __TEMP__ @@ -28,7 +28,7 @@ gout GUEST_MD5 md5sum test.bin | cut -d' ' -f1 check [ "__GUEST_MD5__" = "__MD5__" ]
test UDP/IPv4: host to ns -temp TEMP_NS +set TEMP_NS __STATEDIR__/data_ns nsb (socat -u UDP4-LISTEN:10002 STDOUT & echo $! > __SC_PID__) | tee __TEMP_NS__ | (grep -qm1 "END_OF_TEST" && kill $(cat __SC_PID__))
...here it's __SC_PID__.
It looks a bit random to me, but anyway all those go away with your (much needed) patch "test: Simpler termination handling for UDP tests", so I'm also fine to apply it like that.
It's __SC_PID__ on host and namespace, sc.pid for the guest. The guest doesn't share a filesystem so __STATEDIR__ isn't meeaningful there.
Oh, right, I missed that.
In any case they both go away with the test cleanup that goes along with the handling of 0-length UDP packets.
-- Stefano
Signed-off-by: David Gibson
The capture files are more or less a different form of log output from the
tests, so place them in $LOGDIR.
Signed-off-by: David Gibson
Currently they go in the passt source tree with a fixed names, which means
their presence can mess with subsequent test runs.
Signed-off-by: David Gibson
The asciinema video handling creates a number of temporary files (.uncat,
.start, .stop) which currently go into the source tree. Put them in the
temporary state directory to avoid clutter. Put the final processed video
into the test_logs/ directory, since it's essentially a test output
artefact.
Signed-off-by: David Gibson
On Fri, 9 Sep 2022 13:30:28 +1000
David Gibson
The asciinema video handling creates a number of temporary files (.uncat, .start, .stop) which currently go into the source tree. Put them in the temporary state directory to avoid clutter. Put the final processed video into the test_logs/ directory, since it's essentially a test output artefact.
This needs an update in hooks/pre-push in any case, but... I wouldn't mix those. The current directory listing at: https://passt.top/builds/latest/test/ is sort of usable right now, and if I just scp everything into there, it wouldn't be anymore. Maybe we could move the cast files to test_logs/web/, then scp: - test_logs/* (files only) to latest/test/ - test_logs/web/* to latest/web/ instead? -- Stefano
On Fri, Sep 09, 2022 at 05:00:35PM +0200, Stefano Brivio wrote:
On Fri, 9 Sep 2022 13:30:28 +1000 David Gibson
wrote: The asciinema video handling creates a number of temporary files (.uncat, .start, .stop) which currently go into the source tree. Put them in the temporary state directory to avoid clutter. Put the final processed video into the test_logs/ directory, since it's essentially a test output artefact.
This needs an update in hooks/pre-push in any case, but... I wouldn't
Uh.. right. The hooks aren't part of the repo contents, though, so I can't change that.
mix those. The current directory listing at: https://passt.top/builds/latest/test/
is sort of usable right now, and if I just scp everything into there, it wouldn't be anymore.
Maybe we could move the cast files to test_logs/web/, then scp:
- test_logs/* (files only) to latest/test/ - test_logs/web/* to latest/web/
instead?
Sure, we could do that. It's really up to you what you want the workflow to be. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
On Sat, 10 Sep 2022 17:45:48 +1000
David Gibson
On Fri, Sep 09, 2022 at 05:00:35PM +0200, Stefano Brivio wrote:
On Fri, 9 Sep 2022 13:30:28 +1000 David Gibson
wrote: The asciinema video handling creates a number of temporary files (.uncat, .start, .stop) which currently go into the source tree. Put them in the temporary state directory to avoid clutter. Put the final processed video into the test_logs/ directory, since it's essentially a test output artefact.
This needs an update in hooks/pre-push in any case, but... I wouldn't
Uh.. right. The hooks aren't part of the repo contents, though, so I can't change that.
They are, in some sense: $ git log --oneline -1 hooks/pre-push ba72c83 hooks: Copy .webp diagram versions too I then copy that single hook to .git whenever I clone a repository, as suggested in the comment: $ grep .git hooks/pre-push # cp hooks/pre-push .git/hooks/pre-push ...this should eventually become a server-side post-receive hook, I guess, using a temporary branch for testing and then forwarding the updates to master if the tests pass. But I haven't looked yet into headless asciinema captures -- I guess it's doable and I've been doing something similar with Xvfb, it might need some extra setup in the test scripts though.
mix those. The current directory listing at: https://passt.top/builds/latest/test/
is sort of usable right now, and if I just scp everything into there, it wouldn't be anymore.
Maybe we could move the cast files to test_logs/web/, then scp:
- test_logs/* (files only) to latest/test/ - test_logs/web/* to latest/web/
instead?
Sure, we could do that. It's really up to you what you want the workflow to be.
Hmm, yes, that would be my preferred option at the moment. I can also take care of updating the hook when I apply your patches. -- Stefano
On Sat, Sep 10, 2022 at 10:41:19PM +0200, Stefano Brivio wrote:
On Sat, 10 Sep 2022 17:45:48 +1000 David Gibson
wrote: On Fri, Sep 09, 2022 at 05:00:35PM +0200, Stefano Brivio wrote:
On Fri, 9 Sep 2022 13:30:28 +1000 David Gibson
wrote: The asciinema video handling creates a number of temporary files (.uncat, .start, .stop) which currently go into the source tree. Put them in the temporary state directory to avoid clutter. Put the final processed video into the test_logs/ directory, since it's essentially a test output artefact.
This needs an update in hooks/pre-push in any case, but... I wouldn't
Uh.. right. The hooks aren't part of the repo contents, though, so I can't change that.
They are, in some sense:
$ git log --oneline -1 hooks/pre-push ba72c83 hooks: Copy .webp diagram versions too
I then copy that single hook to .git whenever I clone a repository, as suggested in the comment:
Huh, I completely missed that there.
$ grep .git hooks/pre-push # cp hooks/pre-push .git/hooks/pre-push
...this should eventually become a server-side post-receive hook, I guess, using a temporary branch for testing and then forwarding the updates to master if the tests pass.
Right. It wouldn't make sense for me or anyone else to have this as a pre-push hook.
But I haven't looked yet into headless asciinema captures -- I guess it's doable and I've been doing something similar with Xvfb, it might need some extra setup in the test scripts though.
Right. It should be ok as long as $TERM and the stty settings match. Obviously a pty will have to be allocated for the command, which I suspect asciinema rec must do anyway. It might be as simple as setting the --cols and --rows options.
mix those. The current directory listing at: https://passt.top/builds/latest/test/
is sort of usable right now, and if I just scp everything into there, it wouldn't be anymore.
Maybe we could move the cast files to test_logs/web/, then scp:
- test_logs/* (files only) to latest/test/ - test_logs/web/* to latest/web/
instead?
Sure, we could do that. It's really up to you what you want the workflow to be.
Hmm, yes, that would be my preferred option at the moment. I can also take care of updating the hook when I apply your patches.
Ok, I've done that in the next spin. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
participants (2)
-
David Gibson
-
Stefano Brivio