mirror of
https://github.com/cytopia/devilbox.git
synced 2025-04-13 22:03:08 +00:00
Ensure to exclude breaking tests
This commit is contained in:
parent
09ac5f3f85
commit
35ff034786
@ -5,12 +5,53 @@ set -u
|
||||
set -o pipefail
|
||||
|
||||
|
||||
# There's currently an Issue with PHP 7.3, Xdebug and phpMyAdmin. It just segfaults,
|
||||
# so I will remove it from the checks.
|
||||
DISABLED_VERSIONS=("7.3")
|
||||
|
||||
#
|
||||
# NOTE: Parsing curl to tac to circumnvent "failed writing body"
|
||||
# https://stackoverflow.com/questions/16703647/why-curl-return-and-error-23-failed-writing-body
|
||||
#
|
||||
|
||||
|
||||
###
|
||||
### Get current PHP version
|
||||
###
|
||||
|
||||
printf "[TEST] Get PHP version"
|
||||
# 1st Try
|
||||
if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' | grep -Eo '\([.0-9]+' | grep -Eo '[0-9]+\.[0-9]+' )"; then
|
||||
# 2nd Try
|
||||
sleep 1
|
||||
if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' | grep -Eo '\([.0-9]+' | grep -Eo '[0-9]+\.[0-9]+' )"; then
|
||||
# 3rd Try
|
||||
sleep 1
|
||||
if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' | grep -Eo '\([.0-9]+' | grep -Eo '[0-9]+\.[0-9]+' )"; then
|
||||
printf "\r[FAIL] Get PHP version\n"
|
||||
curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' || true
|
||||
exit 1
|
||||
else
|
||||
printf "\r[OK] Get PHP version (3 rounds): %s\n" "${PHP_VERSION}"
|
||||
fi
|
||||
else
|
||||
printf "\r[OK] Get PHP version (2 rounds): %s\n" "${PHP_VERSION}"
|
||||
fi
|
||||
else
|
||||
printf "\r[OK] Get PHP version (1 round): %s\n" "${PHP_VERSION}"
|
||||
fi
|
||||
|
||||
|
||||
###
|
||||
### Ensure only to check against desired versions
|
||||
###
|
||||
|
||||
if [[ ${DISABLED_VERSIONS[*]} =~ ${PHP_VERSION} ]]; then
|
||||
printf "[SKIP] Skipping all checks for PHP ${PHP_VERSION}\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
###
|
||||
### Retrieve URL for current PHP version.
|
||||
### Older PHP versions are presented a link with a different version due to compatibility.
|
||||
|
Loading…
x
Reference in New Issue
Block a user