From 544a63dd182835817bc683cec714705cf09e75af Mon Sep 17 00:00:00 2001 From: Nicolas PHILIPPE Date: Sun, 8 Dec 2024 17:53:17 +0100 Subject: [PATCH] tests: add paratest permutation --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ composer.json | 1 + phpunit | 2 +- phpunit-paratest.xml.dist | 30 ++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 phpunit-paratest.xml.dist diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f994b6213..ba6e86a02 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,6 +92,39 @@ jobs: run: ./phpunit shell: bash + test-with-paratest: + name: Test with paratest + runs-on: ubuntu-latest + env: + DATABASE_URL: 'mysql://root:root@localhost:3306/foundry?serverVersion=5.7.42' + MONGO_URL: '' + USE_DAMA_DOCTRINE_TEST_BUNDLE: 1 + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.4 + coverage: none + tools: flex + + - name: Install dependencies + uses: ramsey/composer-install@v2 + with: + dependency-versions: highest + composer-options: --prefer-dist + env: + SYMFONY_REQUIRE: 7.2.* + + - name: Set up MySQL + run: sudo /etc/init.d/mysql start + + - name: Test + run: vendor/bin/paratest --processes 1 --configuration phpunit-paratest.xml.dist + shell: bash + code-coverage: name: Code Coverage runs-on: ubuntu-latest diff --git a/composer.json b/composer.json index aec2e99e4..8522d235f 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8", + "brianium/paratest": "^6|^7", "dama/doctrine-test-bundle": "^7.0|^8.0", "doctrine/collections": "^1.7|^2.0", "doctrine/common": "^3.2", diff --git a/phpunit b/phpunit index d14150c04..b62d8710b 100755 --- a/phpunit +++ b/phpunit @@ -35,7 +35,7 @@ SHOULD_UPDATE_PHPUNIT=$(check_phpunit_version "${PHPUNIT_VERSION}") if [ "${SHOULD_UPDATE_PHPUNIT}" = "0" ]; then echo "ℹ️ Upgrading PHPUnit to ${PHPUNIT_VERSION}" - composer update "phpunit/phpunit:^${PHPUNIT_VERSION}" -W + composer update brianium/paratest "phpunit/phpunit:^${PHPUNIT_VERSION}" -W fi ### << diff --git a/phpunit-paratest.xml.dist b/phpunit-paratest.xml.dist new file mode 100644 index 000000000..189f603c3 --- /dev/null +++ b/phpunit-paratest.xml.dist @@ -0,0 +1,30 @@ + + + + + + + + + + + + tests + + + + + src + + + + + + +