[AZ-1074] [AZ-1075] gRPC tile stream tests and shared proto
ci/woodpecker/push/01-test Pipeline failed
ci/woodpecker/push/02-build-push unknown status

Extract tile_provision.proto into GrpcContracts, add integration
tests and validation hardening for DeliverRouteTiles streaming.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-06-25 10:04:41 +03:00
parent 275ee1b554
commit 7633134a8a
20 changed files with 725 additions and 26 deletions
@@ -15,6 +15,28 @@ namespace SatelliteProvider.Tests;
public class RouteTileDeliveryOrchestratorTests
{
[Fact]
public async Task DeliverAsync_InvalidLatitude_Throws()
{
var expander = new RouteTileExpander(
new RoutePointGraphBuilder(Options.Create(new ProcessingConfig { MaxRoutePointSpacingMeters = 200 })),
new GeofenceGridCalculator());
var orchestrator = CreateOrchestrator(expander, Mock.Of<ITileRepository>(), Mock.Of<ITileService>());
var job = new RouteTileDeliveryJob(
Guid.NewGuid(),
[(91.0, 37.0), (47.0, 37.0)],
400,
18,
[],
false,
[]);
var act = () => orchestrator.DeliverAsync(job, new RecordingSink(), CancellationToken.None);
await act.Should().ThrowAsync<ArgumentException>()
.WithMessage("*lat must be between -90 and 90*");
}
[Fact]
public async Task DeliverAsync_AllTilesSkippedByClient_EmitsManifestAndCompleteWithZeroDelivered()
{
@@ -160,6 +182,21 @@ public class RouteTileDeliveryOrchestratorTests
}
}
private static RouteTileDeliveryOrchestrator CreateOrchestrator(
RouteTileExpander expander,
ITileRepository tileRepo,
ITileService tileService)
{
return new RouteTileDeliveryOrchestrator(
expander,
tileRepo,
tileService,
Options.Create(new MapConfig { TileSizePixels = 256, AllowedZoomLevels = [18] }),
Options.Create(new ProcessingConfig { MaxConcurrentDownloads = 2 }),
Options.Create(new TileProvisionConfig { MaxTilesPerBatch = 100 }),
NullLogger<RouteTileDeliveryOrchestrator>.Instance);
}
private sealed class RecordingSink : IRouteTileDeliverySink
{
public (uint Total, uint Skipped, uint ToDeliver)? Manifest { get; private set; }