test: validate M3 imports and locking on PostgreSQL
Add isolated PostgreSQL fixtures, two-session locking coverage, and a disposable remote Docker test runner. Correct the canonical-root fixture and document verified SQLite and PostgreSQL results.
This commit is contained in:
1 parent
9d277d9e72
commit
c1ef2ee97a
9 files changed
+420
-37
No files matched your search
@@ -27,7 +27,15 @@ final class RepositoryTest extends TestCase
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->pdo);
|
||||
unlink($this->database);
|
||||
RepositoryDatabase::cleanup($this->database);
|
||||
}
|
||||
|
||||
public function testSecondConnectionUsesTheMigratedDatabase(): void
|
||||
{
|
||||
$jobs = new PdoImportJobRepository($this->pdo);
|
||||
$job = $jobs->create('/shared', []);
|
||||
$other = new PdoImportJobRepository(RepositoryDatabase::connect($this->database));
|
||||
self::assertSame('/shared', $other->get($job)['source_path']);
|
||||
}
|
||||
|
||||
public function testCatalogGroupingAndFileLifecycle(): void
|
||||
@@ -126,7 +134,7 @@ final class RepositoryTest extends TestCase
|
||||
$catalog = new PdoCatalogRepository($this->pdo);
|
||||
$job = $jobs->create('/', [['source_path' => '/a', 'size' => 5, 'model_id' => null]]);
|
||||
$second = $jobs->create('/', []);
|
||||
$other = new PdoImportJobRepository(new PDO('sqlite:' . $this->database));
|
||||
$other = new PdoImportJobRepository(RepositoryDatabase::connect($this->database));
|
||||
self::assertSame($job, (int) $jobs->claimNext()['id']);
|
||||
self::assertSame($second, (int) $other->claimNext()['id']);
|
||||
self::assertNull($other->claimNext());
|
||||
|
||||
Reference in new issue
Block a user