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

Bug: Database/Live tests fail #4336

Closed
kenjis opened this issue Feb 24, 2021 · 4 comments
Closed

Bug: Database/Live tests fail #4336

kenjis opened this issue Feb 24, 2021 · 4 comments
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@kenjis
Copy link
Member

kenjis commented Feb 24, 2021

Describe the bug
I don't know why three tests fails.
The table db_migrations is gone.

$ vendor/bin/phpunit tests/system/Database/Live/ --no-coverage
PHPUnit 9.5.2 by Sebastian Bergmann and contributors.

................................................S.S..S.........  63 / 197 ( 31%)
............................................................... 126 / 197 ( 63%)
............FFF................................................ 189 / 197 ( 95%)
........                                                        197 / 197 (100%)

Time: 00:29.795, Memory: 22.00 MB

There were 3 failures:

1) CodeIgniter\Database\Live\MetadataTest::testListTables
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => 'db_migrations'
-    1 => 'db_user'
-    2 => 'db_job'
-    3 => 'db_misc'
-    4 => 'db_type_test'
-    5 => 'db_empty'
-    6 => 'db_secondary'
-    7 => 'db_stringifypkey'
-    8 => 'db_without_auto_increment'
+    0 => 'db_user'
+    1 => 'db_job'
+    2 => 'db_misc'
+    3 => 'db_type_test'
+    4 => 'db_empty'
+    5 => 'db_secondary'
+    6 => 'db_stringifypkey'
+    7 => 'db_without_auto_increment'
 )

/Users/kenji/work/codeigniter/CodeIgniter4/tests/system/Database/Live/MetadataTest.php:46

2) CodeIgniter\Database\Live\MetadataTest::testListTablesConstrainPrefix
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => 'db_migrations'
-    1 => 'db_user'
-    2 => 'db_job'
-    3 => 'db_misc'
-    4 => 'db_type_test'
-    5 => 'db_empty'
-    6 => 'db_secondary'
-    7 => 'db_stringifypkey'
-    8 => 'db_without_auto_increment'
+    0 => 'db_user'
+    1 => 'db_job'
+    2 => 'db_misc'
+    3 => 'db_type_test'
+    4 => 'db_empty'
+    5 => 'db_secondary'
+    6 => 'db_stringifypkey'
+    7 => 'db_without_auto_increment'
 )

/Users/kenji/work/codeigniter/CodeIgniter4/tests/system/Database/Live/MetadataTest.php:55

3) CodeIgniter\Database\Live\MetadataTest::testConstrainPrefixIgnoresOtherTables
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => 'db_migrations'
-    1 => 'db_user'
-    2 => 'db_job'
-    3 => 'db_misc'
-    4 => 'db_type_test'
-    5 => 'db_empty'
-    6 => 'db_secondary'
-    7 => 'db_stringifypkey'
-    8 => 'db_without_auto_increment'
+    0 => 'db_user'
+    1 => 'db_job'
+    2 => 'db_misc'
+    3 => 'db_type_test'
+    4 => 'db_empty'
+    5 => 'db_secondary'
+    6 => 'db_stringifypkey'
+    7 => 'db_without_auto_increment'
 )

/Users/kenji/work/codeigniter/CodeIgniter4/tests/system/Database/Live/MetadataTest.php:86

FAILURES!
Tests: 197, Assertions: 419, Failures: 3, Skipped: 3.

CodeIgniter 4 version
develop branch.

Affected module(s)
Database tests

Expected behavior, and steps to reproduce if appropriate
All tests pass.

Context

  • OS: [macOS 10.15.7]
  • Web server [n/a]
  • PHP version [7.4.15]
@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Feb 24, 2021
@kenjis kenjis changed the title Bug: Database/Live tests fails Bug: Database/Live tests fail Feb 24, 2021
@paulbalandan
Copy link
Member

I think this is depending on the result of a previous test case.

@kenjis
Copy link
Member Author

kenjis commented Feb 25, 2021

Probably, but what is it?

Why db_migrations is missing?
If migrations go, the table is created.

And when I change test database from memory to sqlite file,
all tests pass.

@kenjis
Copy link
Member Author

kenjis commented Mar 17, 2021

I don't know why, but now the tests pass.

$ vendor/bin/phpunit tests/system/Database/Live/ --no-coverage
PHPUnit 9.5.2 by Sebastian Bergmann and contributors.

......................................................S.S..S...  63 / 222 ( 28%)
............................................................... 126 / 222 ( 56%)
............................................................... 189 / 222 ( 85%)
.................................                               222 / 222 (100%)

Time: 00:50.342, Memory: 26.00 MB

OK, but incomplete, skipped, or risky tests!
Tests: 222, Assertions: 445, Skipped: 3.

@kenjis
Copy link
Member Author

kenjis commented Mar 18, 2021

Both PHP 7.4.16 and PHP 7.3.27 are okay.

$ /usr/local/opt/php\@7.3/bin/php vendor/bin/phpunit tests/system/Database/Live/ --no-coverage
PHPUnit 9.5.2 by Sebastian Bergmann and contributors.

......................................................S.S..S...  63 / 222 ( 28%)
............................................................... 126 / 222 ( 56%)
............................................................... 189 / 222 ( 85%)
.................................                               222 / 222 (100%)

Time: 00:16.534, Memory: 24.00 MB

OK, but incomplete, skipped, or risky tests!
Tests: 222, Assertions: 445, Skipped: 3.

@paulbalandan If you pass the tests, close this issue, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

No branches or pull requests

2 participants