run.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/bash
  2. set -o errexit
  3. set -o pipefail
  4. source ../tools.sh
  5. BUILD_ID=$((RANDOM % 7200 + 600))
  6. BROWSER="electron" # Default. Will try to use Google Chrome.
  7. if hash google-chrome 2>/dev/null; then
  8. BROWSER="chrome"
  9. echo "Using Google Chrome as a browser."
  10. else
  11. echo "Google Chrome not found. Using Electron."
  12. fi
  13. # Bundle the updated web code into the server codebase.
  14. if [ -z "$SKIP_BUILD" ]; then
  15. echo "Bundling web code into server..."
  16. # Change to the root directory of the repository
  17. pushd "$(git rev-parse --show-toplevel)"
  18. ./build/web/bundleWeb.sh >/dev/null
  19. popd
  20. else
  21. echo "Skipping web build..."
  22. fi
  23. # Install the web test framework
  24. if [ -z "$SKIP_BUILD" ]; then
  25. echo "Installing test dependencies..."
  26. npm install --quiet --no-progress
  27. else
  28. echo "Skipping dependencies installation"
  29. fi
  30. set -o nounset
  31. install_ffmpeg
  32. start_owncast
  33. # Run cypress browser tests for desktop
  34. npx cypress run --parallel --browser "$BROWSER" --group "desktop-offline" --env tags=desktop --ci-build-id $BUILD_ID --tag "desktop,offline" --record --key e9c8b547-7a8f-452d-8c53-fd7531491e3b --spec "cypress/e2e/offline/*.cy.js"
  35. # Run cypress browser tests for mobile
  36. npx cypress run --parallel --browser "$BROWSER" --group "mobile-offline" --env tags=mobile --ci-build-id $BUILD_ID --tag "mobile,offline" --record --key e9c8b547-7a8f-452d-8c53-fd7531491e3b --spec "cypress/e2e/offline/*.cy.js" --config viewportWidth=375,viewportHeight=667
  37. start_stream
  38. # Run cypress browser tests for desktop
  39. npx cypress run --parallel --browser "$BROWSER" --group "desktop-online" --env tags=desktop --ci-build-id $BUILD_ID --tag "desktop,online" --record --key e9c8b547-7a8f-452d-8c53-fd7531491e3b --spec "cypress/e2e/online/*.cy.js"
  40. # Run cypress browser tests for mobile
  41. npx cypress run --parallel --browser "$BROWSER" --group "mobile-online" --env tags=mobile --ci-build-id $BUILD_ID --tag "mobile,online" --record --key e9c8b547-7a8f-452d-8c53-fd7531491e3b --spec "cypress/e2e/online/*.cy.js" --config viewportWidth=375,viewportHeight=667