Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL not configured right on Travis #43

Closed
mbabker opened this issue Aug 20, 2016 · 9 comments
Closed

MySQL not configured right on Travis #43

mbabker opened this issue Aug 20, 2016 · 9 comments

Comments

@mbabker
Copy link
Contributor

mbabker commented Aug 20, 2016

MySQL is not being configured right on Travis. At https://travis-ci.org/joomla-framework/database/jobs/153804058 the tests on the 378 / 626 line are part of the MySQLi iterator and are being skipped. Likewise, all the skips on the first line are the PDO MySQL driver.

// @photodude

@photodude
Copy link
Contributor

At a quick glance it looks like this issue occurred somewhere between the 1.3.0 release and the 1.4.0 release. Definitely showed up at Commit c5d21f8 even though that commit had no change to the mysql configuration, just the general travis CI build matrix.

Checking the verbose, I'm getting "There is no database driver" I'll see if I can dig into why travis is not realizing there is a database driver.

@photodude
Copy link
Contributor

photodude commented Aug 21, 2016

I suspect there is something not right with the removal of the PHPunit --configuration phpunit.travis.xml directive from .travis.yml

Unfortunately, my test to add it back stalled out at about 20% complete (on test Joomla\Database\Tests\DriverPgsqlTest::testRenameTable). but on the plus side, it did solve the skipped tests at the first line.

@photodude
Copy link
Contributor

photodude commented Aug 21, 2016

Possibly related issue uncovered during my tests

PHP Fatal error:  Call to protected method PHPUnit_Framework_TestCase::getMock() from context 'Joomla\Database\Tests\Mock\Driver' in /database/Tests/Mock/Driver.php on line 97
PHP Stack trace:
PHP   1. {main}() /database/vendor/phpunit/phpunit/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /database/vendor/phpunit/phpunit/phpunit:47
PHP   3. PHPUnit_TextUI_Command->run() /database/vendor/phpunit/phpunit/src/TextUI/Command.php:115
PHP   4. PHPUnit_TextUI_TestRunner->doRun() /database/vendor/phpunit/phpunit/src/TextUI/Command.php:185
PHP   5. PHPUnit_Framework_TestSuite->run() /database/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:465
PHP   6. PHPUnit_Framework_TestSuite->run() /database/vendor/phpunit/phpunit/src/Framework/TestSuite.php:753
PHP   7. PHPUnit_Framework_TestCase->run() /database/vendor/phpunit/phpunit/src/Framework/TestSuite.php:753
PHP   8. PHPUnit_Framework_TestResult->run() /database/vendor/phpunit/phpunit/src/Framework/TestCase.php:892
PHP   9. PHPUnit_Framework_TestCase->runBare() /database/vendor/phpunit/phpunit/src/Framework/TestResult.php:701
PHP  10. Joomla\Database\Tests\QueryMysqlTest->setUp() /database/vendor/phpunit/phpunit/src/Framework/TestCase.php:932
PHP  11. Joomla\Database\Tests\Mock\Driver::create() /database/Tests/QueryMysqlTest.php:119
Fatal error: Call to protected method Joomla\Database\Tests\QueryMysqlTest::getMock() from context 'Joomla\Database\Tests\Mock\Driver' in /database/Tests/Mock/Driver.php on line 106

@mbabker
Copy link
Contributor Author

mbabker commented Aug 21, 2016

Make sure you're on PHPUnit 4.8 thru 5.3. I blocked using PHPUnit 5.4+ until we can refactor tests in a bunch of packages to not use the "old" mock API.

@photodude
Copy link
Contributor

photodude commented Aug 21, 2016

after adding back the configuration xml and commenting out the pgsql Line, it Looks like Travis CI is running PHPUnit 5.5.2 on PHP 5.6+

@mbabker
Copy link
Contributor Author

mbabker commented Aug 21, 2016

https://travis-ci.org/photodude/database/builds

On your master branch it's because it's 36 commits behind.

@photodude
Copy link
Contributor

I'm permanently in a state of sleep deprivation... Didn't even notice that I edited the wrong branch.

Here is the correct branch showing the skipped test failures due to the missing configuration directive. https://travis-ci.org/photodude/database/builds/153948379

We'll have to figure out why the pgsql tests are stalling out.

@photodude
Copy link
Contributor

photodude commented Aug 21, 2016

I have tested a number of things but I have not found a way to get around the pgsql tests stalling.
https://travis-ci.org/photodude/database/builds/154001907

But since the issue is that MySQL is not configured correctly we just need to add --configuration phpunit.travis.xml directive back to .travis.yml and comment out the JTEST_DATABASE_PGSQL_DSN line to get the test configuration working again. https://travis-ci.org/photodude/database/jobs/154013963

That leaves Skipped: 104, Incomplete: 28. and reveals the following issues Errors: 2, Failures: 11,

There were 2 errors:
1) Joomla\Database\Tests\DriverPostgresqlTest::testExecute
Joomla\Database\Exception\ExecutionFailureException: 
SQL=INSERT INTO jos_dbtest
(title,start_date,description) VALUES 
('testTitle','1970-01-01','testDescription')
/database/src/Postgresql/PostgresqlDriver.php:819
/database/Tests/DriverPostgresqlTest.php:1131

2) Joomla\Database\Tests\DriverPostgresqlTest::testExecutePreparedStatement
Joomla\Database\Exception\ExecutionFailureException: 
SQL=INSERT INTO jos_dbtest
(title,start_date,description) VALUES 
($1, $2, $3)
/database/src/Postgresql/PostgresqlDriver.php:819
/database/Tests/DriverPostgresqlTest.php:1160

