Skip to content

Commit

Permalink
tests: add paratest permutation
Browse files Browse the repository at this point in the history
  • Loading branch information
nikophil committed Dec 10, 2024
1 parent f3d7341 commit 544a63d
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion phpunit
Original file line number Diff line number Diff line change
Expand Up @@ -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
### <<

Expand Down
30 changes: 30 additions & 0 deletions phpunit-paratest.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.4/phpunit.xsd"
bootstrap="tests/bootstrap.php"
colors="true"
failOnRisky="true"
failOnWarning="true"
cacheDirectory=".phpunit.cache">
<php>
<ini name="error_reporting" value="-1"/>
<server name="KERNEL_CLASS" value="Zenstruck\Foundry\Tests\Fixture\TestKernel"/>
<server name="SHELL_VERBOSITY" value="-1"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/>
</php>
<testsuites>
<testsuite name="zenstruck/foundry Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<source ignoreSuppressionOfDeprecations="true">
<include>
<directory>src</directory>
</include>
</source>
<extensions>
<bootstrap class="Zenstruck\Foundry\PHPUnit\FoundryExtension" />
<bootstrap class="DAMA\DoctrineTestBundle\PHPUnit\PHPUnitExtension" />
</extensions>
</phpunit>

0 comments on commit 544a63d

Please sign in to comment.