@@ -204,6 +204,7 @@ def test_cloud_run_route_contracts_are_registered(self):
204204 module = load_module ()
205205
206206 self .assertIs (module .app ._routes [("/" , ("POST" , "GET" ))], module .handle_trigger )
207+ self .assertIs (module .app ._routes [("/run" , ("POST" , "GET" ))], module .handle_trigger )
207208 self .assertIs (
208209 module .app ._routes [("/backfill" , ("POST" , "GET" ))],
209210 module .handle_backfill ,
@@ -212,10 +213,24 @@ def test_cloud_run_route_contracts_are_registered(self):
212213 module .app ._routes [("/precheck" , ("POST" , "GET" ))],
213214 module .handle_precheck ,
214215 )
216+ self .assertIs (
217+ module .app ._routes [("/dry-run" , ("POST" , "GET" ))],
218+ module .handle_dry_run ,
219+ )
215220 self .assertIs (
216221 module .app ._routes [("/probe" , ("POST" , "GET" ))],
217222 module .handle_probe ,
218223 )
224+ self .assertIs (module .app ._routes [("/health" , ("GET" ,))], module .health )
225+
226+ def test_health_route_returns_ok (self ):
227+ module = load_module ()
228+
229+ with module .app .test_request_context ("/health" , method = "GET" ):
230+ body , status = module .health ()
231+
232+ self .assertEqual (status , 200 )
233+ self .assertEqual (body , "OK" )
219234
220235 def test_handle_trigger_runs_strategy (self ):
221236 module = load_module ()
@@ -356,6 +371,26 @@ def fake_run_strategy(*, force_run=False, validation_only=False, validation_labe
356371 self .assertTrue (observed ["validation_only" ])
357372 self .assertEqual (observed ["validation_label" ], "precheck" )
358373
374+ def test_handle_dry_run_alias_forces_strategy_dry_run (self ):
375+ module = load_module ()
376+ observed = {"force_run" : None , "validation_only" : None }
377+
378+ def fake_run_strategy (* , force_run = False , validation_only = False , validation_label = "backfill" ):
379+ observed ["force_run" ] = force_run
380+ observed ["validation_only" ] = validation_only
381+ observed ["validation_label" ] = validation_label
382+
383+ module .run_strategy = fake_run_strategy
384+
385+ with module .app .test_request_context ("/dry-run" , method = "POST" ):
386+ body , status = module .handle_dry_run ()
387+
388+ self .assertEqual (status , 200 )
389+ self .assertEqual (body , "Dry Run OK" )
390+ self .assertTrue (observed ["force_run" ])
391+ self .assertTrue (observed ["validation_only" ])
392+ self .assertEqual (observed ["validation_label" ], "precheck" )
393+
359394 def test_handle_probe_checks_account_snapshot_without_success_notification (self ):
360395 module = load_module ()
361396 observed = {"override" : None , "events" : [], "notifications" : []}
@@ -391,10 +426,10 @@ def build_notification_adapters(self):
391426 raise AssertionError ("probe success should stay silent" )
392427
393428 def load_strategy_plugin_signals (self , * _args , ** _kwargs ):
394- return (), None
429+ raise AssertionError ( "health probe should not load strategy plugins" )
395430
396431 def attach_strategy_plugin_report (self , * _args , ** _kwargs ):
397- return None
432+ raise AssertionError ( "health probe should not attach strategy plugin reports" )
398433
399434 module .build_composer = lambda * , dry_run_only_override = None : observed .__setitem__ ("override" , dry_run_only_override ) or FakeComposer ()
400435
@@ -442,10 +477,10 @@ def build_notification_adapters(self):
442477 return FakeNotifications ()
443478
444479 def load_strategy_plugin_signals (self , * _args , ** _kwargs ):
445- return (), None
480+ raise AssertionError ( "health probe should not load strategy plugins" )
446481
447482 def attach_strategy_plugin_report (self , * _args , ** _kwargs ):
448- return None
483+ raise AssertionError ( "health probe should not attach strategy plugin reports" )
449484
450485 module .build_composer = lambda * , dry_run_only_override = None : FakeComposer ()
451486
0 commit comments