2020-11-24 11:28:54 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-01-11 05:50:32 +03:00
|
|
|
source ../tools.sh
|
|
|
|
|
2020-11-24 11:28:54 +03:00
|
|
|
TEMP_DB=$(mktemp)
|
|
|
|
|
|
|
|
# Install the node test framework
|
2022-11-30 02:49:08 +03:00
|
|
|
npm install --quiet --no-progress
|
2020-11-24 11:28:54 +03:00
|
|
|
|
2023-01-11 05:50:32 +03:00
|
|
|
ffmpegInstall
|
2020-11-24 11:28:54 +03:00
|
|
|
|
2022-12-26 06:17:13 +03:00
|
|
|
pushd ../../.. >/dev/null || exit
|
2020-11-24 11:28:54 +03:00
|
|
|
|
|
|
|
# Build and run owncast from source
|
2022-09-05 02:41:02 +03:00
|
|
|
go build -o owncast main.go
|
2022-12-26 06:17:13 +03:00
|
|
|
./owncast -database "$TEMP_DB" &
|
2020-11-24 11:28:54 +03:00
|
|
|
SERVER_PID=$!
|
|
|
|
|
2022-12-26 06:17:13 +03:00
|
|
|
popd >/dev/null || exit
|
2020-11-24 11:28:54 +03:00
|
|
|
sleep 5
|
|
|
|
|
|
|
|
# Start streaming the test file over RTMP to
|
|
|
|
# the local owncast instance.
|
2023-01-11 05:50:32 +03:00
|
|
|
../../ocTestStream.sh &
|
2020-11-24 11:28:54 +03:00
|
|
|
FFMPEG_PID=$!
|
|
|
|
|
|
|
|
function finish {
|
2022-09-05 02:41:02 +03:00
|
|
|
kill $SERVER_PID $FFMPEG_PID
|
2023-01-11 05:50:32 +03:00
|
|
|
rm -fr "$TEMP_DB" "$FFMPEG_PATH"
|
2020-11-24 11:28:54 +03:00
|
|
|
}
|
|
|
|
trap finish EXIT
|
|
|
|
|
|
|
|
echo "Waiting..."
|
2021-11-03 05:27:41 +03:00
|
|
|
sleep 15
|
2020-11-24 11:28:54 +03:00
|
|
|
|
|
|
|
# Run the tests against the instance.
|
2022-03-07 07:34:49 +03:00
|
|
|
npm test
|