2018-09-01 00:34:43 +08:00
|
|
|
export BBB_SERVER_URL="http://localhost/bigbluebutton/api"
|
|
|
|
|
2018-08-27 23:00:42 +08:00
|
|
|
# Change to HTML5 directory
|
|
|
|
cd $(dirname $0)
|
|
|
|
echo "Working directory: $PWD"
|
|
|
|
|
|
|
|
# Build and run Docker image
|
|
|
|
docker build -t b2 .
|
2018-08-29 01:52:04 +08:00
|
|
|
docker=$(docker run -d -p 80:80/tcp -p 443:443/tcp -p 1935:1935 -p 5066:5066 -p 3478:3478 -p 3478:3478/udp b2 -h localhost)
|
2018-08-27 23:00:42 +08:00
|
|
|
echo $docker
|
|
|
|
|
|
|
|
# Check if HTML5 client is ready
|
|
|
|
cd tests/puppeteer
|
2018-08-31 00:23:36 +08:00
|
|
|
node html5-check.js
|
2018-08-27 23:00:42 +08:00
|
|
|
status=$?
|
|
|
|
echo $status
|
|
|
|
|
2018-08-29 01:52:04 +08:00
|
|
|
conf=$(docker exec $(docker ps -q) bbb-conf --secret | grep "Secret:")
|
|
|
|
secret=$(echo $conf | cut -d' ' -f2)
|
|
|
|
export BBB_SHARED_SECRET=$secret
|
|
|
|
echo $BBB_SHARED_SECRET
|
|
|
|
|
2018-08-27 23:00:42 +08:00
|
|
|
# Run tests
|
|
|
|
if [ $status -eq 0 ]; then
|
2018-11-22 19:29:55 +08:00
|
|
|
# runInBand will force jest to run in a single thread
|
|
|
|
# https://jestjs.io/docs/en/troubleshooting#tests-are-extremely-slow-on-docker-and-or-continuous-integration-ci-server
|
|
|
|
npm test -- --runInBand
|
2018-08-27 23:00:42 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Stop Docker container
|
|
|
|
docker stop $docker
|
2018-08-31 03:21:49 +08:00
|
|
|
docker rm $docker
|