This script configures an environment to simulate a Gerrit Multi-Site setup so that automated e2e tests (so far only startup and check if all necessary plugins were loaded) could be performed by CI.
The environment is composed by:
/tmp/[random]
Tests defined in scenarios.sh
are called automatically when plugin tests are called:
bazel test //plugins/multi-site/...
But one can also start them independently with:
./test.sh
Upon start docker logs are tailed to file in deployment dir. They will be printed to the console (together with docker-compose.yaml
used to start the setup) upon tests failure (test.sh
will exit with 1
in such case). No ports/volumes are exposed and multiple test instances can be started in the same CI node (internal docker network is used to perform tests).
When called in the independent mode it is assumed that multi-site
jar is available under in-tree gerrit repository that is related to the multi-site
repo (e.g. ../../../bazel-bin/plugins/[multi-site/multi-site|replication/replication].jar
). It can be further customised with --multisite-lib-file
execution option. Full list of options can be obtained with:
./test.sh --help