test-integration-flaky 949 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env bash
  2. set -e -o pipefail
  3. source hack/validate/.validate
  4. run_integration_flaky() {
  5. new_tests=$(
  6. validate_diff --diff-filter=ACMR --unified=0 -- 'integration/*_test.go' \
  7. | grep -E '^(\+func Test)(.*)(\*testing\.T\))' || true
  8. )
  9. if [ -z "$new_tests" ]; then
  10. echo 'No new tests added to integration.'
  11. return
  12. fi
  13. echo
  14. echo "Found new integrations tests:"
  15. echo "$new_tests"
  16. echo "Running stress test for them."
  17. (
  18. TESTARRAY=$(echo "$new_tests" | sed 's/+func //' | awk -F'\\(' '{print $1}' | tr '\n' '|')
  19. # Note: TEST_REPEAT will make the test suite run 5 times, restarting the daemon
  20. # and each test will run 5 times in a row under the same daemon.
  21. # This will make a total of 25 runs for each test in TESTARRAY.
  22. export TEST_REPEAT=5
  23. export TESTFLAGS="-test.count ${TEST_REPEAT} -test.run ${TESTARRAY%?}"
  24. echo "Using test flags: $TESTFLAGS"
  25. source hack/make/test-integration
  26. )
  27. }
  28. run_integration_flaky