[AZ-357] AC-2 follow-up: populated-duplicates migration test

Closes the partial-coverage gap from batch 10. Adds two integration
tests in MigrationTests.cs:

- DedupeSqlCollapsesDuplicatesByLatestUpdatedAt_AZ357_AC2: seeds a
  session-scoped temp table with intentional 4-column duplicates
  (varying updated_at and id), runs the exact dedupe SQL from
  migration 012, asserts only the expected rows survive (newest
  updated_at wins; ties broken by largest id).
- NewUniqueConstraintExistsOnFourColumns_AZ357_AC2: queries
  pg_indexes against the live DB to assert idx_tiles_unique_location
  is a unique 4-column btree and excludes the version column.

Also wires Npgsql 9.0.2 into the integration-tests project, exposes
DB_CONNECTION_STRING + postgres healthcheck dependency to the test
container in docker-compose.tests.yml, and registers the new tests
in both smoke and full suites.

Implementation note: first attempt used CREATE TEMP TABLE
ON COMMIT DROP, which dropped the table immediately because each
Npgsql command runs in its own implicit transaction. Removed
ON COMMIT DROP — session-scoped temps are dropped on connection
close, which is what we want.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-11 00:45:24 +03:00
parent 581dff206e
commit 546ddb3e6c
5 changed files with 193 additions and 8 deletions
@@ -68,6 +68,7 @@ class Program
await ExtendedRouteTests.RunRouteWithTilesZipTest(httpClient);
await SecurityTests.RunAll(httpClient);
await StubAndErrorContractTests.RunAll(httpClient);
await MigrationTests.RunAll();
}
static async Task RunFullSuite(HttpClient httpClient)
@@ -87,6 +88,7 @@ class Program
await SecurityTests.RunAll(httpClient);
await StubAndErrorContractTests.RunAll(httpClient);
await MigrationTests.RunAll();
}
static async Task WaitForApiReady(HttpClient httpClient, int maxRetries = 30)