@@ -47,17 +47,23 @@ describe("Dockerfile", () => {
4747 expect ( compose ) . not . toContain ( "127.0.0.1:18789/healthz" ) ;
4848 } ) ;
4949
50- it ( "uses the authenticated gateway health command in Compose guidance and proof " , async ( ) => {
50+ it ( "executes the documented Compose health command and validates JSON envelopes " , async ( ) => {
5151 const docs = await readFile ( dockerInstallDocsPath , "utf8" ) ;
5252 const composeSetup = await readFile ( composeSetupScriptPath , "utf8" ) ;
5353 const gatewayHealthCommand =
5454 'node dist/index.js gateway health --token "$OPENCLAW_GATEWAY_TOKEN"' ;
5555
5656 expect ( docs ) . toContain ( `docker compose exec openclaw-gateway sh -lc '${ gatewayHealthCommand } '` ) ;
5757 expect ( docs ) . not . toContain ( 'node dist/index.js health --token "$OPENCLAW_GATEWAY_TOKEN"' ) ;
58+ expect ( composeSetup ) . toContain (
59+ `"\${COMPOSE[@]}" exec -T openclaw-gateway sh -lc '${ gatewayHealthCommand } '` ,
60+ ) ;
5861 expect ( composeSetup . match ( / g a t e w a y h e a l t h - - t o k e n " \$ T O K E N " - - j s o n / g) ) . toHaveLength ( 2 ) ;
5962 expect ( composeSetup ) . toContain ( 'assert_gateway_health_json "gateway service"' ) ;
6063 expect ( composeSetup ) . toContain ( 'assert_gateway_health_json "CLI sidecar"' ) ;
64+ expect ( composeSetup ) . toContain ( '--detail "gateway:documentedHealthCommand=passed"' ) ;
65+ expect ( composeSetup ) . toContain ( '--detail "gateway:healthJsonEnvelope=passed"' ) ;
66+ expect ( composeSetup ) . toContain ( '--detail "cli:healthJsonEnvelope=passed"' ) ;
6167 expect ( composeSetup ) . not . toContain ( 'dist/index.js health --token "$TOKEN"' ) ;
6268 expect ( composeSetup ) . toContain ( '-v "$PROJECT_DIR:/target"' ) ;
6369 expect ( composeSetup ) . toContain ( "rm -rf /target/* /target/.[!.]* /target/..?*" ) ;
0 commit comments