From fc01bc08fafe82b254f7562b55209c872297fac6 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Sun, 29 May 2022 08:52:20 +0200 Subject: Refresh and organise run-tests.sh/adjust-config.sh run-tests.sh now uses the latest version of Synapse and has less repetitive code; adjust-config.sh moved to autotests/ (it had nothing specific to CI, after all), works with the newest Synapse (that has an additional enable_registration_without_verification safeguard) and no more depends on the config directory being called "data" but rather should be called from inside that directory (for the case when it is used separately from run-tests.sh and the config directory is not called "data"). --- autotests/run-tests.sh | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'autotests/run-tests.sh') diff --git a/autotests/run-tests.sh b/autotests/run-tests.sh index 0d58e460..a3ee2ade 100755 --- a/autotests/run-tests.sh +++ b/autotests/run-tests.sh @@ -1,34 +1,32 @@ mkdir -p data chmod 0777 data + rm ~/.local/share/testolmaccount -rf 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 + -e SYNAPSE_SERVER_NAME=localhost -e SYNAPSE_REPORT_STATS=no matrixdotorg/synapse:latest generate +pushd data +. ../autotests/adjust-config.sh +popd docker run -d \ --name synapse \ -p 1234:8008 \ -p 8448:8008 \ -p 8008:8008 \ - -v `pwd`/data:/data matrixdotorg/synapse:v1.24.0 + -v `pwd`/data:/data matrixdotorg/synapse:latest 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 -docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u alice1 -p secret -c /data/homeserver.yaml https://localhost:8008' -docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u alice2 -p secret -c /data/homeserver.yaml https://localhost:8008' -docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u alice3 -p secret -c /data/homeserver.yaml https://localhost:8008' -docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u alice4 -p secret -c /data/homeserver.yaml https://localhost:8008' -docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u alice5 -p secret -c /data/homeserver.yaml https://localhost:8008' -docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u alice6 -p secret -c /data/homeserver.yaml https://localhost:8008' -docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u alice7 -p secret -c /data/homeserver.yaml https://localhost:8008' -docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u alice8 -p secret -c /data/homeserver.yaml https://localhost:8008' -docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u alice9 -p secret -c /data/homeserver.yaml https://localhost:8008' +for i in 1 2 3 4 5 6 7 8 9; do + docker exec synapse /bin/sh -c "register_new_matrix_user --admin -u alice$i -p secret -c /data/homeserver.yaml https://localhost:8008" +done echo Register bob -docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u bob1 -p secret -c /data/homeserver.yaml https://localhost:8008' -docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u bob2 -p secret -c /data/homeserver.yaml https://localhost:8008' -docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u bob3 -p secret -c /data/homeserver.yaml https://localhost:8008' +for i in 1 2 3; do + docker exec synapse /bin/sh -c "register_new_matrix_user --admin -u bob$i -p secret -c /data/homeserver.yaml https://localhost:8008" +done 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' +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 "$@" + -- cgit v1.2.3 From 8a868988be0c5ce4ea8a22f4a6f8c7e8b2e42037 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Sun, 29 May 2022 23:01:09 +0200 Subject: run-tests.sh: fix weird CI failure on Linux/Clang Also fix a leftover data/ prefix in adjust-config.sh --- autotests/adjust-config.sh | 2 +- autotests/run-tests.sh | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'autotests/run-tests.sh') diff --git a/autotests/adjust-config.sh b/autotests/adjust-config.sh index a55ac670..68ea58ab 100644 --- a/autotests/adjust-config.sh +++ b/autotests/adjust-config.sh @@ -36,7 +36,7 @@ rc_joins: per_second: 10000 burst_count: 100000 HEREDOC -) | $CMD tee -a data/homeserver.yaml +) | $CMD tee -a homeserver.yaml $CMD perl -pi -w -e \ 's/^#enable_registration: false/enable_registration: true/g;' homeserver.yaml diff --git a/autotests/run-tests.sh b/autotests/run-tests.sh index a3ee2ade..05a215af 100755 --- a/autotests/run-tests.sh +++ b/autotests/run-tests.sh @@ -4,9 +4,7 @@ chmod 0777 data rm ~/.local/share/testolmaccount -rf docker run -v `pwd`/data:/data --rm \ -e SYNAPSE_SERVER_NAME=localhost -e SYNAPSE_REPORT_STATS=no matrixdotorg/synapse:latest generate -pushd data -. ../autotests/adjust-config.sh -popd +(cd data && . ../autotests/adjust-config.sh) docker run -d \ --name synapse \ -p 1234:8008 \ -- cgit v1.2.3 From 3f586005840e012a98e0f300a726b1cbda75e001 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Thu, 7 Jul 2022 10:56:57 +0200 Subject: Adjust Synapse image for tests :latest stopped working for some reason. --- autotests/run-tests.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'autotests/run-tests.sh') diff --git a/autotests/run-tests.sh b/autotests/run-tests.sh index 05a215af..e7a228ef 100755 --- a/autotests/run-tests.sh +++ b/autotests/run-tests.sh @@ -1,16 +1,18 @@ mkdir -p data chmod 0777 data +SYNAPSE_IMAGE='matrixdotorg/synapse:v1.61.1' + rm ~/.local/share/testolmaccount -rf docker run -v `pwd`/data:/data --rm \ - -e SYNAPSE_SERVER_NAME=localhost -e SYNAPSE_REPORT_STATS=no matrixdotorg/synapse:latest generate + -e SYNAPSE_SERVER_NAME=localhost -e SYNAPSE_REPORT_STATS=no $SYNAPSE_IMAGE generate (cd data && . ../autotests/adjust-config.sh) docker run -d \ --name synapse \ -p 1234:8008 \ -p 8448:8008 \ -p 8008:8008 \ - -v `pwd`/data:/data matrixdotorg/synapse:latest + -v `pwd`/data:/data $SYNAPSE_IMAGE trap "rm -rf ./data/*; docker rm -f synapse 2>&1 >/dev/null; trap - EXIT" EXIT echo Waiting for synapse to start... -- cgit v1.2.3