test-prow-e2e.sh 813 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env bash
  2. set -exuo pipefail
  3. ARTIFACT_DIR=${ARTIFACT_DIR:=/tmp/artifacts}
  4. SCREENSHOTS_DIR=integration-tests/screenshots
  5. function copyArtifacts {
  6. if [ -d "$ARTIFACT_DIR" ] && [ -d "$SCREENSHOTS_DIR" ]; then
  7. echo "Copying artifacts from $(pwd)..."
  8. cp -r "$SCREENSHOTS_DIR" "${ARTIFACT_DIR}"
  9. fi
  10. }
  11. trap copyArtifacts EXIT
  12. # don't log kubeadmin-password
  13. set +x
  14. BRIDGE_KUBEADMIN_PASSWORD="$(cat "${KUBEADMIN_PASSWORD_FILE:-${INSTALLER_DIR}/auth/kubeadmin-password}")"
  15. export BRIDGE_KUBEADMIN_PASSWORD
  16. set -x
  17. BRIDGE_BASE_ADDRESS="$(oc get consoles.config.openshift.io cluster -o jsonpath='{.status.consoleURL}')"
  18. export BRIDGE_BASE_ADDRESS
  19. echo "Install dependencies"
  20. if [ ! -d node_modules ]; then
  21. yarn install
  22. fi
  23. echo "Runs Cypress tests in headless mode"
  24. yarn run test-cypress-headless