2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: AGPL-3.0
7 while port=$(shuf -n1 -i $(cat /proc/sys/net/ipv4/ip_local_port_range | tr '\011' '-'))
8 netstat -atun | grep -q ":$port\s" ; do
14 # Allow self-signed certs on 'wait-on'
15 export NODE_TLS_REJECT_UNAUTHORIZED=0
18 ARVADOS_LOG=${WORKDIR}/arvados.log
19 ARVADOS_CONF=`pwd`/tools/arvados_config.yml
21 if [ ! -e "${WORKDIR}/lib" ]; then
22 echo "Downloading arvados..."
23 git clone https://git.arvados.org/arvados.git ${WORKDIR} || exit 1
26 echo "Building & installing arvados-server..."
28 go mod download || exit 1
30 echo "Installing dev dependencies..."
31 sudo go run ./cmd/arvados-server install -type test || exit 1
33 echo "Running arvados in test mode..."
34 ARVADOS_PORT=`random_free_port`
35 go run ./cmd/arvados-server boot \
36 -config ${ARVADOS_CONF} \
38 -own-temporary-database \
39 -controller-address :${ARVADOS_PORT} \
40 -listen-host localhost > ${ARVADOS_LOG} 2>&1 &
43 echo "Running workbench2..."
44 WB2_PORT=`random_free_port`
45 PORT=${WB2_PORT} REACT_APP_ARVADOS_API_HOST=localhost:${ARVADOS_PORT} \
48 # Wait for arvados & workbench2 to be up.
49 # Using https-get to avoid false positive 'ready' detection.
50 yarn run wait-on https-get://localhost:${ARVADOS_PORT}/discovery/v1/apis/arvados/v1/rest
51 yarn run wait-on https-get://localhost:${WB2_PORT}
53 echo "Running tests..."
54 CYPRESS_system_token=systemusertesttoken1234567890aoeuidhtnsqjkxbmwvzpy \
55 CYPRESS_controller_url=https://localhost:${ARVADOS_PORT} \
56 CYPRESS_BASE_URL=https://localhost:${WB2_PORT} \
63 exit ${TEST_EXIT_CODE}