circle-test-frontend.sh 520 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. function exit_if_fail {
  3. command=$@
  4. echo "Executing '$command'"
  5. eval $command
  6. rc=$?
  7. if [ $rc -ne 0 ]; then
  8. echo "'$command' returned $rc."
  9. exit $rc
  10. fi
  11. }
  12. start=$(date +%s)
  13. exit_if_fail npm run prettier:check
  14. exit_if_fail npm run test
  15. end=$(date +%s)
  16. seconds=$((end - start))
  17. exit_if_fail ./scripts/ci-frontend-metrics.sh
  18. if [ "${CIRCLE_BRANCH}" == "master" ]; then
  19. exit_if_fail ./scripts/ci-metrics-publisher.sh grafana.ci-performance.frontend-tests=$seconds
  20. fi