Merge pull request #61 from mlocati/do-duplicated-tests

Avoid testing the same extensions more than once
pull/62/head
Michele Locati 2019-12-17 09:56:48 +01:00 committed by GitHub
commit 576faba4b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 7 deletions

View File

@ -17,6 +17,7 @@ fi
. "${TRAVIS_BUILD_DIR}/scripts/common"
ALREADY_TESTED_EXTENSIONS=''
# Get the docker image ID for a PHP extension and a PHP version
#
@ -95,12 +96,13 @@ testNewExtensionLine () {
if test $# -lt 2; then
printf 'Missing PHP version list for the new extension %s\n' "${1:-}"
testNewExtensionLine_rc=1
else
elif ! stringInList "$1" "$ALREADY_TESTED_EXTENSIONS"; then
printf '### TESTING NEW EXTENSION %s ###\n' "${1}"
if test -n "$(printf '%s' "${1}" | sed -E 's/^[a-z][a-z0-9\-\_\.]+$//')"; then
printf ' INVALID PHP EXTENSION NAME: %s\n' "${1}" >&2
testNewExtensionLine_rc=1
else
ALREADY_TESTED_EXTENSIONS="$ALREADY_TESTED_EXTENSIONS $1"
testNewExtensionLine_extension="${1}"
while test $# -ge 2; do
shift
@ -203,12 +205,15 @@ testExtensionsFromMessage () {
fi
IFS=' '
for TEST_EXTENSION in $TEST_EXTENSIONS; do
printf '### TESTING EXTENSION %s ###\n' "$TEST_EXTENSION"
for TEST_PHPVERSION in $(getAllPHPVersionsFor $TEST_EXTENSION); do
if ! testExtension "$TEST_EXTENSION" "$TEST_PHPVERSION"; then
testExtensionsFromMessage_result=1
fi
done
if ! stringInList "$TEST_EXTENSION" "$ALREADY_TESTED_EXTENSIONS"; then
ALREADY_TESTED_EXTENSIONS="$ALREADY_TESTED_EXTENSIONS $TEST_EXTENSION"
printf '### TESTING EXTENSION %s ###\n' "$TEST_EXTENSION"
for TEST_PHPVERSION in $(getAllPHPVersionsFor $TEST_EXTENSION); do
if ! testExtension "$TEST_EXTENSION" "$TEST_PHPVERSION"; then
testExtensionsFromMessage_result=1
fi
done
fi
done
done
resetIFS