@@ -314,12 +314,12 @@ describe("qa cli runtime", () => {
314314 watchUrl : "http://127.0.0.1:43124" ,
315315 } ) ;
316316 runQaMultipass . mockResolvedValue ( {
317- outputDir : "/tmp/multipass" ,
318- reportPath : "/tmp/multipass/qa-suite-report.md" ,
319- summaryPath : "/tmp/multipass/qa-suite-summary.json" ,
320- hostLogPath : "/tmp/ multipass/multipass -host.log",
321- bootstrapLogPath : "/tmp/ multipass/multipass -guest-bootstrap.log",
322- guestScriptPath : "/tmp/ multipass/multipass -guest-run.sh",
317+ outputDir : suiteArtifactsDir ,
318+ reportPath : suiteReportPath ,
319+ summaryPath : suiteSummaryPath ,
320+ hostLogPath : path . join ( suiteArtifactsDir , " multipass-host.log") ,
321+ bootstrapLogPath : path . join ( suiteArtifactsDir , " multipass-guest-bootstrap.log") ,
322+ guestScriptPath : path . join ( suiteArtifactsDir , " multipass-guest-run.sh") ,
323323 vmName : "openclaw-qa-test" ,
324324 scenarioIds : [ "channel-chat-baseline" ] ,
325325 } ) ;
@@ -464,9 +464,7 @@ describe("qa cli runtime", () => {
464464 }
465465 } ) ;
466466
467- it ( "keeps direct-suite zero-work validation disabled with --allow-failures" , async ( ) => {
468- const priorExitCode = process . exitCode ;
469- process . exitCode = undefined ;
467+ it ( "rejects direct-suite zero-work summaries even with --allow-failures" , async ( ) => {
470468 const optionalScenario = {
471469 name : "Runtime tool fixture — image_generate" ,
472470 status : "skip" as const ,
@@ -490,14 +488,108 @@ describe("qa cli runtime", () => {
490488 } ) ,
491489 ) ;
492490
493- try {
494- await runQaSuiteCommand ( { repoRoot : "/tmp/openclaw-repo" , allowFailures : true } ) ;
495- expect ( process . exitCode ) . toBeUndefined ( ) ;
496- } finally {
497- process . exitCode = priorExitCode ;
498- }
491+ await expect (
492+ runQaSuiteCommand ( { repoRoot : "/tmp/openclaw-repo" , allowFailures : true } ) ,
493+ ) . rejects . toThrow ( "did not include any executed scenarios" ) ;
499494 } ) ;
500495
496+ it . each ( [
497+ { runner : "host" as const , summary : "missing" as const , expected : "Could not read QA summary" } ,
498+ {
499+ runner : "host" as const ,
500+ summary : "malformed" as const ,
501+ expected : "Could not parse QA summary" ,
502+ } ,
503+ {
504+ runner : "multipass" as const ,
505+ summary : "missing" as const ,
506+ expected : "Could not read QA summary" ,
507+ } ,
508+ {
509+ runner : "multipass" as const ,
510+ summary : "malformed" as const ,
511+ expected : "Could not parse QA summary" ,
512+ } ,
513+ {
514+ runner : "multipass" as const ,
515+ summary : "zero-work" as const ,
516+ expected : "did not include any executed scenarios" ,
517+ } ,
518+ ...( [ "host" , "flow" , "multipass" ] as const ) . flatMap ( ( runner ) => [
519+ {
520+ runner,
521+ summary : "required-skip" as const ,
522+ expected : "did not include any executed scenarios" ,
523+ } ,
524+ {
525+ runner,
526+ summary : "blocked" as const ,
527+ expected : "did not include any executed scenarios" ,
528+ } ,
529+ ] ) ,
530+ ] ) (
531+ "rejects $summary $runner summaries even with --allow-failures" ,
532+ async ( { runner, summary, expected } ) => {
533+ if ( summary === "missing" ) {
534+ await fs . rm ( suiteSummaryPath ) ;
535+ } else if ( summary === "malformed" ) {
536+ await fs . writeFile ( suiteSummaryPath , "{not-json" , "utf8" ) ;
537+ } else if ( summary === "zero-work" ) {
538+ await fs . writeFile (
539+ suiteSummaryPath ,
540+ JSON . stringify ( {
541+ counts : { total : 0 , passed : 0 , failed : 0 , skipped : 0 } ,
542+ scenarios : [ ] ,
543+ } ) ,
544+ "utf8" ,
545+ ) ;
546+ } else {
547+ await fs . writeFile (
548+ suiteSummaryPath ,
549+ JSON . stringify ( {
550+ counts : {
551+ total : 1 ,
552+ passed : 0 ,
553+ failed : 0 ,
554+ skipped : summary === "required-skip" ? 1 : 0 ,
555+ } ,
556+ scenarios : [
557+ {
558+ name : "Required channel scenario" ,
559+ status : summary === "required-skip" ? "skip" : "blocked" ,
560+ details : "Required transport unavailable" ,
561+ } ,
562+ ] ,
563+ } ) ,
564+ "utf8" ,
565+ ) ;
566+ }
567+ if ( runner === "host" || runner === "flow" ) {
568+ runQaSuite . mockResolvedValueOnce (
569+ runner === "flow"
570+ ? flowSuiteRuntimeResult ( {
571+ reportPath : suiteReportPath ,
572+ summaryPath : suiteSummaryPath ,
573+ } )
574+ : unifiedSuiteRuntimeResult ( {
575+ outputDir : suiteArtifactsDir ,
576+ reportPath : suiteReportPath ,
577+ summaryPath : suiteSummaryPath ,
578+ evidencePath : suiteEvidencePath ,
579+ } ) ,
580+ ) ;
581+ }
582+
583+ await expect (
584+ runQaSuiteCommand ( {
585+ repoRoot : "/tmp/openclaw-repo" ,
586+ ...( runner === "multipass" ? { runner } : { } ) ,
587+ allowFailures : true ,
588+ } ) ,
589+ ) . rejects . toThrow ( expected ) ;
590+ } ,
591+ ) ;
592+
501593 it ( "rejects host-only resource options for Playwright scenarios" , async ( ) => {
502594 await expect (
503595 runQaSuiteCommand ( {
0 commit comments