--
There were 11 failures:
1) Joomla\Database\Tests\DriverMysqlTest::testGetCollation
Line:146 The getCollation method should return the collation of the database.
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'utf8_general_ci'
+'utf8_unicode_ci'
/database/Tests/DriverMysqlTest.php:147
2) Joomla\Database\Tests\DriverMysqliTest::testGetCollation
Line:135 The getCollation method should return the collation of the database.
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'utf8_general_ci'
+'utf8_unicode_ci'
/database/Tests/DriverMysqliTest.php:136
3) Joomla\Database\Tests\IteratorMysqliTest::testForEach with data set #0 ('title', '#__dbtest', null, 'stdClass', 0, 0, array(stdClass Object (...), stdClass Object (...), stdClass Object (...), stdClass Object (...)), null)
136
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => stdClass Object (...)
     1 => stdClass Object (...)
     2 => stdClass Object (...)
     3 => stdClass Object (...)
+    4 => stdClass Object (...)
 )
/database/Tests/IteratorMysqliTest.php:137
4) Joomla\Database\Tests\IteratorMysqliTest::testForEach with data set #2 ('title', '#__dbtest', null, 'stdClass', 20, 2, array(stdClass Object (...), stdClass Object (...)), null)
136
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => stdClass Object (...)
     1 => stdClass Object (...)
+    2 => stdClass Object (...)
 )
/database/Tests/IteratorMysqliTest.php:137
5) Joomla\Database\Tests\IteratorMysqliTest::testForEach with data set #3 ('title, id', '#__dbtest', 'title', 'stdClass', 0, 0, array(stdClass Object (...), stdClass Object (...), stdClass Object (...), stdClass Object (...)), null)
136
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'Testing' => stdClass Object (...)
     'Testing2' => stdClass Object (...)
     'Testing3' => stdClass Object (...)
     'Testing4' => stdClass Object (...)
+    'testRollback' => stdClass Object (...)
 )
/database/Tests/IteratorMysqliTest.php:137
6) Joomla\Database\Tests\IteratorMysqliTest::testCount
153
Failed asserting that 5 matches expected 4.
/database/Tests/IteratorMysqliTest.php:154
7) Joomla\Database\Tests\IteratorPgsqlTest::testForEach with data set #0 ('title', '#__dbtest', null, 'stdClass', 0, 0, array(stdClass Object (...), stdClass Object (...), stdClass Object (...), stdClass Object (...)), null)
136
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => stdClass Object (
-        'title' => 'Testing'
+        'title' => 'testTitle'
     )
     1 => stdClass Object (
-        'title' => 'Testing2'
+        'title' => 'Testing'
     )
     2 => stdClass Object (
-        'title' => 'Testing3'
+        'title' => 'Testing2'
     )
     3 => stdClass Object (
-        'title' => 'Testing4'
+        'title' => 'Testing3'
     )
+    4 => stdClass Object (...)
 )
/database/Tests/IteratorPgsqlTest.php:137
8) Joomla\Database\Tests\IteratorPgsqlTest::testForEach with data set #1 ('title', '#__dbtest', null, 'stdClass', 2, 0, array(stdClass Object (...), stdClass Object (...)), null)
136
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => stdClass Object (
-        'title' => 'Testing'
+        'title' => 'testTitle'
     )
     1 => stdClass Object (
-        'title' => 'Testing2'
+        'title' => 'Testing'
     )
 )
/database/Tests/IteratorPgsqlTest.php:137
9) Joomla\Database\Tests\IteratorPgsqlTest::testForEach with data set #2 ('title', '#__dbtest', null, 'stdClass', 20, 2, array(stdClass Object (...), stdClass Object (...)), null)
136
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => stdClass Object (
-        'title' => 'Testing3'
+        'title' => 'Testing2'
     )
     1 => stdClass Object (
-        'title' => 'Testing4'
+        'title' => 'Testing3'
     )
+    2 => stdClass Object (...)
 )
/database/Tests/IteratorPgsqlTest.php:137
10) Joomla\Database\Tests\IteratorPgsqlTest::testForEach with data set #3 ('title, id', '#__dbtest', 'title', 'stdClass', 0, 0, array(stdClass Object (...), stdClass Object (...), stdClass Object (...), stdClass Object (...)), null)
136
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'Testing' => stdClass Object (...)
     'Testing2' => stdClass Object (...)
     'Testing3' => stdClass Object (...)
     'Testing4' => stdClass Object (...)
+    'testTitle' => stdClass Object (...)
 )
/database/Tests/IteratorPgsqlTest.php:137
11) Joomla\Database\Tests\IteratorPgsqlTest::testCount
153
Failed asserting that 5 matches expected 4.
/database/Tests/IteratorPgsqlTest.php:154

@photodude
Copy link
Contributor

I'm not sure which of these are all at the root of the pgsql issues, but I could get the rest of the tests to complete without stalling out after applying an @group and excluding these tests

  • DriverPostgresqlTest::testRenameTable
  • DriverPostgresqlTest::testTransactionStart
  • DriverPostgresqlTest::testTransactionCommit
  • DriverPostgresqlTest::testInsertObject
  • DriverPostgresqlTest::testGetVersion
  • DriverPostgresqlTest::testInsertid
  • DriverPgsqlTest::testGetVersion
  • DriverPgsqlTest::testInsertid
  • DriverPgsqlTest::testRenameTable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants