@@ -17,64 +17,64 @@ TUTORIALS=(
1717 ' ../openvidu-toolbar-buttons'
1818 ' ../openvidu-toolbar-panel-buttons'
1919)
20- # Inicializar contadores de tests exitosos y fallidos
20+ # Initialize counters for successful and failed tests
2121SUCCESS=0
2222FAILURE=0
2323
2424for tutorial in " ${TUTORIALS[@]} "
2525do
2626 echo " Processing $tutorial ..."
2727
28-
2928 if [ -d " $tutorial " ]; then
3029
3130 cd " $tutorial " || { echo " Cannot enter directory $tutorial " ; exit 1; }
3231 rm -rf node_modules
3332 rm -f package-lock.json
3433 npm install openvidu-components-angular@latest
3534
36-
37- # Verificar si el puerto 5080 está en uso y matar el proceso si es necesario
35+ # Check if port 5080 is in use and kill the process if necessary
3836 PORT_IN_USE=$( lsof -i :5080 | grep LISTEN)
3937 if [ -n " $PORT_IN_USE " ]; then
4038 echo " Port 5080 is in use. Killing the process..."
4139 kill -9 $( lsof -ti :5080)
4240 fi
4341
44-
45- # Iniciar la aplicación
42+ # Start the application
4643 echo " Starting the application in $tutorial ..."
4744 npm run start &
4845 APP_PID=$!
4946
50- # Esperar un tiempo para que la aplicación se inicie
47+ # Wait some time for the application to start
5148 sleep 20
5249
53- # Ejecutar el test
50+ # Run the test
5451 echo " Running test for $tutorial ..."
55- node ../test/test.js
52+ node ../test/test.js " $tutorial "
5653
57- # Verificar si el test falló
54+ # Check if the test failed
5855 if [ $? -eq 1 ]; then
5956 echo " ERROR!! Test failed for $tutorial "
60- (( FAILURE++ )) # Incrementar el contador de fallos
57+ (( FAILURE++ ))
6158 else
62- (( SUCCESS++ )) # Incrementar el contador de éxitos
59+ (( SUCCESS++ ))
6360 fi
6461
6562
66- # Detener la aplicación
6763 echo " Stopping the application in $tutorial ..."
6864 kill $APP_PID
69- wait $APP_PID 2> /dev/null # Esperar a que el proceso se detenga antes de continuar
65+ wait $APP_PID 2> /dev/null # Wait for the process to stop before continuing
7066
7167 cd - || { echo " Cannot return to previous directory" ; exit 1; }
7268 else
7369 echo " Directory $tutorial does not exist."
7470 fi
7571done
7672
77- # Mostrar resumen de los tests
7873echo " Summary:"
7974echo " Successful tests: $SUCCESS "
80- echo " Failed tests: $FAILURE "
75+ echo " Failed tests: $FAILURE "
76+
77+ # Exit with an error code if there are failed tests
78+ if [ $FAILURE -gt 0 ]; then
79+ exit 1
80+ fi
0 commit comments