From f4201b74a0c9d5e82377d1481a92737f3c0ce651 Mon Sep 17 00:00:00 2001 From: Jonathan Baldie Date: Sun, 18 Oct 2026 10:01:21 +0100 Subject: [PATCH] test: lock down README Docker persistence path as /data/ not /mnt/ (#174) Verify that the documented persistence command in README.md configures PERSIST=/data/ and does not reference /mnt/ both via static parsing in readme_quick_start_test.ts and through the full Docker startup harness in docker_persist_test.ts. Closes #174 --- tests/docker_persist_test.ts | 10 +++++++++- tests/readme_quick_start_test.ts | 21 +++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/tests/docker_persist_test.ts b/tests/docker_persist_test.ts index 2273141..b8ba396 100644 --- a/tests/docker_persist_test.ts +++ b/tests/docker_persist_test.ts @@ -63,8 +63,16 @@ Deno.test({ const documented = readmePersistCommand(); assertStringIncludes(documented, "--persist"); + assert( + !documented.includes("/mnt"), + "README persistence command must not reference /mnt (#174)", + ); const persistDir = envValue(documented, "PERSIST").replace(/\/+$/, ""); - assert(persistDir.length > 0, "README persistence command does not set PERSIST"); + assertEquals( + persistDir, + "/data", + "README persistence command must configure PERSIST=/data/ (#174)", + ); const name = `queue-persist-test-${Date.now()}`; const volume = `${name}-data`; diff --git a/tests/readme_quick_start_test.ts b/tests/readme_quick_start_test.ts index 70b94b9..eaa8de5 100644 --- a/tests/readme_quick_start_test.ts +++ b/tests/readme_quick_start_test.ts @@ -46,3 +46,24 @@ Deno.test("README quick start documents authenticated, reachable commands", () = assertStringIncludes(command, "Authorization: Bearer"); } }); + +Deno.test( + "README persistence section documents writable Docker data path (#174)", + () => { + const persistSection = + README.match(/## Persistency([\s\S]*?)(\n## |$)/)?.[1] ?? ""; + const persistBlocks = codeBlocks(persistSection); + const dockerPersist = + persistBlocks.find((block) => block.includes("docker run")) ?? ""; + assert( + dockerPersist.length > 0, + "README Persistency section is missing a Docker run command", + ); + assertStringIncludes(dockerPersist, "PERSIST=/data/"); + assert( + !dockerPersist.includes("/mnt"), + "README persistence command must not reference /mnt (#174)", + ); + }, +); +