Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Faster Laravel tests: restore a snapshot instead of running migrate:fresh

Laravel's RefreshDatabase runs migrate:fresh once in every test process: every single-test run, every CI job and every --parallel worker. Refresher is an open-source drop-in replacement that does it once and reuses the result. How it works The first test process migrates (and seeds) the test database and saves it as a snapshot. Every process after that restores the snapshot, until a migration,…

Laravel's RefreshDatabase runs the migrate:fresh command in every test process, consuming valuable time. The Refresher open-source package offers a solution by saving and reusing the test database snapshot. After the first test process completes, subsequent processes restore the snapshot until a migration, seeder, or factory changes.

SQLite snapshots are file copies, while MySQL and MariaDB utilize mysqldump and the mysql client. To implement the snapshot feature, require the package via Composer, extend the Testcase class with the Refresher trait in Pest, and use the LazilyRefreshesWithRefresher trait in PHPUnit. Benchmark tests show significant improvements in test times - Pinkary (MySQL, 60 migrations) drops from 3.95 seconds to 1.87 seconds per test process, Filament Demo (SQLite, 37 migrations) reduces from 1.37 seconds to 1.18 seconds.

For better performance, limit to small schemas without seeders, as PostgreSQL is currently unsupported and in-memory SQLite still migrates in every process. Write seeders files, clear the cache manually with php artisan refresher:clear, and check out the documentation at urlshortly.com/VWOIO.

Rewritten by urgent.news; may contain errors — check the original.

Read the original at dev.to →

Report a problem with this story

More in Tech

Headless UI for Beginners: Accessible Components Without the Styling

Building a dropdown or a modal sounds simple until you try to do it properly. Keyboard navigation, focus trapping, screen reader announcements, closing on Escape — accessibility is a long checklist.

  • Headless UI provides accessible components without styling.
  • Implement dropdown using Menu, Menu.Button, Menu.Items, Menu.Item components.
  • Headless UI handles keyboard interactions automatically.

I let a script audit my own product copy — it caught three lies

I run a small store that sells digital kits for people running LLM agents — eval suites, ops runbooks, prompt libraries. Every product page makes claims: "62 prompts," "10 skills," "12 runbooks." Last…

  • Store owner wrote script to audit product copy
  • Found three instances of false claims in descriptions
  • Audit process compares numbers in copy to actual files

No Algorithm Lock-In: Why a Chronological On-Chain Feed Is Regulation-Proof by Design

Governments are moving to force social platforms to offer a chronological, non-algorithmic feed option. On iBird, chronology is not a compliance setting — it is the substrate.

  • iBird platform on Hedera offers chronological feed unaltered by algorithms
  • Each post includes consensus timestamp and immutable sequence number
  • Consensus layer ensures publicly verifiable, non-revocable chronological feed

Large log records in Dynatrace: limits, native support and best practices

A ticket lands: « the partner call is cut off halfway through in the logs ». You open the record and it simply stops. The payload crossed a limit somewhere.

  • Default log entry body limit is 10 MB for Grail path, 512 kB for Classic pipeline
  • API requests limited to 10 MB, batch over 16 MB after preprocessing results in HTTP 413 error
  • OpenPipeline expands record size limit to 16 MB, 50,000 attributes per log with 32 kB cap

More from Saturday 21 November →