So, we want to have PostgreSQL tested on Travis CI?! Nice try…
Part I - Flow
First of all, the compilation phase when “booting” with PostgreSQL already dies with an error. Not an easy ont to debug (partly because the DB is cleaned up right after the error happens). Anyway, a rather stupid one, fixed with (merged):
Now the tests actually start to run. The next one reminded me of a bug I had back in 2004 when working on DBAL, that also appeared as soon as I started to use PostgreSQL. I guess you do know that MySQL silently truncates data that won’t fit into a field? No? Now you do. And here is the modern incarnation of that bug, only affecting a test (that uses invalid data to begin with, merged):
Ok, next up is an error that is known behavior of Doctine ORM. The PersistenceTest, specifically commonObjectIsPersistedAndIsReconstituted() tests the behavior of the vanilla types Doctrine ORM supports, among them object. The object we assign in the test is Persistence\Fixtures\CommonObject, containing a protected property. Doctrine stores object as serialize()d PHP data in a text column. Which doesn’t work on PostgreSQL, since the string is truncated at the first null byte, used in the serialised data to mark the protected property. The official fix is to use a custom datatype if you need it, for the test I decided to skip it if on PostgreSQL (merged):
With this, the functional tests for the Flow framework pass on PostgreSQL. Getting the Neos functional tests to run is a different story. To be continued here… But first please give those PRs above a look.
Sounds reasonable to put it in next minor. If implementation was broken before anyway, you theoretically can’t break any existing project, except for the ones where people manually solved the issues, in which case I guess they are fit to properly take care of correctly upgrading.
The culprit with the json column type is, that it’s not sortable and thus cannot be used in a DISTINCT query. I did more tests and started to wonder where I observed this…
So, in 2.0 only the site export uses DISTINCT and is broken because of the json column type (and I mainly realized it’s broken because of functional tests).
That means, if we decide to leave site export broken for Neos 2.1, we do not need this particlar change in Flow 3.0 (but should still fix it in Flow 3.1 for Neos 2.1).