1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-20 15:07:03 +00:00

test: Reduce main sources of overhead in integration tests

The integration tests spend a lot of time on some ancilliary actions,
which slows them down: generating certificates, adding users, and
waiting for things to happen.

To improve the performance of those actions, this patch:

- Makes (most) tests use plain passwords (-20%)
- Adds a certificate cache to reuse certs (-10%)
- Tightens the sleep loops (-5%)

In aggregate, this patch results in a speedup of the integration tests
of ~30-40%.

Note that some of the tests required adjusting the username, because
`chasquid-util user-add` would convert them to lowercase as per PRECIS
mapping.
This commit is contained in:
Alberto Bertogli
2022-11-12 21:01:25 +00:00
parent 4a00a83c23
commit 4d1526e0c8
7 changed files with 46 additions and 20 deletions

View File

@@ -13,7 +13,7 @@ generate_certs_for testserver
#
# Start with the user with the wrong password, and no aliases.
add_user someone@testserver password111
chasquid-util-user-add someone@testserver password111
rm -f config/domains/testserver/aliases
mkdir -p .logs
@@ -28,7 +28,7 @@ fi
# Change password, add an alias; then wait a bit more than the reload period
# and try again.
add_user someone@testserver password222
chasquid-util-user-add someone@testserver password222
echo "analias: someone" > config/domains/testserver/aliases
sleep 0.2