diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f051d47b..7b471720b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -211,6 +211,7 @@ jobs: repl bench checkout/.bench/*/*.svg repl bench checkout/.bench/*/terminal.ansi repl bench checkout/.bench/*/closed.json + repl bench checkout/.xmd/test-artifacts include-hidden-files: "true" # The same command the release publishes with, minus --dry-run. Catches slow diff --git a/examples/repl-bench/journeys/conversation.test.md b/examples/repl-bench/journeys/conversation.test.md index 9f79b99d6..c9696c4ab 100644 --- a/examples/repl-bench/journeys/conversation.test.md +++ b/examples/repl-bench/journeys/conversation.test.md @@ -80,9 +80,11 @@ - + - + + + diff --git a/examples/repl-bench/journeys/repl-bench.test.md b/examples/repl-bench/journeys/repl-bench.test.md index f2baf92d9..c13c31e7c 100644 --- a/examples/repl-bench/journeys/repl-bench.test.md +++ b/examples/repl-bench/journeys/repl-bench.test.md @@ -89,7 +89,8 @@ - + + @@ -101,17 +102,25 @@ - + + - + + + + + + + + - + @@ -148,7 +157,8 @@ - + + @@ -157,8 +167,10 @@ - - + + + + @@ -173,18 +185,20 @@ - + + - - + + - + + @@ -199,15 +213,20 @@ - + + + + - - + + + + diff --git a/examples/repl-bench/journeys/repl-focus-shortcuts.test.md b/examples/repl-bench/journeys/repl-focus-shortcuts.test.md index 64b659c11..26497e569 100644 --- a/examples/repl-bench/journeys/repl-focus-shortcuts.test.md +++ b/examples/repl-bench/journeys/repl-focus-shortcuts.test.md @@ -17,16 +17,19 @@ - + - + + - + + + @@ -49,8 +52,9 @@ - + + @@ -61,7 +65,8 @@ - + + @@ -81,8 +86,9 @@ - - + + + diff --git a/examples/repl-bench/journeys/repl-wheel-permission.test.md b/examples/repl-bench/journeys/repl-wheel-permission.test.md index 685fcf6cf..5c5b2cc00 100644 --- a/examples/repl-bench/journeys/repl-wheel-permission.test.md +++ b/examples/repl-bench/journeys/repl-wheel-permission.test.md @@ -24,14 +24,21 @@ + - - + + + + + + + + diff --git a/examples/repl-bench/journeys/round-editor.test.md b/examples/repl-bench/journeys/round-editor.test.md index 28be4a8de..e9c9e370e 100644 --- a/examples/repl-bench/journeys/round-editor.test.md +++ b/examples/repl-bench/journeys/round-editor.test.md @@ -19,9 +19,17 @@ + + + - + + + + + + diff --git a/examples/repl-bench/lib/screen.ts b/examples/repl-bench/lib/screen.ts index c87fd9937..107401ec8 100644 --- a/examples/repl-bench/lib/screen.ts +++ b/examples/repl-bench/lib/screen.ts @@ -137,7 +137,12 @@ export function viewport(backend: TerminalBackend, size: Size) { }, sidekickControl(): Point | undefined { const header = { ...full, bottom: Math.min(size.rows, 3) }; - return matches("SIDEKICK", header).next().value ?? matches("Sidekick", header).next().value; + // The identity and notice rows share the chrome surface and can name the Sidekick in prose. + const tab = (point: Point) => + background(point.row, point.column) !== REPL_PALETTE.chromeSurface; + return ( + [...matches("SIDEKICK", header)].find(tab) ?? [...matches("Sidekick", header)].find(tab) + ); }, }; } diff --git a/examples/repl-bench/tests/screen.test.ts b/examples/repl-bench/tests/screen.test.ts index dc7242b5d..4439dbcb8 100644 --- a/examples/repl-bench/tests/screen.test.ts +++ b/examples/repl-bench/tests/screen.test.ts @@ -59,3 +59,24 @@ Deno.test("reads the complete focus legend without treating document text as sho backend.destroy(); } }); + +Deno.test("finds the Sidekick tab below a notice that names the Sidekick", () => { + const backend = createXtermBackend({ cols: size.columns, rows: size.rows }); + try { + const identity = paint(REPL_PALETTE.chromeSurface, " XMD REPL".padEnd(size.columns)); + const notice = paint( + REPL_PALETTE.chromeSurface, + "! the Sidekick was stopped. Nothing it had already done was undone".padEnd(size.columns), + ); + backend.feed(encoder.encode(`${identity}\r\n${notice}\r\n`)); + assert.equal(viewport(backend, size).sidekickControl(), undefined); + + const surfaces = + paint(REPL_PALETTE.paneHeaderSurface, " Sessions Entries ") + + paint(REPL_PALETTE.selectedSurface, " * Sidekick"); + backend.feed(encoder.encode(surfaces)); + assert.deepEqual(viewport(backend, size).sidekickControl(), { row: 2, column: 32 }); + } finally { + backend.destroy(); + } +}); diff --git a/scripts/tests/ci-workflow.test.ts b/scripts/tests/ci-workflow.test.ts index 85aadd5f0..4d8ddac5c 100644 --- a/scripts/tests/ci-workflow.test.ts +++ b/scripts/tests/ci-workflow.test.ts @@ -723,6 +723,22 @@ describe("the dedicated ReplBench job", () => { expect(terminal?.run).toContain(file); } }); + + it("uploads the failed journeys' journals beside their bench evidence", function* () { + const bench = (yield* workflow())["repl-bench"]; + const upload = bench?.steps.find((step) => step.uses?.startsWith("actions/upload-artifact@")); + + expect(upload?.if).toBe("github.event_name == 'push' && (failure() || cancelled())"); + expect(upload?.with?.["include-hidden-files"]).toBe("true"); + expect(upload?.with?.path?.trim().split("\n")).toEqual([ + "repl bench checkout/.bench/*/run.json", + "repl bench checkout/.bench/*/screen.txt", + "repl bench checkout/.bench/*/*.svg", + "repl bench checkout/.bench/*/terminal.ansi", + "repl bench checkout/.bench/*/closed.json", + "repl bench checkout/.xmd/test-artifacts", + ]); + }); }); describe("the CI workflow aggregate", () => {