mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-05 19:59:37 -06:00
62 lines
1.3 KiB
Bash
Executable File
62 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ -z "$WEB_PATH" ]
|
|
then
|
|
echo "WEB_PATH env variable is not set, cannot find files for tests infrastructure"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$OCIS_SKELETON_DIR" ]
|
|
then
|
|
echo "OCIS_SKELETON_DIR env variable is not set, cannot find skeleton directory"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$WEB_UI_CONFIG" ]
|
|
then
|
|
echo "WEB_UI_CONFIG env variable is not set, cannot find ownCloud Web config file"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$1" ]
|
|
then
|
|
echo "Features path not given, exiting test run"
|
|
exit 1
|
|
fi
|
|
|
|
trap clean_up SIGHUP SIGINT SIGTERM
|
|
|
|
if [ -z "$TEST_INFRA_DIRECTORY" ]
|
|
then
|
|
cleanup=true
|
|
testFolder=$(cat < /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
|
|
printf "creating folder $testFolder for Test infrastructure setup\n\n"
|
|
export TEST_INFRA_DIRECTORY=$testFolder
|
|
fi
|
|
|
|
clean_up() {
|
|
if $cleanup
|
|
then
|
|
if [ -d "$testFolder" ]; then
|
|
printf "\n\n\n\nDeleting folder $testFolder Test infrastructure setup..."
|
|
rm -rf "$testFolder"
|
|
fi
|
|
fi
|
|
}
|
|
|
|
trap clean_up SIGHUP SIGINT SIGTERM EXIT
|
|
|
|
cp -r "$WEB_PATH/tests" "./$testFolder"
|
|
|
|
export NODE_TLS_REJECT_UNAUTHORIZED='0'
|
|
export SERVER_HOST=${SERVER_HOST:-https://localhost:9200}
|
|
export BACKEND_HOST=${BACKEND_HOST:-https://localhost:9200}
|
|
export OCIS_SETTINGS_STORE=${OCIS_SETTINGS_STORE:-"/var/tmp/ocis/settings"}
|
|
export RUN_ON_OCIS=true
|
|
export TEST_TAGS=${TEST_TAGS:-"not @skip"}
|
|
|
|
yarn run acceptance-tests "$1"
|
|
|
|
status=$?
|
|
exit $status
|