Skip to content

test: fix failed MigrationRunnerTest #6612

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

Merged

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Sep 30, 2022

Description
I don't know why GA check does not fail, but on my local environment the following test always fails.

There was 1 failure:

1) CodeIgniter\Database\Migrations\MigrationRunnerTest::testLoadsDefaultDatabaseWhenNoneSpecified Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'.../CodeIgniter4/writable/:memory:'
+':memory:'

.../CodeIgniter4/tests/system/Database/Migrations/MigrationRunnerTest.php:84

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [] Unit testing, with >80% coverage
  • [] User guide updated
  • Conforms to style guide

There was 1 failure:

1) CodeIgniter\Database\Migrations\MigrationRunnerTest::testLoadsDefaultDatabaseWhenNoneSpecified
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'.../CodeIgniter4/writable/:memory:'
+':memory:'

.../CodeIgniter4/tests/system/Database/Migrations/MigrationRunnerTest.php:84
@kenjis kenjis added the testing Pull requests that changes tests only label Sep 30, 2022
Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this didn't affect GA still 🤷‍♂️

@kenjis
Copy link
Member Author

kenjis commented Sep 30, 2022

I found the reason. Testing on GA uses a database file. Why not use in-memory database?

'database' => 'database.db',

@kenjis kenjis merged commit dcdaa43 into codeigniter4:develop Sep 30, 2022
@kenjis kenjis deleted the fix-MigrationRunnerTest-SQLite3-memory branch September 30, 2022 20:38
@MGatner
Copy link
Member

MGatner commented Oct 1, 2022

Not sure why we aren't using in-memory! It might speed things up a bit, though SQLites3 tests will never be our bottleneck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Pull requests that changes tests only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants