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

Actions and Doctrine to Schema Changes #4

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

gangaiamaran
Copy link

@gangaiamaran gangaiamaran commented Aug 31, 2024

This PR contains the following updates:

Configured MySQL Service in GitHub Actions:

  • ✅ Integrated MySQL into the GitHub Actions CI pipeline to facilitate tests requiring a MySQL database.

Added Laravel 11 Actions Test Run Support:

  • ✅ Updated the CI configuration to include support for running tests against Laravel 11.

Enhanced Test Coverage:

  • ✅ Added new test cases, focusing on different integer types (tinyint) within the FindRiskyDatabaseColumns command to improve overall test coverage.

Next Steps

  • ⏳Plan to add more test cases
  • ⏳Support for PostgreSQL
  • ⏳Convert Doctrine to Schema for FindInvalidDatabaseValues

Action URL
image

Copy link
Member

@alies-dev alies-dev left a comment

Choose a reason for hiding this comment

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

Thank you a lot, @gangaiamaran for your contribution!

We planned to update this code to support Laravel 11, but you did it! I feel the power of the community! 💪 Great job on this PR. I left some notes for minor changes, please take a look.

Thank you!

@@ -218,4 +210,15 @@ private function formatBytes(int $size, int $precision): string
$suffix = $suffixes[$index];
return round(1024 ** ($base - floor($base)), $precision).$suffix;
}
protected function getTableSize($connection, string $table)
Copy link
Member

Choose a reason for hiding this comment

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

this is a final class, there is not a lot of sense in making this method protected. How about making it private? (and adding a return and param types)

Copy link
Author

@gangaiamaran gangaiamaran Sep 13, 2024

Choose a reason for hiding this comment

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

I agree. It would make more sense to change the method to private. I'll also add the return and parameter types as you suggested.
Thanks for the catch!

We can use Schema size instead of getTableSize()

image

@@ -17,4 +24,13 @@ protected function getPackageProviders($app): array
DatabaseToolkitServiceProvider::class,
];
}

protected function tearDown(): void
Copy link
Member

Choose a reason for hiding this comment

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

I like the idea! But I'm not sure we need this in the base TestCase class, because some tests (e.g. unit) may not need DB at all.

Copy link
Author

Choose a reason for hiding this comment

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

You're right, it's not necessary in the base TestCase class. I'll consider adding it only where needed.

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

Successfully merging this pull request may close these issues.

2 participants