Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit b5cb39e

Browse files
authored
Merge pull request #40799 from thaJeztah/19.03_backport_fix_test_filter
[19.03 backport] Fix TEST_FILTER to work for both "integration" and "integration-cli" Upstream-commit: a58b52b037de1fec5f6df2aa1d07c57b9f0756ff Component: engine
2 parents 5a2d140 + 03a2b6f commit b5cb39e

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

components/engine/hack/make/.integration-test-helpers

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ setup_integration_test_filter() {
2121
if [ -z "${TEST_FILTER}" ]; then
2222
return
2323
fi
24-
TESTFLAGS+="-test.run ${TEST_FILTER}"
2524

2625
local dirs
2726
dirs=$(grep -rIlE --include '*_test.go' "func .*${TEST_FILTER}.*\(. \*testing\.T\)" ./integration*/ | xargs -I file dirname file | uniq)
@@ -30,19 +29,27 @@ setup_integration_test_filter() {
3029
if [ -z "${TEST_INTEGRATION_DIR}" ]; then
3130
echo "Skipping integration tests since the supplied filter \"${TEST_FILTER}\" omits all integration tests"
3231
TEST_SKIP_INTEGRATION=1
32+
else
33+
TESTFLAGS+=" -test.run ${TEST_FILTER}"
3334
fi
3435
fi
3536

3637
if [ -z "${TEST_SKIP_INTEGRATION_CLI}" ]; then
3738
if echo "$dirs" | grep -vq '^./integration-cli$'; then
3839
TEST_SKIP_INTEGRATION_CLI=1
3940
echo "Skipping integration-cli tests since the supplied filter \"${TEST_FILTER}\" omits all integration-cli tests"
41+
else
42+
TESTFLAGS+=" -test.run /${TEST_FILTER}"
4043
fi
4144
fi
4245
}
4346

4447
setup_integration_test_filter
45-
integration_api_dirs="${TEST_INTEGRATION_DIR:-$(go list -test -f '{{- if ne .ForTest "" -}}{{- .Dir -}}{{- end -}}' ./integration/...)}"
48+
if [ -z "${TEST_SKIP_INTEGRATION}" ] && [ -z "${TEST_INTEGRATION_DIR}" ]; then
49+
integration_api_dirs="$(go list -test -f '{{- if ne .ForTest "" -}}{{- .Dir -}}{{- end -}}' ./integration/...)"
50+
else
51+
integration_api_dirs="${TEST_INTEGRATION_DIR}"
52+
fi
4653

4754
run_test_integration() {
4855
set_platform_timeout

0 commit comments

Comments
 (0)