On 09/08/2011 11:51 AM, Lester Caine wrote:
Christopher Jones wrote:
For 5.4, there are still are a bunch of systematic failures on gcov
e.g. imap, pdo_firebird, pdo_odbc that need attention, along with less
obvious issues. Volunteers welcome.

I've asked a couple of times now about fixing the PDO tests, most of the 
pdo_firebird failures are due to different SQL formats which are actually not 
handled by PDO at all, so how do we fix a pdo test designed for one database 
when it fails in another?
The tests do seem to have driver specific elements, but that just make things 
more difficult to manage :(

The other question has to be which version of database the tests are being run 
against ... like MySQL some things have changed from older versions which is 
the reason for the interbase test failures. We DO need to think about a 
separate firebird version of
the driver, which is then used by pdo_firebird, since interbase gives different 
results to firebird nowadays. fbird_x versions of the functions have been 
aliases since the early days of PHP5 but now need to be a separate extension. 
Since interbase is a
licenced product not many of us even have a copy to run, so firebird is the 
more normal test base.


Lester,

File a bug and attach test patches that satisfy you (and run on gcov).
Or merge the patches yourself - but I'm not sure you have karma???
I've never heard of anyone else running these tests so your help would
be appreciated.  I won't sidetrack this thread with long term comments
about PDO or the PHP test infrastructure.  Let's work with what we
have access to.

For "generic" tests in ext/pdo/tests that should not run for Firebird,
update the SKIPIF section to skip them.  For example,
ext/pdo/tests/bug_43130.phpt doesn't run on sqlite, Postgres or Oracle
DB.  The SKIPIF includes:

    if (!strncasecmp(getenv('PDOTEST_DSN'), 'sqlite', strlen('sqlite'))) 
die('skip not relevant for sqlite driver');
    if (!strncasecmp(getenv('PDOTEST_DSN'), 'pgsql', strlen('pgsql'))) 
die('skip not relevant for pgsql driver');
    if (!strncasecmp(getenv('PDOTEST_DSN'), 'oci', strlen('oci'))) die('skip 
not relevant for oci driver - Hyphen is not legal for bind names in Oracle DB');

Other tests may need SQL tweaks.  For example bug_43139.phpt needs a
different query on Oracle:

    $from = '';
    if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'oci') {
            $from = 'from dual';
    }

    var_dump($db->query("select 0 as abc, 1 as xyz, 2 as def 
$from")->fetchAll(PDO::FETCH_GROUP));

If a test is important but fails on Firebird due to an extension bug,
then consider skipping it in pdo/tests and making a copy in
ext/pdo_firebird with an --XFAIL-- section that explains why the test
fails on Firebird.

For tests that need to cater for multiple Firebird or Interbase
versions, make multiple copies with different SKIPIFs.

Don't forget to verfiy the results with 5.3, 5.4 and trunk.

Chris

--
Email: christopher.jo...@oracle.com
Tel:  +1 650 506 8630
Blog:  http://blogs.oracle.com/opal/

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to