diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-02-18 14:14:15 +0100 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-02-18 14:14:15 +0100 |
commit | 0a1b8b9f38ddadb32d54884a05f0e7246d7c25e7 (patch) | |
tree | 1f1293213d2e1ad81beae841a23770c011d3498c | |
parent | 6be59df7036f8df385da29051c5320563518728a (diff) | |
download | libquotient-0a1b8b9f38ddadb32d54884a05f0e7246d7c25e7.tar.gz libquotient-0a1b8b9f38ddadb32d54884a05f0e7246d7c25e7.zip |
run-tests.sh: use a trap for cleanup
This both is more reliable (GHA executes scripts in fail-fast mode) and
ensures that the return value is that of ctest.
-rwxr-xr-x | autotests/run-tests.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/autotests/run-tests.sh b/autotests/run-tests.sh index adfb4ec1..0d0a4ca3 100755 --- a/autotests/run-tests.sh +++ b/autotests/run-tests.sh @@ -4,11 +4,13 @@ docker run -v `pwd`/data:/data --rm \ -e SYNAPSE_SERVER_NAME=localhost -e SYNAPSE_REPORT_STATS=no matrixdotorg/synapse:v1.24.0 generate ./.ci/adjust-config.sh docker run -d \ - --name synapse \ - -p 1234:8008 \ - -p 8448:8008 \ - -p 8008:8008 \ - -v `pwd`/data:/data matrixdotorg/synapse:v1.24.0 + --name synapse \ + -p 1234:8008 \ + -p 8448:8008 \ + -p 8008:8008 \ + -v `pwd`/data:/data matrixdotorg/synapse:v1.24.0 +trap "rm -rf ./data/*; docker rm -f synapse 2>&1 >/dev/null; trap - EXIT" EXIT + echo Waiting for synapse to start... until curl -s -f -k https://localhost:1234/_matrix/client/versions; do echo "Checking ..."; sleep 2; done echo Register alice @@ -19,5 +21,3 @@ echo Register carl docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u carl -p secret -c /data/homeserver.yaml https://localhost:8008' GTEST_COLOR=1 ctest --verbose "$@" -rm -rf ./data/* -docker rm -f synapse 2>&1>/dev/null |