hack/test: Split -test.run for integration and integration-cli

To avoid passing the `/` prefix in the -test.run to the integration test
suite, which for some reason executes all tests, but works fine with
integration-cli.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski 2023-08-08 13:20:21 +02:00
parent 510cac5f5b
commit ae008570ff
No known key found for this signature in database
GPG key ID: B85EFCFE26DEF92A

View file

@ -31,8 +31,6 @@ setup_integration_test_filter() {
if [ -z "${TEST_INTEGRATION_DIR}" ]; then
echo "Skipping integration tests since the supplied filter \"${TEST_FILTER}\" omits all integration tests"
TEST_SKIP_INTEGRATION=1
else
TESTFLAGS+=" -test.run ${TEST_FILTER}"
fi
fi
@ -40,8 +38,6 @@ setup_integration_test_filter() {
if ! echo "$dirs" | grep -q '^./integration-cli$'; then
TEST_SKIP_INTEGRATION_CLI=1
echo "Skipping integration-cli tests since the supplied filter \"${TEST_FILTER}\" omits all integration-cli tests"
else
TESTFLAGS+=" -test.run /${TEST_FILTER}"
fi
fi
}
@ -64,8 +60,15 @@ run_test_integration() {
}
run_test_integration_suites() {
local flags="-test.v -test.timeout=${TIMEOUT} $TESTFLAGS"
local dirs="$1"
local flags="-test.v -test.timeout=${TIMEOUT} $TESTFLAGS "
if [ -n "${TEST_FILTER}" ]; then
if [ "$dirs" == "integration-cli" ]; then
flags+=" -test.run /${TEST_FILTER}"
else
flags+=" -test.run ${TEST_FILTER}"
fi
fi
local failed=0
for dir in ${dirs}; do
if ! (