Fix some fragile tests for gitlab ci

This commit is contained in:
Timothy Warren 2016-07-19 14:18:48 -04:00
parent ae9dc46a17
commit 757b83797f
2 changed files with 15 additions and 24 deletions

View File

@ -64,22 +64,11 @@ class MySQLQBTest extends QBTest {
$res = $query->fetchAll(PDO::FETCH_ASSOC); $res = $query->fetchAll(PDO::FETCH_ASSOC);
$expected = array ( // The exact results are version dependent
array ( // The important thing is that there is an array
'id' => '1', // of results returned
'select_type' => 'SIMPLE', $this->assertTrue(is_array($res));
'table' => 'create_test', $this->assertTrue(count($res) > 1);
'type' => 'range', $this->assertTrue(array_key_exists('table', $res));
'possible_keys' => 'PRIMARY',
'key' => 'PRIMARY',
'key_len' => '4',
'ref' => NULL,
'rows' => '1',
'filtered' => '100.00',
'Extra' => 'Using where',
)
);
$this->assertEqual($expected, $res);
} }
} }

View File

@ -66,11 +66,6 @@ class PgSQLQBTest extends QBTest {
public function testQueryExplain() public function testQueryExplain()
{ {
if (getenv('CI'))
{
$this->markTestSkipped("Skip this test on CI, because the check is Postgres version dependent");
}
$query = self::$db->select('id, key as k, val') $query = self::$db->select('id, key as k, val')
->explain() ->explain()
->where('id >', 1) ->where('id >', 1)
@ -79,7 +74,14 @@ class PgSQLQBTest extends QBTest {
$res = $query->fetchAll(PDO::FETCH_ASSOC); $res = $query->fetchAll(PDO::FETCH_ASSOC);
$expected = array ( // The exact results are version dependent
// The important thing is that there is an array
// of results returned
$this->assertTrue(is_array($res));
$this->assertTrue(count($res) > 1);
$this->assertTrue(array_key_exists('QUERY PLAN', $res[0]));
/*$expected = array (
array ( array (
'QUERY PLAN' => 'Limit (cost=6.31..10.54 rows=2 width=68)', 'QUERY PLAN' => 'Limit (cost=6.31..10.54 rows=2 width=68)',
), ),
@ -103,7 +105,7 @@ class PgSQLQBTest extends QBTest {
), ),
); );
$this->assertEqual($expected, $res); $this->assertEqual($expected, $res);*/
} }
public function testBackupStructure() public function testBackupStructure()