Skip to content

Commit

Permalink
Test with Maria DB (#882)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek authored Jun 13, 2021
1 parent 54cd831 commit 4f84ccf
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ jobs:
mysql:
image: mysql:8
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=atk4_pass -e MYSQL_USER=atk4_test -e MYSQL_PASSWORD=atk4_pass -e MYSQL_DATABASE=atk4_test__data --entrypoint sh mysql:8 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"
mariadb:
image: mariadb
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=atk4_pass -e MYSQL_USER=atk4_test -e MYSQL_PASSWORD=atk4_pass -e MYSQL_DATABASE=atk4_test__data
postgres:
image: postgres:12-alpine
env:
Expand Down Expand Up @@ -164,6 +167,10 @@ jobs:
if: startsWith(matrix.type, 'Phpunit')
run: "vendor/bin/phpunit --configuration phpunit-mysql.xml.dist \"$(if [ -n \"$LOG_COVERAGE\" ]; then echo '--coverage-text'; else echo '--no-coverage'; fi)\" -v"

- name: "Run tests: MariaDB (only for Phpunit)"
if: startsWith(matrix.type, 'Phpunit')
run: "vendor/bin/phpunit --configuration phpunit-mariadb.xml.dist \"$(if [ -n \"$LOG_COVERAGE\" ]; then echo '--coverage-text'; else echo '--no-coverage'; fi)\" -v"

- name: "Run tests: PostgreSQL (only for Phpunit)"
if: startsWith(matrix.type, 'Phpunit')
run: "vendor/bin/phpunit --configuration phpunit-pgsql.xml.dist \"$(if [ -n \"$LOG_COVERAGE\" ]; then echo '--coverage-text'; else echo '--no-coverage'; fi)\" -v"
Expand Down
26 changes: 26 additions & 0 deletions phpunit-mariadb.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<phpunit bootstrap="vendor/autoload.php" printerClass="Atk4\Core\AtkPhpunit\ResultPrinter" colors="true">
<php>
<var name="DB_DSN" value="mysql:dbname=atk4_test__data;host=mariadb" />
<var name="DB_USER" value="atk4_test" />
<var name="DB_PASSWD" value="atk4_pass" />
<var name="DB_DBNAME" value="atk4_test__data" />
</php>
<testsuites>
<testsuite name="tests">
<directory>tests</directory>
<directory>tests-schema</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="JohnKary\PHPUnit\Listener\SpeedTrapListener" />
</listeners>
<coverage>
<include>
<directory suffix=".php">src</directory>
<directory suffix=".php">src-schema</directory>
</include>
<report>
<php outputFile="build/logs/clover-mariadb.cov" />
</report>
</coverage>
</phpunit>

0 comments on commit 4f84ccf

Please sign in to comment.