Articles

February 1, 2021

Laravel Release Cycle Changes and Parallel Testing

Laravel team has recently announced that they are moving from a 6 month major release cycle to 12 month major release cycle. This is due to many users feeling that versions were being released frequently since adopting the *"semantic versioning"* standard even though the cycle speed stayed the same. And because of this decision, the team decided to backport parallel testing to Laravel 8, which was supposed to be a major feature of the Laravel 9 release. Developers like us can now enjoy the benefits of faster running tests as of Laravel 8.25! We can read the full announcement here: [Laravel: New Release Schedule](https://blog.laravel.com/updates-to-laravels-versioning-policy) Here's a preview of tests in one of my major projects before and after implementing parallel test. ![](https://marvinquezon.com/storage/uploads/145091824-3389044101205305-7161015109674589437-o.jpg) As you can see, that's about 50% increase in time it took to complete the entire test suite and more than 80% reduction on memory usage. I don't know about you but that is insane! You can read full details of the new feature here [Laravel: Parallel Testing Is Now Available](https://blog.laravel.com/laravel-parallel-testing-is-now-available)

January 7, 2021

TIL: When Filtering Tests..

TIL that you do not need the full class name (or the full method name) when filtering tests to run. I was working on some documentations writing today when I ran my tests with a mistyped `User` filter and to my surprise, it loaded and ran all tests with the word `User` on class names and methods. Below is how it looked like after I ran the command (some tests have been redacted).. ``` ➜ p2p git:(develop) ./vendor/bin/phpunit --filter=User PHPUnit 8.5.8 by Sebastian Bergmann and contributors. Batch Import Job (Tests\Unit\BatchImportJob) ✔ It belongs to a user Company (Tests\Unit\Company) ✔ It belongs to many users Contract (Tests\Unit\Contract) ✔ It belongs to many users Media Security Check (Tests\Unit\MediaSecurityCheck) ✔ It belongs to a user User Setting (Tests\Unit\UserSetting) ✔ It belongs to a supervisor ✔ It belongs to a user ✔ It belongs to a delegate Companies Deactivation (Tests\Feature\Admin\CompaniesDeactivation) ✔ Deactivating a company also deactivates its users User Change Password (Tests\Feature\Admin\UserChangePassword) ✔ Can change password of a user ✔ Can resend email password reset to user User Contracts (Tests\Feature\Admin\UserContracts) ✔ Can attach a contract to a user User Deactivations (Tests\Feature\Admin\UserDeactivations) ✔ Can deactivate a user ✔ Deactivated users cannot login ✔ Can reactivate a user User Export (Tests\Feature\Admin\UserExport) ✔ Can export users User Settings (Tests\Feature\Admin\UserSettings) ✔ Can update user settings Users (Tests\Feature\Client\Users) ✔ Can list all users ✔ Can get user details ✔ Can only get details of users in the same company User Filters (Tests\Feature\Filters\UserFilters) ✔ It can load user companies ✔ It can be filtered by company association User Picklists (Tests\Feature\Supplier\UserPicklists) ✔ Can update picklist Users (Tests\Feature\Supplier\Users) ✔ Can list all users [Some tests have been redacted] Time: 44.64 seconds, Memory: 86.50 MB OK (83 tests, 204 assertions) ```

January 13, 2020

Practical Testing Tips

Some small and practical testing tips from yours truly. 1. If your tests are not hitting the database, remove the `use RefreshDatabase` statement. This will greatly speed up your test as it won't run migrations. ``` class ExampleTest { use RefreshDatabase; ... } ``` 2. If you want to see details when you run your tests but don't want to use 3rd party printer package, you can utilize the `--testdox` flag in PHPUnit. This flag will show which test class and method is currently running. ``` phpunit --testdox ``` 3. Getting overwhelmed with too many errors when you run a group of tests or your entire test suite? Use the `--stop-on-failure` flag in PHPUnit. This will cause the test to stop on first occurence of failure. ``` phpunit --stop-on-failure ``` Happy testing!

Marvin Quezon · Copyright © 2026 · Privacy · Sitemap