entrypoint.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. # Copyright 2019 The Kubernetes Authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. set -euo pipefail
  16. NC='\e[0m'
  17. BGREEN='\e[32m'
  18. E2E_NODES=${E2E_NODES:-5}
  19. if [ ! -f "${HOME}/.kube/config" ]; then
  20. kubectl config set-cluster dev --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt --embed-certs=true --server="https://kubernetes.default/"
  21. kubectl config set-credentials user --token="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)"
  22. kubectl config set-context default --cluster=dev --user=user
  23. kubectl config use-context default
  24. fi
  25. ginkgo_args=(
  26. "--randomize-suites"
  27. "--randomize-all"
  28. "--flake-attempts=2"
  29. "-p"
  30. "-trace"
  31. "-r"
  32. "-v"
  33. "-timeout=45m"
  34. )
  35. for SUITE in ${TEST_SUITES}; do
  36. echo -e "${BGREEN}Running suite ${SUITE} (LABELS=${GINKGO_LABELS})...${NC}"
  37. ACK_GINKGO_RC=true ginkgo "${ginkgo_args[@]}" \
  38. -label-filter="${GINKGO_LABELS}" \
  39. -nodes="${E2E_NODES}" \
  40. /${SUITE}.test
  41. done