Files
deck/tests/integration/run.sh
Julius Härtl 2542b6ed16 ci: Add query count for integration tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-02-17 09:16:26 +01:00

43 lines
803 B
Bash
Executable File

#!/usr/bin/env bash
OC_PATH=../../../../
OCC=${OC_PATH}occ
SCENARIO_TO_RUN=$1
HIDE_OC_LOGS=$2
# Nextcloud integration tests composer
(
cd ${OC_PATH}build/integration
composer install
)
INSTALLED=$($OCC status | grep installed: | cut -d " " -f 5)
if [ "$INSTALLED" == "true" ]; then
$OCC app:enable deck
else
echo "Nextcloud instance needs to be installed" >&2
exit 1
fi
composer install
# avoid port collision on jenkins - use $EXECUTOR_NUMBER
if [ -z "$EXECUTOR_NUMBER" ]; then
EXECUTOR_NUMBER=0
fi
PORT=$((9090 + $EXECUTOR_NUMBER))
echo $PORT
php -q -S localhost:$PORT -t $OC_PATH &
PHPPID=$!
echo $PHPPID
export TEST_SERVER_URL="http://localhost:$PORT/ocs/"
vendor/bin/behat --colors $SCENARIO_TO_RUN
RESULT=$?
kill -9 $PHPPID
echo "runsh: Exit code: $RESULT"
exit $RESULT