8000 [WIP][POC] Run Windows tests on GitHub Action by wouterj · Pull Request #58699 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[WIP][POC] Run Windows tests on GitHub Action #58699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
run tests using PHPUnit 11.3
  • Loading branch information
xabbuh committed Oct 28, 2024
commit e44b3d6c26eff0165f52f5797aee7442132b5487
6 changes: 3 additions & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ install:
- echo date.timezone="America/Los_Angeles" >> php.ini-min
- echo extension_dir=ext >> php.ini-min
- echo extension=php_xsl.dll >> php.ini-min
- echo extension=php_mbstring.dll >> php.ini-min
- copy /Y php.ini-min php.ini-max
- echo zend_extension=php_opcache.dll >> php.ini-max
- echo opcache.enable_cli=1 >> php.ini-max
Expand All @@ -39,7 +40,6 @@ install:
- echo extension=php_redis.dll >> php.ini-max
- echo apc.enable_cli=1 >> php.ini-max
- echo extension=php_intl.dll >> php.ini-max
- echo extension=php_mbstring.dll >> php.ini-max
- echo extension=php_fileinfo.dll >> php.ini-max
- echo extension=php_pdo_sqlite.dll >> php.ini-max
- echo extension=php_curl.dll >> php.ini-max
Expand All @@ -63,9 +63,9 @@ test_script:
- copy /Y c:\php\php.ini-min c:\php\php.ini
- IF %APPVEYOR_REPO_BRANCH:~-2% neq .x (rm -Rf src\Symfony\Bridge\PhpUnit)
- mv src\Symfony\Component\HttpClient\phpunit.xml.dist src\Symfony\Component\HttpClient\phpunit.xml
- php phpunit src\Symfony --exclude-group tty,benchmark,intl-data,network,transient-on-windows || SET X=!errorlevel!
- php phpunit src\Symfony --exclude-group tty --exclude-group benchmark --exclude-group intl-data --exclude-group network --exclude-group transient-on-windows || SET X=!errorlevel!
- php phpunit src\Symfony\Component\HttpClient || SET X=!errorlevel!
- copy /Y c:\php\php.ini-max c:\php\php.ini
- php phpunit src\Symfony --exclude-group tty,benchmark,intl-data,network,transient-on-windows || SET X=!errorlevel!
- php phpunit src\Symfony --exclude-group tty --exclude-group benchmark --exclude-group intl-data --exclude-group network --exclude-group transient-on-windows || SET X=!errorlevel!
- php phpunit src\Symfony\Component\HttpClient || SET X=!errorlevel!
- exit %X%
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ jobs:
git diff --exit-code src/ || (echo '::error::Run "php .github/sync-translations.php" to fix XLIFF files.' && exit 1)

- name: Run tests
run: ./phpunit --group integration -v
run: ./phpunit --group integration
env:
INTEGRATION_FTP_URL: 'ftp://test:test@localhost'
REDIS_HOST: 'localhost:16379'
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"

echo COLUMNS=120 >> $GITHUB_ENV
echo PHPUNIT="$(pwd)/phpunit --exclude-group tty,benchmark,intl-data,integration" >> $GITHUB_ENV
echo PHPUNIT="$(pwd)/phpunit --exclude-group tty --exclude-group benchmark --exclude-group intl-data --exclude-group integration" >> $GITHUB_ENV
echo COMPOSER_UP='composer update --no-progress --ansi'$([[ "${{ matrix.mode }}" != low-deps ]] && echo ' --ignore-platform-req=php+') >> $GITHUB_ENV

SYMFONY_VERSIONS=$(git ls-remote -q --heads | cut -f2 | grep -o '/[1-9][0-9]*\.[0-9].*' | sort -V)
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
[[ "${{ matrix.mode }}" = *-deps ]] && mv composer.json.phpunit composer.json || true

if [[ "${{ matrix.mode }}" = low-deps ]]; then
echo SYMFONY_PHPUNIT_REQUIRE="nikic/php-parser:^4.18" >> $GITHUB_ENV
echo SYMFONY_PHPUNIT_REQUIRE="nikic/php-parser:'^4.18|^5.0'" >> $GITHUB_ENV
fi

- name: Install dependencies
Expand Down Expand Up @@ -238,12 +238,14 @@ jobs:

mkdir -p /opt/php/lib
echo memory_limit=-1 > /opt/php/lib/php.ini
./phpunit install
./build/php/bin/php ./phpunit --colors=always src/Symfony/Component/Process
env:
SYMFONY_PHPUNIT_VERSION: '9.6'

- name: Run PhpUnitBridge tests with PHPUnit 11
- name: Run PhpUnitBridge tests with PHPUnit 9.6
if: '! matrix.mode'
run: |
./phpunit src/Symfony/Bridge/PhpUnit
env:
SYMFONY_PHPUNIT_VERSION: '11.3'
SYMFONY_DEPRECATIONS_HELPER: 'disabled'
SYMFONY_PHPUNIT_VERSION: '9.6'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ composer.lock
phpunit.xml
.php-cs-fixer.cache
.php-cs-fixer.php
.phpunit.cache
.phpunit.result.cache
composer.phar
package.tar
Expand Down
3 changes: 2 additions & 1 deletion phpunit
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ if (!file_exists(__DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
exit(1);
}
if (!getenv('SYMFONY_PHPUNIT_VERSION')) {
putenv('SYMFONY_PHPUNIT_VERSION=9.6');
putenv('SYMFONY_PHPUNIT_VERSION=11.3');
putenv('SYMFONY_DEPRECATIONS_HELPER=disabled');
}
if (!getenv('SYMFONY_PATCH_TYPE_DECLARATIONS')) {
putenv('SYMFONY_PATCH_TYPE_DECLARATIONS=deprecations=1');
Expand Down
35 changes: 9 additions & 26 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
Expand Down Expand Up @@ -46,15 +46,15 @@
</exclude>
</groups>

<coverage>
<source ignoreSuppressionOfDeprecations="true">
<include>
<directory>./src/Symfony/</directory>
</include>
<exclude>
<directory>./src/Symfony/Bridge/*/Tests</directory>
<directory>./src/Symfony/Component/*/Tests</directory>
<directory>./src/Symfony/Component/*/*/Tests</directory>
<directory>./src/Symfony/Contract/*/Tests</directory>
<directory>./src/Symfony/Contracts/*/Tests</directory>
<directory>./src/Symfony/Bundle/*/Tests</directory>
<directory>./src/Symfony/Bundle/*/Resources</directory>
<directory>./src/Symfony/Component/*/Resources</directory>
Expand All @@ -65,28 +65,11 @@
<directory>./src/Symfony/Component/*/*/vendor</directory>
<directory>./src/Symfony/Contracts/*/vendor</directory>
</exclude>
</coverage>
</source>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
<arguments>
<array>
<element key="time-sensitive">
<array>
<element key="0"><string>Cache\IntegrationTests</string></element>
<element key="1"><string>Symfony\Bridge\Doctrine\Middleware\Debug</string></element>
<element key="2"><string>Symfony\Bridge\Doctrine\Middleware\IdleConnection</string></element>
<element key="3"><string>Symfony\Component\Cache</string></element>
<element key="4"><string>Symfony\Component\Cache\Tests\Fixtures</string></element>
<element key="5"><string>Symfony\Component\Cache\Tests\Traits</string></element>
<element key="6"><string>Symfony\Component\Cache\Traits</string></element>
<element key="7"><string>Symfony\Component\Console</string></element>
<element key="8"><string>Symfony\Component\HttpFoundation</string></element>
<element key="9"><string>Symfony\Component\Uid</string></element>
</array>
</element>
</array>
</arguments>
</listener>
</listeners>
<extensions>
<bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension">
<parameter name="clock-mock-namespaces" value="Cache\IntegrationTests,Symfony\Bridge\Doctrine\Middleware\Debug,Symfony\Bridge\Doctrine\Middleware\IdleConnection,Symfony\Component\Cache,Symfony\Component\Cache\Tests\Fixtures,Symfony\Component\Cache\Tests\Traits,Symfony\Component\Cache\Traits,Symfony\Component\Console,Symfony\Component\HttpFoundation,Symfony\Component\Uid" />
</bootstrap>
</extensions>
</phpunit>
2 changes: 1 addition & 1 deletion 10000 src/Symfony/Bridge/Doctrine/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"symfony/dependency-injection": "^6.4|^7.0",
"symfony/doctrine-messenger": "^6.4|^7.0",
"symfony/expression-language": "^6.4|^7.0",
"symfony/form": "^6.4.6|^7.0.6",
"symfony/form": "^7.2",
"symfony/http-kernel": "^6.4|^7.0",
"symfony/lock": "^6.4|^7.0",
"symfony/messenger": "^6.4|^7.0",
Expand Down
26 changes: 8 additions & 18 deletions src/Symfony/Bridge/Doctrine/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
Expand All @@ -18,7 +17,7 @@
</testsuite>
</testsuites>

<coverage>
<source>
<include>
<directory>./</directory>
</include>
Expand All @@ -27,20 +26,11 @@
<directory>./Tests</directory>
<directory>./vendor</directory>
</exclude>
</coverage>
</source>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
<arguments>
<array>
<element key="time-sensitive">
<array>
<element key="0"><string>Symfony\Bridge\Doctrine\Middleware\Debug</string></element>
<element key="1"><string>Symfony\Bridge\Doctrine\Middleware\IdleConnection</string></element>
</array>
</element>
</array>
</arguments>
</listener>
</listeners>
<extensions>
<bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension">
<parameter name="clock-mock-namespaces" value="Symfony\Bridge\Doctrine\Middleware\Debug,Symfony\Bridge\Doctrine\Middleware\IdleConnection" />
</bootstrap>
</extensions>
</phpunit>
11 changes: 7 additions & 4 deletions src/Symfony/Bridge/Monolog/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
Expand All @@ -18,7 +17,7 @@
</testsuite>
</testsuites>

<coverage>
<source>
<include>
<directory>./</directory>
</include>
Expand All @@ -27,5 +26,9 @@
<directory>./Tests</directory>
<directory>./vendor</directory>
</exclude>
</coverage>
</source>

<extensions>
<bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension" />
</extensions>
</phpunit>
10 changes: 7 additions & 3 deletions src/Symfony/Bridge/PhpUnit/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
Expand All @@ -19,13 +19,17 @@
</testsuite>
</testsuites>

<coverage>
<source>
<include>
<directory>./</directory>
</include>
<exclude>
<directory>./Tests</directory>
<directory>./vendor</directory>
</exclude>
</coverage>
</source>

<extensions>
<bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension" />
</extensions>
</phpunit>
8 changes: 5 additions & 3 deletions src/Symfony/Bridge/PsrHttpMessage/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
"symfony/browser-kit": "^6.4|^7.0",
"symfony/config": "^6.4|^7.0",
"symfony/event-dispatcher": "^6.4|^7.0",
"symfony/framework-bundle": "^6.4|^7.0",
"symfony/http-kernel": "^6.4|^7.0",
"symfony/framework-bundle": "^6.4.13|^7.1.6",
"symfony/http-kernel": "^6.4.13|^7.1.6",
"symfony/runtime": "^6.4.13|^7.1.6",
"nyholm/psr7": "^1.1",
"php-http/discovery": "^1.15",
"psr/log": "^1.1.4|^2|^3"
Expand All @@ -36,7 +37,8 @@
},
"config": {
"allow-plugins": {
"php-http/discovery": false
"php-http/discovery": false,
"symfony/runtime": false
}
},
"autoload": {
Expand Down
10 changes: 7 additions & 3 deletions src/Symfony/Bridge/PsrHttpMessage/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
Expand All @@ -18,7 +18,7 @@
</testsuite>
</testsuites>

<coverage>
<source>
<include>
<directory>./</directory>
</include>
Expand All @@ -27,5 +27,9 @@
<directory>./Tests</directory>
<directory>./vendor</directory>
</exclude>
</coverage>
</source>

<extensions>
<bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension" />
</extensions>
</phpunit>
10 changes: 7 additions & 3 deletions src/Symfony/Bridge/Twig/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
Expand All @@ -18,7 +18,7 @@
</testsuite>
</testsuites>

<coverage>
<source>
<include>
<directory>./</directory>
</include>
Expand All @@ -27,5 +27,9 @@
<directory>./Tests</directory>
<directory>./vendor</directory>
</exclude>
</coverage>
</source>

<extensions>
<bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension" />
</extensions>
</phpunit>
10 changes: 7 additions & 3 deletions src/Symfony/Bundle/DebugBundle/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
Expand All @@ -18,7 +18,7 @@
</testsuite>
</testsuites>

<coverage>
<source>
<include>
<directory>./</directory>
</include>
Expand All @@ -27,5 +27,9 @@
<directory>./Tests</directory>
<directory>./vendor</directory>
</exclude>
</coverage>
</source>

<extensions>
<bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension" />
</extensions>
</phpunit>
Loading
0