-
Notifications
You must be signed in to change notification settings - Fork 25
[Question] Plans for adding support for PostgreSQL? #137
Comments
Hi @tomasnorre, I'm not aware of any issues with PostgreSQL yet. Would you mind to check if there is an issue with Doctrine itself (see #136) and add an information about your TYPO3 and testing-framework versions. |
Hi @IchHabRecht Sure will see what I can figure out. As mentioned, can be that I jumped to the conclusion to fast. I'll update here when have more information. TYPO3: 10.4.18 |
I haven't found out the problem yet. If I add the database manually myself, my tests runs into this problem.
Commenting out the I'll keep looking into this. Running my tests with the |
Just did a small "poc" for the Update: I don't find any differences in the tests run, besides that Nimut tests are through parallel. Both a using the Reproducible with following commands: $ php -v
PHP 7.4.22 (cli) (built: Jul 30 2021 13:08:36) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.22, Copyright (c), by Zend Technologies
with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
$ docker run --tmpfs=/data -e PGDATA=/data -e POSTGRES_USER=root -e POSTGRES_PASSWORD=root -d -p 5432:5432 postgres:10
$ composer install
$ find '.Build/public/typo3conf/ext/testbase/Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo "Running functional test suite {}"; typo3DatabaseDriver=pdo_pgsql .Build/bin/phpunit -c res/Configuration/FunctionalTests.xml {}'; 1) Nimut\Testbase\Tests\Functional\TestSystem\TestSystemTest::databaseExceptionContainsErrorMessage
Failed asserting that exception of type "Doctrine\DBAL\Exception\DriverException" matches expected exception
RuntimeException". Message was: "An exception occurred while executing 'SET SESSION sql_mode =
STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY';':
SQLSTATE[42704]: Undefined object: 7 ERROR: unrecognized configuration parameter "sql_mode"" at
testing-framework/.Build/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18
testing-framework/.Build/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:58
testing-framework/.Build/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1520
testing-framework/.Build/public/typo3/sysext/core/Classes/Database/Connection.php:107
testing-framework/.Build/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1938
testing-framework/.Build/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1276
testing-framework/.Build/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1028
testing-framework/.Build/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php:120
testing-framework/.Build/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php:1063
testing-framework/.Build/public/typo3/sysext/core/Classes/Database/Schema/ConnectionMigrator.php:218
testing-framework/.Build/public/typo3/sysext/core/Classes/Database/Schema/ConnectionMigrator.php:142
testing-framework/.Build/public/typo3/sysext/core/Classes/Database/Schema/SchemaMigrator.php:178
testing-framework/src/TestingFramework/TestSystem/AbstractTestSystem.php:526
testing-framework/src/TestingFramework/TestSystem/AbstractTestSystem.php:149
testing-framework/src/TestingFramework/TestCase/AbstractFunctionalTestCase.php:202
testing-framework/tests/Packages/testbase/Tests/Functional/TestSystem/TestSystemTest.php:64 |
Hi @tomasnorre, Please try to include following configuration into your function test case:
The initial DB configuration was commented in the typo3 testing-framework due to another bug. |
Will try it out. That would probably solve my Added: |
If updating https://github.com/Nimut/testing-framework/blob/main/src/TestingFramework/TestSystem/AbstractTestSystem.php#L672 to if ($databaseDriver === 'pdo_sqlite') {
$originalConfigurationArray['DB']['Connections']['Default']['path'] = $this->systemPath . 'test.sqlite';
$originalConfigurationArray['DB']['Connections']['Default']['initCommands'] = '';
}
+ if ($databaseDriver === 'pdo_pgsql') {
+ $originalConfigurationArray['SYS']['setDBinit'] = '';
+ $originalConfigurationArray['DB']['Connections']['Default']['initCommands'] = '';
+} Then the Tests are running with PostgreSQL too. |
Hi.
Are there any plans for adding support for PostgreSQL.
When running my tests for the TYPO3 Crawler with
typo3DatabaseDriver=pdo_pgsql
I get the error:FATAL: database "typo3test_ft027f169" does not exist
if I switch to the typo3/testing-framework the DB is created as expected.Might be that I jumped to the wrong conclusion here, but looks to me that it's supported.
I have limited knowledge on PostgreSQL, but if I can help in any way getting this added, let me know.
The text was updated successfully, but these errors were encountered: