Skip to content

Commit a7f60c0

Browse files
authored
πŸ› Keep the session-name assertion off the random profile root (#714) (#716)
`C4: one Session carries every turn, and --session names it` asserted that the whole authorship directory path holds no "ada". The path's leaf is the digest of the name and the assertion is about the leaf; the root above it is a temporary directory named by a random hex UUID, which spells "ada" about one run in a hundred β€” run 33574538193 drew `xmd-plan-profile-dada9d00-…`. The assertion now reads the path relative to the root it was given. Co-authored-by: Taras Mankovski <74687+taras@users.noreply.github.com>
1 parent b1c5534 commit a7f60c0

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

β€Žpackages/cli/tests/plan.test.tsβ€Ž

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { ensure, scoped, spawn, until } from "effection";
2323
import type { Operation } from "effection";
2424
import { ensureDir, readTextFile, rm, writeTextFile } from "@effectionx/fs";
2525
import { readdir } from "node:fs/promises";
26-
import { join, sep } from "node:path";
26+
import { join, relative, sep } from "node:path";
2727
import { API, stat } from "@executablemd/runtime";
2828
import { Elicitation } from "@executablemd/core";
2929
import type { ElicitationRequest } from "@executablemd/core";
@@ -419,9 +419,11 @@ describe(
419419
expect(namedDirectories[0]).toBe(namedDirectories[1]);
420420
expect(survived).toEqual([true, true]);
421421
// The name never reaches the path, and the digest is what the host
422-
// derived from it.
422+
// derived from it. Only the leaf is the host's to keep the name out of:
423+
// the root above it carries a random hex UUID, which spells "ada" one
424+
// run in a hundred or so.
423425
expect(namedDirectories[0]).toBe(authorshipDirectoryFor(authorshipRoot, "ada"));
424-
expect(namedDirectories[0]).not.toContain("ada");
426+
expect(relative(authorshipRoot, namedDirectories[0])).not.toContain("ada");
425427

426428
// The second invocation continued the record the first established
427429
// rather than placing a second one: the store holds one, and only the

0 commit comments

Comments
Β (0)