2020-08-06 02:44:17 +08:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
usage() {
|
|
|
|
set +x
|
|
|
|
cat 1>&2 <<HERE
|
|
|
|
BBB Health Check
|
|
|
|
|
|
|
|
OPTIONS:
|
2021-06-06 22:01:37 +08:00
|
|
|
-t <test name: webcamlayout/whiteboard/webcam/virtualizedlist/user/trigger/sharednotes/screenshare/presentation/polling/notifications/customparameters/chat/breakout/audio/all>
|
2020-08-06 02:44:17 +08:00
|
|
|
|
2021-08-02 05:24:17 +08:00
|
|
|
-u Print usage
|
2020-08-06 02:44:17 +08:00
|
|
|
HERE
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
err() {
|
|
|
|
echo "----";
|
|
|
|
echo ERROR: $@
|
|
|
|
echo "----";
|
|
|
|
}
|
|
|
|
|
|
|
|
main() {
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2021-02-17 04:57:10 +08:00
|
|
|
while builtin getopts "ut:" opt "${@}"; do
|
2020-08-06 02:44:17 +08:00
|
|
|
|
|
|
|
case $opt in
|
|
|
|
t)
|
|
|
|
TEST=$OPTARG
|
|
|
|
;;
|
|
|
|
|
|
|
|
u)
|
|
|
|
usage
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
|
|
|
|
:)
|
|
|
|
err "Missing option argument for -$OPTARG"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
|
|
|
|
\?)
|
|
|
|
err "Invalid option: -$OPTARG" >&2
|
|
|
|
usage
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -z "$TEST" ]; then
|
|
|
|
err "No test provided";
|
|
|
|
usage
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-02-27 01:49:52 +08:00
|
|
|
echo "Test is starting in 5 seconds..." && sleep 5;echo $Test " Test has started."
|
2021-08-02 05:24:17 +08:00
|
|
|
echo $PWD
|
|
|
|
env $(cat .env | xargs) jest $TEST.test.js --color --detectOpenHandles --forceExit
|
2020-08-06 02:44:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
main "$@" || exit 1
|
|
|
|
|