test-frontend.sh 949 B

1234567891011121314151617181920212223242526272829303132
  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. if [ ! -d node_modules ]; then
  7. yarn install --immutable
  8. fi
  9. yarn i18n
  10. GIT_STATUS="$(git status --short --untracked-files -- locales)"
  11. if [ -n "$GIT_STATUS" ]; then
  12. echo "i18n files are not up to date. Run 'yarn i18n' then commit changes."
  13. git --no-pager diff
  14. exit 1
  15. fi
  16. if ! yarn dedupe --strategy highest --check ; then
  17. echo "You have duplicate version resolutions of some packages in yarn.lock. Run 'yarn dedupe' and commit the updated yarn.lock."
  18. yarn dedupe --strategy highest
  19. git --no-pager diff
  20. exit 1
  21. fi
  22. if [ "$OPENSHIFT_CI" = true ]; then
  23. JEST_SUITE_NAME="Plugin unit tests" JEST_JUNIT_OUTPUT_DIR="$ARTIFACT_DIR" yarn run test --ci --maxWorkers=2 --reporters=default --reporters=jest-junit
  24. else
  25. yarn run test
  26. fi