-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
[11.x] Test Improvements #52139
[11.x] Test Improvements #52139
Conversation
Signed-off-by: Mior Muhammad Zaki <[email protected]>
Signed-off-by: Mior Muhammad Zaki <[email protected]>
Signed-off-by: Mior Muhammad Zaki <[email protected]>
public function testSchemaDumpOnSqlite() | ||
{ | ||
if ($this->driver !== 'sqlite') { | ||
$this->markTestSkipped('Test requires a SQLite connection.'); | ||
} | ||
|
||
$connection = DB::connection('sqlite'); | ||
$connection->getSchemaBuilder()->createDatabase($connection->getConfig('database')); | ||
UserFactory::new()->create(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not equivalent to the database statements I had here previously, so now the sqlite_stat*
tables aren't actually created and this test will always pass even if those tables aren't being removed from dumps correctly. I'll fix it in a new PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our GitHub Actions doesn't test using persistent SQLite and only using :in-memory:
. so DB::connection('sqlite')
is not the correct usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, this test specifically needs a real database file. The dump file created by the test with your changes is empty, so it's not testing anything anymore.
While GitHub Actions can install
sqlite3
it still need to be added to WindowPATH
before we can runschema:dump
on Windows environment: