circle-test-frontend.sh 522 B

1234567891011121314151617181920212223242526
  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. if [ "${CIRCLE_BRANCH}" == "master" ]; then
  18. exit_if_fail ./scripts/ci-frontend-metrics.sh
  19. exit_if_fail ./scripts/ci-metrics-publisher.sh grafana.ci-performance.frontend-tests=$seconds
  20. fi