Add basic behat test structure
Signed-off-by: Julius Haertl <jus@bitgrid.net>
This commit is contained in:
committed by
Julius Härtl
parent
11610f306a
commit
084d892ce6
44
tests/integration/run.sh
Executable file
44
tests/integration/run.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
OC_PATH=../../../../
|
||||
OCC=${OC_PATH}occ
|
||||
SCENARIO_TO_RUN=$1
|
||||
HIDE_OC_LOGS=$2
|
||||
|
||||
INSTALLED=$($OCC status | grep installed: | cut -d " " -f 5)
|
||||
|
||||
if [ "$INSTALLED" == "true" ]; then
|
||||
$OCC app:enable deck
|
||||
else
|
||||
if [ "$SCENARIO_TO_RUN" != "setup_features/setup.feature" ]; then
|
||||
echo "Nextcloud instance needs to be installed" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
composer install
|
||||
composer dump-autoload
|
||||
|
||||
# avoid port collision on jenkins - use $EXECUTOR_NUMBER
|
||||
if [ -z "$EXECUTOR_NUMBER" ]; then
|
||||
EXECUTOR_NUMBER=0
|
||||
fi
|
||||
PORT=$((8080 + $EXECUTOR_NUMBER))
|
||||
echo $PORT
|
||||
php -S localhost:$PORT -t $OC_PATH &
|
||||
PHPPID=$!
|
||||
echo $PHPPID
|
||||
|
||||
export TEST_SERVER_URL="http://localhost:$PORT/ocs/"
|
||||
|
||||
vendor/bin/behat
|
||||
RESULT=$?
|
||||
|
||||
kill $PHPPID
|
||||
|
||||
if [ -z $HIDE_OC_LOGS ]; then
|
||||
tail "${OC_PATH}/data/nextcloud.log"
|
||||
fi
|
||||
|
||||
echo "runsh: Exit code: $RESULT"
|
||||
exit $RESULT
|
||||
Reference in New Issue
Block a user