PostgreSQL driver for Joomla! platform [clean version _ v2]. #961
Conversation
Without this check the row or object returned is always the first of result set.
JDatabaseExporterPostgresqlInspector .
database independent.
…ts about superclass' database-independent mock loading.
JoomlaDatabaseTestCase . Changed setUp to load config.php file and search JTestConfig instead of loading config_postgresql.php file and search JPostgresqlTestConfig. Using JDatabaseDriver::getInstance instead of JDatabase's one.
Changed getMockDatabase call to load PostgreSQL Mock class and not global one.
8.4 and 9.0 versions). Updated tests, actually it's possible to test older database version for exporter and importer class changing return value of 'getVersion' inside setup() call. To test older database for driver class, just install it.
JDatabaseQueryPostgresql only if requested by second argument. Use of getQuery() returning JDatabaseQueryPostgresql object is needed by insertid() call to properly work.
by JoomlaTestCase::getMockDatabase() in multidb environment without creating each JoomlaTestCase's extended classes for each database.
Unit testing complete. There were 25 failures and 16 errors from 2351 tests and 12252 assertions. |
any log ? |
Probably caused by still using mysql for the postgresql tests because config.php still has mysql as database driver selected. Before changing test config to postgresql driver, I got exactly the same error / failure counts. It would probably correct and consistent to use a separate config file like config_postgresql.php for postgresql tests and skip these tests when it is not present - like it is done for the other DBMS. If you still need logs, feel free to request them. |
you're right, but as you can see from this commit of previous pull 917 I've removed configuration file because someone told me inside mailing list to do this. Which are your test result after changing configuration to postgresql driver ? Thank you, |
Ok as I see now, that recently changed. On Thursday that was the case for mysql drivers. Now the testing architecture radically changed and you will probably have to adapt to the current head. Now, the DBMS specific config files seem to be gone. - at least I cannot find them at the moment. Running the junit tests on the checkout of Thursday, most errors are invalid date errors. Probably by not using "null date" but a hardcoded 0000-00-00 00:00:00. I might have a more detailed look at this when I have more spare time |
That hardcoded date were put inside Thank you, |
Hi Gabriele, I spent some time last night and rebased your branch over master, along with squashing all of your commits into one. In doing this I also moved things around quite a bit to line up with the current test scaffolding. We still have work to do generally on making the joomla testing tree more robust and such, but that is a much larger task. You can see my work here: https://github.com/LouisLandry/joomla-platform/compare/merging The one thing I didn't do was really test the PostgreSQL driver itself. I didn't have a postgres instance setup and didn't wanna go through that last night. Every other test case class passes completely though, and it is all lined up with how things are in the test tree now. You've done a masterful job with the postgresql support... well done. If you are OK with what I've done here, you could pull it down, make sure the driver tests are working (You'll need to uncomment the postgresql DSN string in We are very close. |
Hi Louis, Thank you for this job, I'll pull it and I'll do again tests, maybe I'll add importer and exporter test files for older database version (sublassing actual class and change mock's "getVersion" inside setUp). Query class doesn't change between versions and driver class can be tested on older version only running it. Have you solved problem with Eng. Gabriele Pongelli. |
Yes, I know it's frustrating. You had the unfortunate situation of coming in with this at a time when the database package was being re-thought/re-built and also the unit tests being reworked. Interestingly, the entire year before that part of the codebase was very stable and would have been easier to do probably. I don't know. Ultimately it is what it is, and hopefully we are in a better place moving forward. I'm not aware of a problem with the access package stub off the top of my head, but all the tests are running and passing for me now. |
I'm working on a branch coming from yours, test on Postgresql driver returns me OK . Eng. Gabriele Pongelli . |
Everything except the driver tests themselves (which actually connect to pgsql/mysql/etc) are in the main test suite: The driver test itself is at: |
OK, merged the other one. Thanks a ton. |
This driver implements inherited function from JDatabaseDriver class and add some other useful function to be able to use Joomla! on PostgreSQL database.
There is also a class that inherits from JDatabaseQuery to be able to create query object using PostgreSQL dialect.
These two classes are tested by other two classes under "test" folder.
PostgreSQL's added functions:
Overridden functions:
PostgreSQL database query added functions:
Added also Postgresql's exporter and importer classes and their test classes.