| 337 | } |
| 338 | |
| 339 | function summarise(results) { |
| 340 | console.log(''); |
| 341 | console.log('==== Lifecycle test results ===='); |
| 342 | let failed = 0; |
| 343 | for (const r of results) { |
| 344 | const status = r.ok ? 'OK' : 'FAIL'; |
| 345 | console.log(`[${status}] ${r.name} (${path.basename(r.bundle)})`); |
| 346 | if (!r.ok) { |
| 347 | failed++; |
| 348 | if (r.reason) { |
| 349 | console.log(` reason: ${r.reason}`); |
| 350 | } |
| 351 | if (r.milestones) { |
| 352 | console.log(` milestones: cn1Initialized=${r.milestones.cn1Initialized} cn1Started=${r.milestones.cn1Started}`); |
| 353 | if (r.milestones.parparError) { |
| 354 | console.log(` __parparError: ${r.milestones.parparError.substring(0, 300)}`); |
| 355 | } |
| 356 | } |
| 357 | if (r.firstFailure) { |
| 358 | console.log(` FIRST_FAILURE: ${JSON.stringify(r.firstFailure)}`); |
| 359 | } |
| 360 | if (r.pageError) { |
| 361 | console.log(` pageerror: ${r.pageError.substring(0, 300)}`); |
| 362 | } |
| 363 | if (r.lifecycle && r.lifecycle.length) { |
| 364 | console.log(` last lifecycle markers:`); |
| 365 | for (const line of r.lifecycle.slice(-6)) { |
| 366 | console.log(` ${line}`); |
| 367 | } |
| 368 | } else { |
| 369 | console.log(` (no PARPAR-LIFECYCLE markers — runtime never produced one)`); |
| 370 | } |
| 371 | } |
| 372 | } |
| 373 | return failed; |
| 374 | } |
| 375 | |
| 376 | async function main() { |
| 377 | const bundles = parseArgs(process.argv.slice(2)); |