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.
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
