Skip to content

test: fix failed MigrationRunnerTest#6612

Merged
kenjis merged 1 commit intocodeigniter4:developfrom
kenjis:fix-MigrationRunnerTest-SQLite3-memory
Sep 30, 2022
Merged

test: fix failed MigrationRunnerTest#6612
kenjis merged 1 commit intocodeigniter4:developfrom
kenjis:fix-MigrationRunnerTest-SQLite3-memory

Conversation

@kenjis
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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