mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-06-22 13:51:14 +00:00
[AZ-AUTODEV] Step 7 (Run Tests): smoke profile + green run
Add a fast integration profile so Step 7 (and future autodev re-entries) can verify the full stack in ~2 min instead of ~15 min, without losing access to the long-running coverage when needed. - TestRunMode.cs: smoke flag + tightened poll/timeout values. - Program.cs: env var INTEGRATION_TESTS_MODE / --smoke|--full CLI switch; smoke runs Tile + 200m region + simple route + ZIP route + Security; full keeps the existing sequence. - RegionTests / ExtendedRouteTests: read timeouts from TestRunMode instead of hardcoding 120/180/360. - docker-compose.tests.yml: forwards INTEGRATION_TESTS_MODE to the integration-tests container (default 'full'). - scripts/run-tests.sh: adds --unit-only / --smoke / --full flags, loads .env automatically, fails fast if GOOGLE_MAPS_API_KEY is missing. Step 7 result: all tests passed in 111.86 s wall-clock (35/35 unit + 5/5 smoke integration scenarios incl. SEC-01..04). Report saved to _docs/03_implementation/test_run_step7.md. State advanced to Step 8 (Refactor). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -59,7 +59,7 @@ public static class ExtendedRouteTests
|
||||
Console.WriteLine(" (This will take several minutes for 20 action points)");
|
||||
Console.WriteLine();
|
||||
|
||||
var finalRoute = await RouteTestHelpers.WaitForRouteReady(httpClient, routeId, 360, 3000);
|
||||
var finalRoute = await RouteTestHelpers.WaitForRouteReady(httpClient, routeId, TestRunMode.ExtendedRouteReadyTimeoutSeconds, 3000);
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Step 3: Verifying generated files");
|
||||
@@ -132,7 +132,7 @@ public static class ExtendedRouteTests
|
||||
Console.WriteLine(" (Service is processing regions SEQUENTIALLY to avoid API throttling)");
|
||||
Console.WriteLine();
|
||||
|
||||
var finalRoute = await RouteTestHelpers.WaitForRouteReady(httpClient, routeId, 180, 3000);
|
||||
var finalRoute = await RouteTestHelpers.WaitForRouteReady(httpClient, routeId, TestRunMode.RouteReadyTimeoutSeconds, 3000);
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Step 3: Verifying generated files including ZIP");
|
||||
|
||||
@@ -5,10 +5,22 @@ class Program
|
||||
static async Task<int> Main(string[] args)
|
||||
{
|
||||
var apiUrl = Environment.GetEnvironmentVariable("API_URL") ?? "http://api:8080";
|
||||
|
||||
var modeEnv = Environment.GetEnvironmentVariable("INTEGRATION_TESTS_MODE")?.Trim().ToLowerInvariant();
|
||||
var modeArg = args.FirstOrDefault(a => a.Equals("--smoke", StringComparison.OrdinalIgnoreCase) || a.Equals("--full", StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (modeArg != null)
|
||||
{
|
||||
TestRunMode.Smoke = modeArg.Equals("--smoke", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(modeEnv))
|
||||
{
|
||||
TestRunMode.Smoke = modeEnv == "smoke";
|
||||
}
|
||||
|
||||
Console.WriteLine("Starting Integration Tests");
|
||||
Console.WriteLine("=========================");
|
||||
Console.WriteLine($"API URL: {apiUrl}");
|
||||
Console.WriteLine($"API URL : {apiUrl}");
|
||||
Console.WriteLine($"Mode : {(TestRunMode.Smoke ? "smoke (fast subset, tightened timeouts)" : "full")}");
|
||||
Console.WriteLine();
|
||||
|
||||
using var httpClient = new HttpClient
|
||||
@@ -24,25 +36,14 @@ class Program
|
||||
Console.WriteLine("✓ API is ready");
|
||||
Console.WriteLine();
|
||||
|
||||
await TileTests.RunGetTileByLatLonTest(httpClient);
|
||||
|
||||
await RegionTests.RunRegionProcessingTest_200m_Zoom18(httpClient);
|
||||
|
||||
await RegionTests.RunRegionProcessingTest_400m_Zoom17(httpClient);
|
||||
|
||||
await RegionTests.RunRegionProcessingTest_500m_Zoom18(httpClient);
|
||||
|
||||
await BasicRouteTests.RunSimpleRouteTest(httpClient);
|
||||
|
||||
await BasicRouteTests.RunRouteWithRegionProcessingAndStitching(httpClient);
|
||||
|
||||
await ExtendedRouteTests.RunRouteWithTilesZipTest(httpClient);
|
||||
|
||||
await ComplexRouteTests.RunComplexRouteWithStitching(httpClient);
|
||||
await ComplexRouteTests.RunComplexRouteWithStitchingAndGeofences(httpClient);
|
||||
await ExtendedRouteTests.RunExtendedRouteEast(httpClient);
|
||||
|
||||
await SecurityTests.RunAll(httpClient);
|
||||
if (TestRunMode.Smoke)
|
||||
{
|
||||
await RunSmokeSuite(httpClient);
|
||||
}
|
||||
else
|
||||
{
|
||||
await RunFullSuite(httpClient);
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("=========================");
|
||||
@@ -59,6 +60,33 @@ class Program
|
||||
}
|
||||
}
|
||||
|
||||
static async Task RunSmokeSuite(HttpClient httpClient)
|
||||
{
|
||||
await TileTests.RunGetTileByLatLonTest(httpClient);
|
||||
await RegionTests.RunRegionProcessingTest_200m_Zoom18(httpClient);
|
||||
await BasicRouteTests.RunSimpleRouteTest(httpClient);
|
||||
await ExtendedRouteTests.RunRouteWithTilesZipTest(httpClient);
|
||||
await SecurityTests.RunAll(httpClient);
|
||||
}
|
||||
|
||||
static async Task RunFullSuite(HttpClient httpClient)
|
||||
{
|
||||
await TileTests.RunGetTileByLatLonTest(httpClient);
|
||||
|
||||
await RegionTests.RunRegionProcessingTest_200m_Zoom18(httpClient);
|
||||
await RegionTests.RunRegionProcessingTest_400m_Zoom17(httpClient);
|
||||
await RegionTests.RunRegionProcessingTest_500m_Zoom18(httpClient);
|
||||
|
||||
await BasicRouteTests.RunSimpleRouteTest(httpClient);
|
||||
await BasicRouteTests.RunRouteWithRegionProcessingAndStitching(httpClient);
|
||||
await ExtendedRouteTests.RunRouteWithTilesZipTest(httpClient);
|
||||
await ComplexRouteTests.RunComplexRouteWithStitching(httpClient);
|
||||
await ComplexRouteTests.RunComplexRouteWithStitchingAndGeofences(httpClient);
|
||||
await ExtendedRouteTests.RunExtendedRouteEast(httpClient);
|
||||
|
||||
await SecurityTests.RunAll(httpClient);
|
||||
}
|
||||
|
||||
static async Task WaitForApiReady(HttpClient httpClient, int maxRetries = 30)
|
||||
{
|
||||
for (int i = 0; i < maxRetries; i++)
|
||||
|
||||
@@ -112,7 +112,7 @@ public static class RegionTests
|
||||
|
||||
Console.WriteLine("Polling for region status updates...");
|
||||
RegionStatusResponse? finalStatus = null;
|
||||
int maxAttempts = 120;
|
||||
int maxAttempts = TestRunMode.RegionPollAttempts;
|
||||
|
||||
for (int i = 0; i < maxAttempts; i++)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace SatelliteProvider.IntegrationTests;
|
||||
|
||||
public static class TestRunMode
|
||||
{
|
||||
public static bool Smoke { get; set; }
|
||||
|
||||
public static int RegionPollAttempts => Smoke ? 45 : 120;
|
||||
|
||||
public static int RouteReadyTimeoutSeconds => Smoke ? 90 : 180;
|
||||
|
||||
public static int ExtendedRouteReadyTimeoutSeconds => Smoke ? 90 : 360;
|
||||
}
|
||||
Reference in New Issue
Block a user