create-test-environment.sh: Use environment variables for different buildgrid configurations
Description
This request makes use of two environment variables BUILDGRID_CONFIG
and DISTRIBUTED_BUILDGRID
that can be used within bin/build-and-run-tests.sh
to indicate an alternative to the default buildgrid configuration of bgdconfig.yml
.
BUILDGRID_CONFIG
can be used to indicate the buildgrid config to use for an alternative single server configuration, while DISTRUBUTED_BUILDGRID
indicates a bash script that can be used to construct a buildgrid configuration over multiple servers.
If neither environment variable is passed then the test would use the default config 'bgdconfig.yml'
Example:
docker run -e BUILDGRID_CONFIG="bgdconfig_new.yml" e2e-runner /tests/test-casdownload-casupload.sh
docker run -e DISTRIBUTED_BUILDGRID="standalone_bots.sh" e2e-runner /tests/test-standalone-bots.sh
where standalone_bots.sh
could look something like:
#!/usr/bin/env bash
#
# Example of a 'distributed' buildgrid, with all services, apart from
# the standalone service 'bots',on one server.
#
# Environment variables used in create-test-environment.sh
#
bgd server start "$BUILDBOX_E2E_DATA_DIR/bgdconfig_cas_plus.yml" &
BUILDGRID_CAS_SERVER="localhost:50051"
BUILDGRID_LOGSTREAM_SERVER="localhost:50051"
sleep 5 # Give server some time to boot
netstat -pln | grep 50051 # Check for server existence
bgd server start "$BUILDBOX_E2E_DATA_DIR/bgdconfig_bots.yml" &
BUILDGRID_BOTS_SERVER="localhost:50054"
sleep 5 # Give server some time to boot
netstat -pln | grep 50054 # Check for server existence
Changes proposed in this merge request:
- Changes to create-test-environment.sh to handle two new environment variables BUILDGRID_CONFIG and DISTRIBUTED_BUILDGRID
Issues addressed
Required change, in order to address buildgrid issue #383
Edited by Neill Whillans