[travis] use PHP 8.0 to patch return types and run deps=low

This commit is contained in:
Nicolas Grekas 2021-01-14 00:57:45 +01:00
parent d23b74ebce
commit 7f5ea78fb8
23 changed files with 63 additions and 62 deletions

View File

@ -22,7 +22,7 @@ Symfony\Component\ErrorHandler\DebugClassLoader::enable();
foreach ($loader->getClassMap() as $class => $file) {
switch (true) {
case false !== strpos(realpath($file), '/vendor/'):
case false !== strpos($file = realpath($file), '/vendor/'):
case false !== strpos($file, '/src/Symfony/Bridge/PhpUnit/'):
case false !== strpos($file, '/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Article.php'):
case false !== strpos($file, '/src/Symfony/Component/Config/Tests/Fixtures/BadFileName.php'):
@ -30,9 +30,8 @@ foreach ($loader->getClassMap() as $class => $file) {
case false !== strpos($file, '/src/Symfony/Component/Config/Tests/Fixtures/ParseError.php'):
case false !== strpos($file, '/src/Symfony/Component/Debug/Tests/Fixtures/'):
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Compiler/OptionalServiceClass.php'):
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/CheckTypeDeclarationsPass/UnionConstructor.php'):
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php'):
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/uniontype_classes.php'):
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/MultipleArgumentsOptionalScalarNotReallyOptional.php'):
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ParentNotExists.php'):
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Preload/'):
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Prototype/BadClasses/MissingParent.php'):
@ -40,10 +39,8 @@ foreach ($loader->getClassMap() as $class => $file) {
case false !== strpos($file, '/src/Symfony/Component/ErrorHandler/Tests/Fixtures/'):
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php'):
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/ParentDummy.php'):
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php80Dummy.php'):
case false !== strpos($file, '/src/Symfony/Component/Serializer/Tests/Normalizer/Features/ObjectOuter.php'):
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/NotLoadableClass.php'):
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/Php74.php') && \PHP_VERSION_ID < 70400:
continue 2;
}

View File

@ -2,7 +2,7 @@
error_reporting(-1);
set_error_handler(function ($type, $message, $file, $line) {
if (error_reporting()) {
if (error_reporting() & $type) {
throw new \ErrorException($message, 0, $type, $file, $line);
}
});

View File

@ -21,13 +21,11 @@ env:
matrix:
include:
- php: 7.1
env: php_extra="7.2 7.4"
- php: 7.3
env: deps=high
env: php_extra="7.2 7.3 8.0"
- php: 7.4
env: deps=low
env: deps=high
- php: 8.0
services: [memcached]
env: deps=low
fast_finish: true
cache:
@ -71,7 +69,7 @@ before_install:
# tfold is a helper to create folded reports
tfold () {
local title="🐘 $PHP $1 $FLIP"
local title="$PHP $1 $FLIP"
local fold=$(echo $title | sed -r 's/[^-_A-Za-z0-9]+/./g')
shift
local id=$(printf %08x $(( RANDOM * RANDOM )))
@ -183,6 +181,7 @@ install:
git config --global user.name "Symfony"
export SYMFONY_VERSION=$(grep branch-version composer.json | grep -o '[0-9.x]*')
SYMFONY_VERSIONS=$(git ls-remote -q --heads);
if [[ ! $deps ]]; then
php .github/build-packages.php HEAD^ $SYMFONY_VERSION src/Symfony/Bridge/PhpUnit
@ -202,8 +201,8 @@ install:
- |
# For the feature-branch, when deps=high, the version before it is checked out and tested with the locally patched components
if [[ $deps = high && $TRAVIS_BRANCH = *.x ]]; then
export FLIP='🙃'
export SYMFONY_VERSION=$(git ls-remote -q --heads | grep -o '/[1-9]\.[0-9].*' | tail -n 1 | sed s/.//) &&
export FLIP='^'
export SYMFONY_VERSION=$(echo "$SYMFONY_VERSIONS" | grep -o '/[1-9]\.[0-9].*' | tail -n 1 | sed s/.//) &&
git fetch --depth=2 origin $SYMFONY_VERSION &&
git checkout -m FETCH_HEAD &&
export COMPONENTS=$(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
@ -226,7 +225,7 @@ install:
- |
# Legacy tests are skipped when deps=high and when the current branch version has not the same major version number as the next one
[[ $deps = high && ${SYMFONY_VERSION%.*} != $(git ls-remote -q --heads | cut -f2 | grep -FA1 /$SYMFONY_VERSION | tail -n 1 | grep -o '[0-9]*' | head -n 1) ]] && export LEGACY=,legacy
[[ $deps = high && ${SYMFONY_VERSION%.*} != $(echo "$SYMFONY_VERSIONS" | cut -f2 | grep -FA1 /$SYMFONY_VERSION | tail -n 1 | grep -o '[0-9]*' | head -n 1) ]] && export LEGACY=,legacy
if [[ $deps ]]; then mv composer.json.phpunit composer.json; fi
@ -248,7 +247,7 @@ install:
set -e
export PHP=$1
if [[ $PHP != 7.4* && $PHP != $TRAVIS_PHP_VERSION && $TRAVIS_PULL_REQUEST != false ]]; then
if [[ $PHP != 8.0* && $PHP != $TRAVIS_PHP_VERSION && $TRAVIS_PULL_REQUEST != false ]]; then
echo -e "\\n\\e[33;1mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"
return
fi
@ -262,8 +261,8 @@ install:
(cd src/Symfony/Component/HttpFoundation; mv composer.bak composer.json)
COMPONENTS=$(git diff --name-only src/ | grep composer.json || true)
if [[ $COMPONENTS && $LEGACY && ! $TRAVIS_BRANCH = *.x && $TRAVIS_PULL_REQUEST != false ]]; then
export FLIP='🙃'
if [[ $COMPONENTS && $LEGACY && ! $TRAVIS_BRANCH = *.x && $TRAVIS_PULL_REQUEST != false && $(echo "$SYMFONY_VERSIONS" | cut -f2 | grep -FA1 /$SYMFONY_VERSION | tail -n 1) = *.x ]]; then
export FLIP='^'
SYMFONY_VERSION=$(echo $SYMFONY_VERSION | awk '{print $1 - 1}')
echo -e "\\n\\e[33;1mChecking out Symfony $SYMFONY_VERSION and running tests with patched components as deps\\e[0m"
export SYMFONY_REQUIRE=">=$SYMFONY_VERSION"
@ -283,12 +282,12 @@ install:
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && ([ -e composer.lock ] && ${COMPOSER_UP/update/install} || $COMPOSER_UP --prefer-lowest --prefer-stable) && $PHPUNIT_X'"
echo "$COMPONENTS" | xargs -n1 -I{} tar --append -f ~/php-ext/composer-lowest.lock.tar {}/composer.lock
else
if [[ $PHP = 7.4* ]]; then
if [[ $PHP = 8.0* ]]; then
# add return types before running the test suite
sed -i 's/"\*\*\/Tests\/"//' composer.json
composer install --optimize-autoloader
SYMFONY_PATCH_TYPE_DECLARATIONS=force=object php .github/patch-types.php
SYMFONY_PATCH_TYPE_DECLARATIONS=force=object php .github/patch-types.php # ensure the script is idempotent
SYMFONY_PATCH_TYPE_DECLARATIONS=force=1 php .github/patch-types.php
SYMFONY_PATCH_TYPE_DECLARATIONS=force=1 php .github/patch-types.php # ensure the script is idempotent
PHPUNIT_X="$PHPUNIT_X,legacy"
fi

View File

@ -21,7 +21,7 @@
"friendsofphp/proxy-manager-lts": "^1.0.2",
"doctrine/event-manager": "~1.0",
"doctrine/persistence": "^1.3|^2",
"twig/twig": "^1.41|^2.10|^3.0",
"twig/twig": "^1.43|^2.13|^3.0.4",
"psr/cache": "~1.0",
"psr/container": "^1.0",
"psr/link": "^1.0",
@ -102,14 +102,14 @@
"require-dev": {
"cache/integration-tests": "dev-master",
"composer/package-versions-deprecated": "^1.8",
"doctrine/annotations": "~1.0",
"doctrine/annotations": "^1.10.4",
"doctrine/cache": "~1.6",
"doctrine/collections": "~1.0",
"doctrine/data-fixtures": "^1.1",
"doctrine/dbal": "~2.4|^3.0",
"doctrine/orm": "~2.4,>=2.4.5",
"doctrine/dbal": "^2.6|^3.0",
"doctrine/orm": "^2.6.3",
"doctrine/doctrine-bundle": "^1.5|^2.0",
"guzzlehttp/promises": "^1.3.1",
"guzzlehttp/promises": "^1.4",
"masterminds/html5": "^2.6",
"monolog/monolog": "^1.25.1",
"nyholm/psr7": "^1.0",
@ -118,7 +118,7 @@
"predis/predis": "~1.1",
"psr/http-client": "^1.0",
"psr/simple-cache": "^1.0",
"egulias/email-validator": "~1.2,>=1.2.8|~2.0",
"egulias/email-validator": "^2.1.10",
"symfony/phpunit-bridge": "^5.2",
"symfony/security-acl": "~2.8|~3.0",
"phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
@ -129,8 +129,8 @@
"conflict": {
"masterminds/html5": "<2.6",
"monolog/monolog": ">=2",
"phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2",
"phpdocumentor/type-resolver": "<0.3.0",
"phpdocumentor/reflection-docblock": "<3.0|>=3.2.0,<3.2.2",
"phpdocumentor/type-resolver": "<0.3.0|1.3.*",
"ocramius/proxy-manager": "<2.1",
"phpunit/phpunit": "<5.4.3"
},

View File

@ -39,11 +39,11 @@
"symfony/validator": "^4.4.2|^5.0.2",
"symfony/var-dumper": "^3.4|^4.0|^5.0",
"symfony/translation": "^3.4|^4.0|^5.0",
"doctrine/annotations": "~1.7",
"doctrine/annotations": "^1.10.4",
"doctrine/cache": "~1.6",
"doctrine/collections": "~1.0",
"doctrine/data-fixtures": "^1.1",
"doctrine/dbal": "~2.4|^3.0",
"doctrine/dbal": "^2.6|^3.0",
"doctrine/orm": "^2.6.3"
},
"conflict": {

View File

@ -82,7 +82,9 @@ class Deprecation
$this->message = $parsedMsg['deprecation'];
$this->originClass = $parsedMsg['class'];
$this->originMethod = $parsedMsg['method'];
$this->originalFilesStack = $parsedMsg['files_stack'];
if (isset($parsedMsg['files_stack'])) {
$this->originalFilesStack = $parsedMsg['files_stack'];
}
// If the deprecation has been triggered via
// \Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait::endTest()
// then we need to use the serialized information to determine

View File

@ -260,7 +260,7 @@ class SymfonyTestsListenerTrait
unlink($this->runsInSeparateProcess);
putenv('SYMFONY_DEPRECATIONS_SERIALIZE');
foreach ($deprecations ? unserialize($deprecations) : [] as $deprecation) {
$error = serialize(['deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false), 'triggering_file' => isset($deprecation[2]) ? $deprecation[2] : null]);
$error = serialize(['deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false), 'triggering_file' => isset($deprecation[2]) ? $deprecation[2] : null, 'files_stack' => isset($deprecation[3]) ? $deprecation[3] : []]);
if ($deprecation[0]) {
// unsilenced on purpose
trigger_error($error, \E_USER_DEPRECATED);

View File

@ -18,7 +18,7 @@
"require": {
"php": ">=7.1.3",
"symfony/translation-contracts": "^1.1|^2",
"twig/twig": "^1.41|^2.10|^3.0"
"twig/twig": "^1.43|^2.13|^3.0.4"
},
"require-dev": {
"egulias/email-validator": "^2.1.10",

View File

@ -27,10 +27,10 @@
"symfony/polyfill-mbstring": "~1.0",
"symfony/filesystem": "^3.4|^4.0|^5.0",
"symfony/finder": "^3.4|^4.0|^5.0",
"symfony/routing": "^4.4|^5.0"
"symfony/routing": "^4.4.12|^5.1.4"
},
"require-dev": {
"doctrine/annotations": "~1.7",
"doctrine/annotations": "^1.10.4",
"doctrine/cache": "~1.0",
"paragonie/sodium_compat": "^1.8",
"symfony/asset": "^3.4|^4.0|^5.0",
@ -60,13 +60,13 @@
"symfony/yaml": "^3.4|^4.0|^5.0",
"symfony/property-info": "^3.4|^4.0|^5.0",
"symfony/web-link": "^4.4|^5.0",
"phpdocumentor/reflection-docblock": "^3.0|^4.0",
"twig/twig": "^1.41|^2.10|^3.0"
"phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
"twig/twig": "^1.43|^2.13|^3.0.4"
},
"conflict": {
"doctrine/persistence": "<1.3",
"phpdocumentor/reflection-docblock": "<3.0",
"phpdocumentor/type-resolver": "<0.2.1",
"phpdocumentor/reflection-docblock": "<3.0|>=3.2.0,<3.2.2",
"phpdocumentor/type-resolver": "<0.3.0|1.3.*",
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
"symfony/asset": "<3.4",
"symfony/browser-kit": "<4.3",

View File

@ -43,7 +43,7 @@
"symfony/twig-bundle": "^4.4|^5.0",
"symfony/validator": "^3.4|^4.0|^5.0",
"symfony/yaml": "^3.4|^4.0|^5.0",
"twig/twig": "^1.41|^2.10|^3.0"
"twig/twig": "^1.43|^2.13|^3.0.4"
},
"conflict": {
"symfony/browser-kit": "<4.2",

View File

@ -21,7 +21,7 @@
"symfony/http-foundation": "^4.3|^5.0",
"symfony/http-kernel": "^4.4",
"symfony/polyfill-ctype": "~1.8",
"twig/twig": "^1.41|^2.10|^3.0"
"twig/twig": "^1.43|^2.13|^3.0.4"
},
"require-dev": {
"symfony/asset": "^3.4|^4.0|^5.0",
@ -36,7 +36,7 @@
"symfony/yaml": "^3.4|^4.0|^5.0",
"symfony/framework-bundle": "^4.4|^5.0",
"symfony/web-link": "^3.4|^4.0|^5.0",
"doctrine/annotations": "~1.7",
"doctrine/annotations": "^1.10.4",
"doctrine/cache": "~1.0"
},
"conflict": {

View File

@ -22,7 +22,7 @@
"symfony/http-kernel": "^4.4",
"symfony/routing": "^4.3|^5.0",
"symfony/twig-bundle": "^4.2|^5.0",
"twig/twig": "^1.41|^2.10|^3.0"
"twig/twig": "^1.43|^2.13|^3.0.4"
},
"require-dev": {
"symfony/browser-kit": "^4.3|^5.0",

View File

@ -31,7 +31,7 @@
"require-dev": {
"cache/integration-tests": "dev-master",
"doctrine/cache": "^1.6",
"doctrine/dbal": "^2.5|^3.0",
"doctrine/dbal": "^2.6|^3.0",
"predis/predis": "^1.1",
"psr/simple-cache": "^1.0",
"symfony/config": "^4.2|^5.0",
@ -41,7 +41,7 @@
"symfony/var-dumper": "^4.4|^5.0"
},
"conflict": {
"doctrine/dbal": "<2.5",
"doctrine/dbal": "<2.6",
"symfony/dependency-injection": "<3.4",
"symfony/http-kernel": "<4.4|>=5.0",
"symfony/var-dumper": "<4.4"

View File

@ -40,5 +40,6 @@ class GlobFileLoaderWithoutImport extends GlobFileLoader
{
public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null, $exclude = null)
{
return null;
}
}

View File

@ -67,10 +67,11 @@ class DebugClassLoader
'string' => 'string',
'self' => 'self',
'parent' => 'parent',
'mixed' => 'mixed',
] + (\PHP_VERSION_ID >= 80000 ? [
'static' => 'static',
'$this' => 'static',
] : [
'mixed' => 'mixed',
'static' => 'object',
'$this' => 'object',
]);

View File

@ -28,7 +28,7 @@
"symfony/service-contracts": "^1.0|^2"
},
"require-dev": {
"guzzlehttp/promises": "^1.3.1",
"guzzlehttp/promises": "^1.4",
"nyholm/psr7": "^1.0",
"php-http/httplug": "^1.0|^2.0",
"psr/http-client": "^1.0",

View File

@ -42,7 +42,7 @@
"symfony/translation": "^4.2|^5.0",
"symfony/translation-contracts": "^1.1|^2",
"psr/cache": "~1.0",
"twig/twig": "^1.34|^2.4|^3.0"
"twig/twig": "^1.43|^2.13|^3.0.4"
},
"provide": {
"psr/log-implementation": "1.0"
@ -53,7 +53,7 @@
"symfony/console": ">=5",
"symfony/dependency-injection": "<4.3",
"symfony/translation": "<4.2",
"twig/twig": "<1.34|<2.4,>=2"
"twig/twig": "<1.43|<2.13,>=2"
},
"suggest": {
"symfony/browser-kit": "",

View File

@ -20,11 +20,11 @@
"psr/log": "~1.0"
},
"require-dev": {
"doctrine/dbal": "^2.5|^3.0",
"doctrine/dbal": "^2.6|^3.0",
"predis/predis": "~1.0"
},
"conflict": {
"doctrine/dbal": "<2.5"
"doctrine/dbal": "<2.6"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Lock\\": "" },

View File

@ -31,11 +31,11 @@
"symfony/cache": "^3.4|^4.0|^5.0",
"symfony/dependency-injection": "^3.4|^4.0|^5.0",
"phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
"doctrine/annotations": "~1.7"
"doctrine/annotations": "^1.10.4"
},
"conflict": {
"phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2",
"phpdocumentor/type-resolver": "<0.3.0",
"phpdocumentor/reflection-docblock": "<3.0|>=3.2.0,<3.2.2",
"phpdocumentor/type-resolver": "<0.3.0|1.3.*",
"symfony/dependency-injection": "<3.4"
},
"suggest": {

View File

@ -24,7 +24,7 @@
"symfony/yaml": "^3.4|^4.0|^5.0",
"symfony/expression-language": "^3.4|^4.0|^5.0",
"symfony/dependency-injection": "^3.4|^4.0|^5.0",
"doctrine/annotations": "~1.2",
"doctrine/annotations": "^1.10.4",
"psr/log": "~1.0"
},
"conflict": {

View File

@ -20,22 +20,23 @@
"symfony/polyfill-ctype": "~1.8"
},
"require-dev": {
"doctrine/annotations": "~1.0",
"doctrine/annotations": "^1.10.4",
"doctrine/cache": "~1.0",
"phpdocumentor/reflection-docblock": "^3.2|^4.0",
"phpdocumentor/reflection-docblock": "^3.2|^4.0|^5.0",
"symfony/cache": "^3.4|^4.0|^5.0",
"symfony/config": "^3.4|^4.0|^5.0",
"symfony/dependency-injection": "^3.4|^4.0|^5.0",
"symfony/error-handler": "^4.4|^5.0",
"symfony/http-foundation": "^3.4|^4.0|^5.0",
"symfony/mime": "^4.4|^5.0",
"symfony/property-access": "^3.4|^4.0|^5.0",
"symfony/property-access": "^3.4.41|^4.4.9|^5.0.9",
"symfony/property-info": "^3.4.13|~4.0|^5.0",
"symfony/validator": "^3.4|^4.0|^5.0",
"symfony/yaml": "^3.4|^4.0|^5.0"
},
"conflict": {
"phpdocumentor/type-resolver": "<0.2.1",
"phpdocumentor/reflection-docblock": "<3.0|>=3.2.0,<3.2.2",
"phpdocumentor/type-resolver": "<0.3.0|1.3.*",
"symfony/dependency-injection": "<3.4",
"symfony/property-access": "<3.4",
"symfony/property-info": "<3.4",

View File

@ -35,7 +35,7 @@
"symfony/property-access": "^3.4|^4.0|^5.0",
"symfony/property-info": "^3.4|^4.0|^5.0",
"symfony/translation": "^4.2",
"doctrine/annotations": "~1.7",
"doctrine/annotations": "^1.10.4",
"doctrine/cache": "~1.0",
"egulias/email-validator": "^2.1.10"
},

View File

@ -25,7 +25,7 @@
"ext-iconv": "*",
"symfony/console": "^3.4|^4.0|^5.0",
"symfony/process": "^4.4|^5.0",
"twig/twig": "^1.34|^2.4|^3.0"
"twig/twig": "^1.43|^2.13|^3.0.4"
},
"conflict": {
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",