github.com/devdivbcp/moby@v17.12.0-ce-rc1.0.20200726071732-2d4bfdc789ad+incompatible/hack/make/test-integration-flaky (about)

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