entrypoint.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 -e
  16. NC='\e[0m'
  17. BGREEN='\e[32m'
  18. SLOW_E2E_THRESHOLD=${SLOW_E2E_THRESHOLD:-50}
  19. FOCUS=${FOCUS:-.*}
  20. E2E_NODES=${E2E_NODES:-5}
  21. if [ ! -f "${HOME}/.kube/config" ]; then
  22. kubectl config set-cluster dev --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt --embed-certs=true --server="https://kubernetes.default/"
  23. kubectl config set-credentials user --token="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)"
  24. kubectl config set-context default --cluster=dev --user=user
  25. kubectl config use-context default
  26. fi
  27. ginkgo_args=(
  28. "-randomizeSuites"
  29. "-randomizeAllSpecs"
  30. "-flakeAttempts=2"
  31. "-p"
  32. "-progress"
  33. "-trace"
  34. "-slowSpecThreshold=${SLOW_E2E_THRESHOLD}"
  35. "-r"
  36. "-v"
  37. "-timeout=45m"
  38. )
  39. kubectl apply -f /k8s/deploy/crds
  40. echo -e "${BGREEN}Running e2e test suite (FOCUS=${FOCUS})...${NC}"
  41. ginkgo "${ginkgo_args[@]}" \
  42. -focus="${FOCUS}" \
  43. -skip="\[Serial\]|\[MemoryLeak\]" \
  44. -nodes="${E2E_NODES}" \
  45. /e2e.test