#!/bin/bash -i function start_demo_meeting { if [[ $1 == "videoTestApp" ]]; then cd $GITHUB_WORKSPACE/integration/js/app elif [[ $stem = "" ]]; then cd $GITHUB_WORKSPACE/demos/browser fi uuid=$(uuidgen) mkdir -p logs case $1 in 'meetingReadinessChecker') extra_args='--app=meetingReadinessChecker' echo "Starting meeting readiness checker" ;; 'meetingSession') extra_args='--app=messagingSession' echo "Starting messaging session demo" ;; 'videoTestApp') echo "Starting the video integration test app" ;; *) echo "Starting the meeting demo" ;; esac npm run start $extra_args 2>&1 | tee -a logs/$uuid.log & } function did_server_start { if ! lsof -i:$1 > /dev/null; then echo 0 else echo 1 fi } function wait_for_demo_to_start { echo "Waiting for the demo to start" threshold=60 started=0 retry_count=1 while [ $started -eq 0 ] && [ $retry_count -lt $threshold ] do started=$(did_server_start $1) sleep 5 retry_count=$(($retry_count+1)) done if [ $retry_count -eq $threshold ]; then echo "meeting demo not started" exit 1 fi } echo `pwd` curr=`pwd` case $2 in video_test_app) start_demo_meeting 'videoTestApp' ;; meeting_readiness_checker) start_demo_meeting 'meetingReadinessChecker' ;; messaging) start_demo_meeting 'meetingSession' ;; *) start_demo_meeting ;; esac wait_for_demo_to_start 8080 cd $curr cd ../ . ~/.bashrc case $1 in integration) case $2 in audio) r configs/integrationTest/audio_test.config.json r configs/integrationTest/app_quit_audio_test.config.json r configs/integrationTest/meeting_leave_audio_test.config.json r configs/integrationTest/sending_audio_events_test.config.json ;; video) r configs/integrationTest/video_test.config.json r configs/integrationTest/video_test_processor.config.json # TODO: Re-enable simulcast test after it has been fixed # r configs/integrationTest/video_test_simulcast.config.json r configs/integrationTest/app_quit_video_test.config.json r configs/integrationTest/meeting_leave_video_test.config.json r configs/integrationTest/reconnection_test.config.json ;; video_test_app) r configs/integrationTest/test_app_video_test.config.json r configs/integrationTest/test_app_video_pin_test.config.json ;; meeting_end) r configs/integrationTest/meeting_end_test.config.json ;; content_share_test_suite_one) r configs/integrationTest/content_share_screen_capture_test.config.json r configs/integrationTest/meeting_leave_content_share_test.config.json r configs/integrationTest/content_share_video_test.config.json ;; content_share_test_suite_two) r configs/integrationTest/content_share_only_allow_two_test.config.json r configs/integrationTest/content_share_join_later_test.config.json r configs/integrationTest/app_quit_content_share_test.config.json ;; data_message) r configs/integrationTest/data_message_test.config.json ;; meeting_readiness_checker) r configs/integrationTest/meeting_readiness_checker_test.config.json ;; messaging) r configs/integrationTest/messaging_session_test.config.json ;; transcription) r configs/integrationTest/transcription_test.config.json ;; background_blur) r configs/integrationTest/background_blur_test.config.json r configs/integrationTest/videofx_background_effects_test.config.json ;; echo_reduction) r configs/integrationTest/echo_reduction_test.config.json ;; *) r configs/integrationTest/audio_test.config.json r configs/integrationTest/video_test.config.json r configs/integrationTest/meeting_end_test.config.json r configs/integrationTest/app_quit_audio_test.config.json r configs/integrationTest/app_quit_video_test.config.json r configs/integrationTest/meeting_leave_audio_test.config.json r configs/integrationTest/meeting_leave_video_test.config.json ;; esac ;; browser_compatibility) case $2 in audio) r configs/browserCompatibilityTest/desktop/audio_test.config.json ;; video) r configs/browserCompatibilityTest/desktop/video_test.config.json r configs/browserCompatibilityTest/desktop/video_test_processor.config.json # TODO: Re-enable simulcast test after it has been fixed # r video_test_simulcast.config.json r configs/browserCompatibilityTest/desktop/app_quit_video_test.config.json r configs/browserCompatibilityTest/desktop/meeting_leave_video_test.config.json r configs/browserCompatibilityTest/desktop/reconnection_test.config.json ;; content_share) r configs/browserCompatibilityTest/desktop/content_share_screen_capture_test.config.json r configs/browserCompatibilityTest/desktop/content_share_video_test.config.json ;; data_message) r configs/browserCompatibilityTest/desktop/data_message_test.config.json ;; meeting_readiness_checker) r configs/browserCompatibilityTest/desktop/meeting_readiness_checker_test.config.json ;; background_blur) r configs/browserCompatibilityTest/desktop/background_blur_test.config.json r configs/browserCompatibilityTest/desktop/videofx_background_effects_test.config.json ;; voice_focus) r configs/browserCompatibilityTest/desktop/voice_focus_test.config.json ;; linux_audio) r configs/browserCompatibilityTest/desktop/linux/audio_test.config.json ;; linux_video) r configs/browserCompatibilityTest/desktop/linux/video_test.config.json ;; linux_content_share) r configs/browserCompatibilityTest/desktop/linux/content_share_screen_capture_test.config.json r configs/browserCompatibilityTest/desktop/linux/content_share_video_test.config.json ;; linux_other) r configs/browserCompatibilityTest/desktop/linux/data_message_test.config.json r configs/browserCompatibilityTest/desktop/linux/meeting_end_test.config.json ;; *) r configs/browserCompatibilityTest/desktop/audio_test.config.json r configs/browserCompatibilityTest/desktop/video_test.config.json r configs/browserCompatibilityTest/desktop/meeting_end_test.config.json ;; esac ;; esac # Kill the current local demo process kill -9 $(lsof -i:8080 | grep LISTEN | awk '{print $2}') ./js/script/failure-check