mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-11 21:57:14 +03:00
Preserve failed Live benchmark evidence
AI-assisted implementation under maintainer direction.
This commit is contained in:
@@ -97,6 +97,7 @@ try {
|
||||
progressive: delivery === 'progressive',
|
||||
progressiveDelayMs: delivery === 'progressive' ? simulatedTailMs : 0,
|
||||
atomicDelayMs: delivery === 'atomic' ? simulatedTailMs : 0,
|
||||
keepTmp: args.keepTmp === true || args.keepTmp === 'true',
|
||||
log: args.quiet ? () => {} : (message) => process.stderr.write(`[live-bench] ${message}\n`),
|
||||
});
|
||||
|
||||
@@ -247,8 +248,14 @@ try {
|
||||
run.acceptToNextGoDispatchMs = roundMs(performance.now() - acceptStartedAt);
|
||||
await nextFirstVariant;
|
||||
run.acceptToNextFirstVariantMs = roundMs(performance.now() - acceptStartedAt);
|
||||
await clickDiscard(session.page);
|
||||
await waitForReset(session.page);
|
||||
try {
|
||||
await clickDiscard(session.page);
|
||||
await waitForReset(session.page);
|
||||
run.followupCleanup = { ok: true };
|
||||
} catch (error) {
|
||||
run.followupCleanup = { ok: false, error: error?.message || String(error) };
|
||||
process.exitCode = 1;
|
||||
}
|
||||
} else {
|
||||
await clickDiscard(session.page);
|
||||
await waitForReset(session.page);
|
||||
@@ -256,6 +263,13 @@ try {
|
||||
const generationSnapshot = await readGenerationSnapshot(session.tmp, run.eventId);
|
||||
Object.assign(run, deriveJournalGenerationMetrics(generationSnapshot));
|
||||
if (generationSnapshot.variantPlan) run.variantPlan = generationSnapshot.variantPlan;
|
||||
if (acceptVariant) {
|
||||
const sourceCommitted = ['completed', 'carbonize_required', 'carbonize_cleanup_requested'].includes(
|
||||
generationSnapshot.phase,
|
||||
);
|
||||
run.acceptOutcome = { sourceCommitted, phase: generationSnapshot.phase || null };
|
||||
if (!sourceCommitted) process.exitCode = 1;
|
||||
}
|
||||
runs.push(run);
|
||||
|
||||
if (!args.quiet) process.stderr.write(formatRun(runs.at(-1)) + '\n');
|
||||
|
||||
@@ -239,6 +239,7 @@ export async function bootFixtureSession({
|
||||
progressiveDelayMs = 0,
|
||||
progressiveInitialCount = 1,
|
||||
atomicDelayMs = 0,
|
||||
keepTmp = false,
|
||||
}) {
|
||||
const runtime = fixture.runtime;
|
||||
if (!runtime) throw new Error(`fixture ${name} has no runtime block`);
|
||||
@@ -259,7 +260,11 @@ export async function bootFixtureSession({
|
||||
try { if (externalWorker?.done) await externalWorker.done.catch(() => {}); } catch {}
|
||||
try { if (dev?.child) await stopDevServer(dev.child); } catch {}
|
||||
try { if (live) stopLiveServer(tmp); } catch {}
|
||||
try { rmSync(tmp, { recursive: true, force: true }); } catch {}
|
||||
if (!keepTmp) {
|
||||
try { rmSync(tmp, { recursive: true, force: true }); } catch {}
|
||||
} else {
|
||||
log(`kept staged fixture at ${tmp}`);
|
||||
}
|
||||
};
|
||||
|
||||
const stopLiveForDeferredWork = () => {
|
||||
|
||||
@@ -804,7 +804,8 @@ async function ensureVisibleVariant(page, expectedVariant) {
|
||||
*/
|
||||
export async function clickDiscard(page) {
|
||||
// The discard button has just a "✕" glyph as text content.
|
||||
await page.locator(`${BAR_ID} button`, { hasText: '✕' }).click();
|
||||
if (await dispatchBarButton(page, '✕')) return;
|
||||
await clickBarButton(page, '✕');
|
||||
}
|
||||
|
||||
export async function clickEditCopy(page) {
|
||||
|
||||
Reference in New Issue
Block a user