@@ -1202,6 +1202,61 @@ grep -qx -- "OPENCLAW_E2E_COMMAND_TIMEOUT=23s" "$TMPDIR/package-args"
12021202 ) ;
12031203 } ) ;
12041204
1205+ it ( "keeps append-only mock E2E state under per-run scratch roots" , ( ) => {
1206+ const scripts = [
1207+ {
1208+ path : "scripts/e2e/lib/release-typed-onboarding/scenario.sh" ,
1209+ scratch :
1210+ 'scenario_tmp="$(mktemp -d "${TMPDIR:-/tmp}/openclaw-release-typed-onboarding.XXXXXX")"' ,
1211+ requestLog : 'MOCK_REQUEST_LOG="$scenario_tmp/openai-requests.jsonl"' ,
1212+ removed : [ "/tmp/openclaw-release-typed-onboarding-openai.jsonl" ] ,
1213+ } ,
1214+ {
1215+ path : "scripts/e2e/lib/release-user-journey/scenario.sh" ,
1216+ scratch :
1217+ 'scenario_tmp="$(mktemp -d "${TMPDIR:-/tmp}/openclaw-release-user-journey.XXXXXX")"' ,
1218+ requestLog : 'MOCK_REQUEST_LOG="$scenario_tmp/openai-requests.jsonl"' ,
1219+ extraState : 'CLICKCLACK_STATE="$scenario_tmp/clickclack.json"' ,
1220+ removed : [
1221+ "/tmp/openclaw-release-user-journey-openai.jsonl" ,
1222+ "/tmp/openclaw-release-user-journey-clickclack.json" ,
1223+ ] ,
1224+ } ,
1225+ {
1226+ path : RELEASE_UPGRADE_USER_JOURNEY_SCENARIO_PATH ,
1227+ scratch :
1228+ 'scenario_tmp="$(mktemp -d "${TMPDIR:-/tmp}/openclaw-release-upgrade-user-journey.XXXXXX")"' ,
1229+ requestLog : 'MOCK_REQUEST_LOG="$scenario_tmp/openai-requests.jsonl"' ,
1230+ extraState : 'CLICKCLACK_STATE="$scenario_tmp/clickclack.json"' ,
1231+ removed : [
1232+ "/tmp/openclaw-release-upgrade-user-journey-openai.jsonl" ,
1233+ "/tmp/openclaw-release-upgrade-user-journey-clickclack.json" ,
1234+ ] ,
1235+ } ,
1236+ {
1237+ path : NPM_ONBOARD_CHANNEL_AGENT_DOCKER_E2E_PATH ,
1238+ scratch :
1239+ 'scenario_tmp="$(mktemp -d "${TMPDIR:-/tmp}/openclaw-npm-onboard-channel-agent.XXXXXX")"' ,
1240+ requestLog : 'MOCK_REQUEST_LOG="$scenario_tmp/mock-openai-requests.jsonl"' ,
1241+ removed : [ "/tmp/openclaw-mock-openai-requests.jsonl" ] ,
1242+ } ,
1243+ ] ;
1244+
1245+ for ( const { path, scratch, requestLog, extraState, removed } of scripts ) {
1246+ const script = readFileSync ( path , "utf8" ) ;
1247+
1248+ expect ( script , path ) . toContain ( scratch ) ;
1249+ expect ( script , path ) . toContain ( requestLog ) ;
1250+ expect ( script , path ) . toContain ( 'rm -rf "$scenario_tmp"' ) ;
1251+ if ( extraState ) {
1252+ expect ( script , path ) . toContain ( extraState ) ;
1253+ }
1254+ for ( const stalePath of removed ) {
1255+ expect ( script , path ) . not . toContain ( stalePath ) ;
1256+ }
1257+ }
1258+ } ) ;
1259+
12051260 it ( "kills timed Docker scenario runners after the grace period" , ( ) => {
12061261 const multiNode = readFileSync ( MULTI_NODE_UPDATE_DOCKER_E2E_PATH , "utf8" ) ;
12071262 const upgradeSurvivor = readFileSync ( UPGRADE_SURVIVOR_DOCKER_E2E_PATH , "utf8" ) ;
0 commit comments