mirror of
https://github.com/pestphp/pest.git
synced 2026-07-21 17:10:03 +02:00
81eacd79fd
- keep table/Inertia/database link-tracking alive in piggyback-coverage recording, and merge link-only edges into the piggybacked edge set - route migration changes through the watch-pattern fallback when the graph has no recorded table usage - re-run cached failures whose test file cannot be located, downgrading filtered runs to full replay instead of silently skipping them - align non-filtered replay with the failOn*/displayDetailsOn* rerun policy - resolve anonymous index Blade components (<x-card> from card/index.blade.php) and stop swallowing components whose static usage walk selected no tests - parse CTE/REPLACE queries and schema-qualified identifiers in TableExtractor - scope-filter the xdebug recording path like pcov - ignore in-flight .tmp files in FileState::keysWithPrefix and delete unreadable worker partials - vite deps helper: resolve rolldown through rolldown-vite installs and degrade gracefully, honour vite.config resolve.alias (incl. the laravel-vite-plugin '@' default), resolve .vue/.svelte/.mts/.cts extensions, and stop memoizing cycle-tainted transitive sets Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
43 lines
1.3 KiB
PHP
43 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Pest\Plugins\Tia\FileState;
|
|
|
|
beforeEach(function (): void {
|
|
$this->root = sys_get_temp_dir().'/pest-tia-file-state-'.bin2hex(random_bytes(4));
|
|
mkdir($this->root, 0755, true);
|
|
});
|
|
|
|
afterEach(function (): void {
|
|
foreach (glob($this->root.'/*') ?: [] as $file) {
|
|
@unlink($file);
|
|
}
|
|
|
|
@rmdir($this->root);
|
|
});
|
|
|
|
describe('keysWithPrefix()', function (): void {
|
|
it('lists keys matching the prefix', function (): void {
|
|
$state = new FileState($this->root);
|
|
$state->write('worker-edges-a.json', '{}');
|
|
$state->write('worker-edges-b.json', '{}');
|
|
$state->write('worker-results-a.json', '{}');
|
|
|
|
$keys = $state->keysWithPrefix('worker-edges-');
|
|
sort($keys);
|
|
|
|
expect($keys)->toBe(['worker-edges-a.json', 'worker-edges-b.json']);
|
|
});
|
|
|
|
it('ignores in-flight temporary files from concurrent writes', function (): void {
|
|
$state = new FileState($this->root);
|
|
$state->write('worker-edges-a.json', '{}');
|
|
|
|
// Simulate another process mid-write: its temp file exists but has not been renamed yet.
|
|
file_put_contents($this->root.'/worker-edges-b.json.'.bin2hex(random_bytes(4)).'.tmp', '{');
|
|
|
|
expect($state->keysWithPrefix('worker-edges-'))->toBe(['worker-edges-a.json']);
|
|
});
|
|
});
|