test-frontend.sh 887 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. # https://ci-operator-configresolver-ui-ci.apps.ci.l2s4.p1.openshiftapps.com/help#env
  4. OPENSHIFT_CI=${OPENSHIFT_CI:=false}
  5. ARTIFACT_DIR=${ARTIFACT_DIR:=/tmp/artifacts}
  6. yarn i18n
  7. GIT_STATUS="$(git status --short --untracked-files -- locales)"
  8. if [ -n "$GIT_STATUS" ]; then
  9. echo "i18n files are not up to date. Run 'yarn i18n' then commit changes."
  10. git --no-pager diff
  11. exit 1
  12. fi
  13. if ! yarn dedupe --strategy highest --check ; then
  14. echo "You have duplicate version resolutions of some packages in yarn.lock. Run 'yarn dedupe' and commit the updated yarn.lock."
  15. yarn dedupe --strategy highest
  16. git --no-pager diff
  17. exit 1
  18. fi
  19. if [ "$OPENSHIFT_CI" = true ]; then
  20. JEST_SUITE_NAME="Plugin unit tests" JEST_JUNIT_OUTPUT_DIR="$ARTIFACT_DIR" yarn run test --ci --maxWorkers=2 --reporters=default --reporters=jest-junit
  21. else
  22. yarn run test
  23. fi