@@ -485,6 +485,47 @@ test "integration harness covers instance lifecycle endpoints" {
485485 }
486486}
487487
488+ test "integration harness covers lifecycle error paths" {
489+ {
490+ var server = try IntegrationServer .start (std .testing .allocator );
491+ defer server .deinit ();
492+
493+ const start_resp = try server .fetch (.{ .path = "/api/instances/nullboiler/missing/start" , .method = .POST });
494+ defer start_resp .deinit (std .testing .allocator );
495+ try std .testing .expectEqual (std .http .Status .not_found , start_resp .status );
496+ try std .testing .expect (std .mem .indexOf (u8 , start_resp .body , "not found" ) != null );
497+
498+ const stop_resp = try server .fetch (.{ .path = "/api/instances/nullboiler/missing/stop" , .method = .POST });
499+ defer stop_resp .deinit (std .testing .allocator );
500+ try std .testing .expectEqual (std .http .Status .not_found , stop_resp .status );
501+ try std .testing .expect (std .mem .indexOf (u8 , stop_resp .body , "not found" ) != null );
502+
503+ const restart_resp = try server .fetch (.{ .path = "/api/instances/nullboiler/missing/restart" , .method = .POST });
504+ defer restart_resp .deinit (std .testing .allocator );
505+ try std .testing .expectEqual (std .http .Status .not_found , restart_resp .status );
506+ try std .testing .expect (std .mem .indexOf (u8 , restart_resp .body , "not found" ) != null );
507+ }
508+
509+ {
510+ var server = try IntegrationServer .startWithSeed (std .testing .allocator , struct {
511+ fn call (srv : * IntegrationServer ) ! void {
512+ try seedManagedInstance (srv , "nullboiler" , "demo" );
513+ }
514+ }.call );
515+ defer server .deinit ();
516+
517+ const start_resp = try server .fetch (.{ .path = "/api/instances/nullboiler/demo/start" , .method = .POST });
518+ defer start_resp .deinit (std .testing .allocator );
519+ try std .testing .expectEqual (std .http .Status .internal_server_error , start_resp .status );
520+ try std .testing .expect (std .mem .indexOf (u8 , start_resp .body , "internal error" ) != null );
521+
522+ const restart_resp = try server .fetch (.{ .path = "/api/instances/nullboiler/demo/restart" , .method = .POST });
523+ defer restart_resp .deinit (std .testing .allocator );
524+ try std .testing .expectEqual (std .http .Status .internal_server_error , restart_resp .status );
525+ try std .testing .expect (std .mem .indexOf (u8 , restart_resp .body , "internal error" ) != null );
526+ }
527+ }
528+
488529test "integration harness covers orchestration proxy not configured" {
489530 var server = try IntegrationServer .start (std .testing .allocator );
490531 defer server .deinit ();
0 commit comments