[PR #8532] All CI runs are using the sqlite fallback connection instead of the expected driver #11046

Open
opened 2026-01-22 16:09:32 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/8532

State: closed
Merged: Yes


While writing a test for an unrelated issue, I noticed that the unit tests are not loading the expected database connection details. Regardless of the config file provided, the TestUtil class is providing the fallback sqlite driver.

As a result a) none of the code is being tested against other platforms and b) tests that rely on platform-specific features (e.g. pessimistic locking) are being skipped on all builds.

It looks like this has been the case ever since the migration from Travis CI. Therefore some of the consistently-skipped tests are also not valid with phpunit 9 - e.g. Doctrine\Tests\ORM\Functional\Locking\LockTest has two tests that fail due to using ->assertContains with a string argument, which need to be upgraded to ->assertStringContainsString.

The root cause is that when the driver-specific phpunit.xml files were updated for github actions, the various tmpdb_type / tmpdb_username etc with the config for the privileged temporary connection were removed. It looks like this might be valid for doctrine/dbal because it falls back to using the main db params however the TestUtil class in doctrine/orm does not and it has a much stricter list of required parameters before it will use the specified driver.

  • Update test configuration to prove the issue and hard-fail if the job is not using the expected driver
  • Either reinstate the extra variables in the phpunit.xml files or update TestUtil to match the behaviour of the doctrine/dbal version
  • Identify tests that fail once the actual drivers are being used and fix (upgrade to phpunit 9) as required.

I can finish this off, but could you advise whether you'd prefer me to add the missing vars to the phpunit.xml or update TestUtil to work as expected with the current configs?

**Original Pull Request:** https://github.com/doctrine/orm/pull/8532 **State:** closed **Merged:** Yes --- While writing a test for an unrelated issue, I noticed that the unit tests are not loading the expected database connection details. Regardless of the config file provided, the `TestUtil` class is providing the fallback sqlite driver. As a result a) none of the code is being tested against other platforms and b) tests that rely on platform-specific features (e.g. pessimistic locking) are being skipped on all builds. It looks like this has been the case ever since the migration from Travis CI. Therefore some of the consistently-skipped tests are also not valid with phpunit 9 - e.g. `Doctrine\Tests\ORM\Functional\Locking\LockTest` has two tests that fail due to using `->assertContains` with a string argument, which need to be upgraded to `->assertStringContainsString`. The root cause is that when the driver-specific phpunit.xml files were updated for github actions, the various `tmpdb_type` / `tmpdb_username` etc with the config for the privileged temporary connection were removed. It looks like this [might be valid for doctrine/dbal because it falls back to using the main db params](https://github.com/doctrine/dbal/blob/3.1.x/tests/TestUtil.php#L158) however the [TestUtil class in doctrine/orm does not](https://github.com/doctrine/orm/blob/2.8.x/tests/Doctrine/Tests/TestUtil.php#L162) and [it has a much stricter list of required parameters before it will use the specified driver](https://github.com/doctrine/orm/blob/2.8.x/tests/Doctrine/Tests/TestUtil.php#L162). * [x] Update test configuration to prove the issue and hard-fail if the job is not using the expected driver * [x] *Either* reinstate the extra variables in the phpunit.xml files *or* update TestUtil to match the behaviour of the doctrine/dbal version * [x] Identify tests that fail once the actual drivers are being used and fix (upgrade to phpunit 9) as required. I can finish this off, but could you advise whether you'd prefer me to add the missing vars to the phpunit.xml or update TestUtil to work as expected with the current configs?
admin added the pull-request label 2026-01-22 16:09:32 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#11046