From cb97437f43ee05e86111459310e2fa257923c3b0 Mon Sep 17 00:00:00 2001 From: Alexis Lefebvre Date: Sun, 10 Mar 2024 19:51:59 +0100 Subject: [PATCH] chore: remove annotations (2) --- .github/workflows/tests.yml | 5 ++--- doc/contributing.md | 16 +++++++++++++++- tests/Test/ConfigMysqlCacheDbTest.php | 4 +--- .../ConfigMysqlKeepDatabaseAndSchemaTest.php | 3 +-- tests/Test/ConfigMysqlTest.php | 3 +-- tests/Test/ConfigMysqlUrlTest.php | 3 +-- tests/Test/ConfigPgsqlTest.php | 3 +-- 7 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 33f0432c..02164f52 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -122,8 +122,7 @@ jobs: run: echo '127.0.0.1 mariadb postgres mongodb' | sudo tee -a /etc/hosts - name: Run tests - # In phpunit.xml.dist, tests annotated with "@group mysql" are excluded, revert this # Run tests twice to ensure that tests are idempotent even if database caching is enabled run: | - php ./vendor/bin/phpunit --testdox --exclude-group "" - php ./vendor/bin/phpunit --testdox --exclude-group "" + php ./vendor/bin/phpunit --testdox + php ./vendor/bin/phpunit --testdox diff --git a/doc/contributing.md b/doc/contributing.md index 9a49cc50..0af22774 100644 --- a/doc/contributing.md +++ b/doc/contributing.md @@ -18,10 +18,24 @@ Install the dependencies with composer: docker-compose exec php-fpm composer install ``` +Install the lowest dependencies with composer: + +```bash +docker-compose exec php-fpm composer update --prefer-lowest +``` + Now you can execute the tests with the following command: ```bash -docker-compose exec php-fpm ./vendor/bin/phpunit --exclude-group "" +docker-compose exec php-fpm ./vendor/bin/phpunit +``` + +## Delete the cache + +If you change the version of PHP or dependencies, the caches may cause issues, they can be deleted: + +```bash +docker-compose exec php-fpm bash -c "rm -rf tests/App*/var/cache/*" ``` ## Apply changes suggested by PHP-CS-Fixer diff --git a/tests/Test/ConfigMysqlCacheDbTest.php b/tests/Test/ConfigMysqlCacheDbTest.php index 7b3a03c8..fc400350 100644 --- a/tests/Test/ConfigMysqlCacheDbTest.php +++ b/tests/Test/ConfigMysqlCacheDbTest.php @@ -15,7 +15,6 @@ use Liip\Acme\Tests\App\Entity\User; use Liip\Acme\Tests\AppConfigMysqlCacheDb\AppConfigMysqlKernelCacheDb; -use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\PreserveGlobalState; /** @@ -25,8 +24,7 @@ * they are disabled by default (see phpunit.xml.dist). * * In order to run them, you have to set the MySQL connection - * parameters in the Tests/AppConfigMysql/config.yml file and - * add “--exclude-group ""” when running PHPUnit. + * parameters in the Tests/AppConfigMysql/config.yml file. * * Use Tests/AppConfigMysql/AppConfigMysqlKernelCacheDb.php instead of * Tests/App/AppKernel.php. diff --git a/tests/Test/ConfigMysqlKeepDatabaseAndSchemaTest.php b/tests/Test/ConfigMysqlKeepDatabaseAndSchemaTest.php index d4e853c3..573f9bc3 100644 --- a/tests/Test/ConfigMysqlKeepDatabaseAndSchemaTest.php +++ b/tests/Test/ConfigMysqlKeepDatabaseAndSchemaTest.php @@ -23,8 +23,7 @@ * they are disabled by default (see phpunit.xml.dist). * * In order to run them, you have to set the MySQL connection - * parameters in the Tests/AppConfigMysql/config.yml file and - * add “--exclude-group ""” when running PHPUnit. + * parameters in the Tests/AppConfigMysql/config.yml file. * * Use Tests/AppConfigMysqlKeepDatabaseAndSchema/AppConfigMysqlKernelKeepDatabaseAndSchema.php instead of * Tests/App/AppKernel.php. diff --git a/tests/Test/ConfigMysqlTest.php b/tests/Test/ConfigMysqlTest.php index 49b56745..1c3c771e 100644 --- a/tests/Test/ConfigMysqlTest.php +++ b/tests/Test/ConfigMysqlTest.php @@ -37,8 +37,7 @@ class_alias('\Doctrine\Persistence\ObjectManager', '\Doctrine\Common\Persistence * they are disabled by default (see phpunit.xml.dist). * * In order to run them, you have to set the MySQL connection - * parameters in the Tests/AppConfigMysql/config.yml file and - * add “--exclude-group ""” when running PHPUnit. + * parameters in the Tests/AppConfigMysql/config.yml file. * * Use Tests/AppConfigMysql/AppConfigMysqlKernel.php instead of * Tests/App/AppKernel.php. diff --git a/tests/Test/ConfigMysqlUrlTest.php b/tests/Test/ConfigMysqlUrlTest.php index 7fe89aeb..58fe6a9b 100644 --- a/tests/Test/ConfigMysqlUrlTest.php +++ b/tests/Test/ConfigMysqlUrlTest.php @@ -23,8 +23,7 @@ * they are disabled by default (see phpunit.xml.dist). * * In order to run them, you have to set the MySQL connection - * parameters in the Tests/AppConfigMysql/config.yml file and - * add “--exclude-group ""” when running PHPUnit. + * parameters in the Tests/AppConfigMysql/config.yml file. * * Use Tests/AppConfigMysql/AppConfigMysqlUrlKernel.php instead of * Tests/App/AppKernel.php. diff --git a/tests/Test/ConfigPgsqlTest.php b/tests/Test/ConfigPgsqlTest.php index 90e685e0..428f2f49 100644 --- a/tests/Test/ConfigPgsqlTest.php +++ b/tests/Test/ConfigPgsqlTest.php @@ -24,8 +24,7 @@ * they are disabled by default (see phpunit.xml.dist). * * In order to run them, you have to set the PostgreSQL connection - * parameters in the Tests/AppConfigPgsql/config.yml file and - * add “--exclude-group ""” when running PHPUnit. + * parameters in the Tests/AppConfigPgsql/config.yml file. * * Use Tests/AppConfigPgsql/AppConfigPgsqlKernel.php instead of * Tests/App/AppKernel.php.