1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Improve integration test detecetor

The "new test" detector in test-integration-flaky was a bit flaky since
it would detect function signatures that are not new tests.

In addition, the test calls `return` outside of a function which is not
allowed.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff 2019-08-06 19:28:07 -07:00
parent 608f37ffd2
commit e2b24490e4

View file

@ -2,9 +2,12 @@
set -e -o pipefail
source hack/validate/.validate
run_integration_flaky() {
new_tests=$(
validate_diff --diff-filter=ACMR --unified=0 -- 'integration/*_test.go' |
grep -E '^(\+func )(.*)(\*testing)' || true
grep -E '^(\+func Test)(.*)(\*testing\.T\))' || true
)
if [ -z "$new_tests" ]; then
@ -27,3 +30,6 @@ echo "Running stress test for them."
echo "Using test flags: $TESTFLAGS"
source hack/make/test-integration
)
}
run_integration_flaky