From 7072d3708c6311e9101c2dfd02df1c1f75b20734 Mon Sep 17 00:00:00 2001 From: Andrey Avtomonov Date: Fri, 15 May 2026 01:54:41 +0200 Subject: [PATCH] test(docs): align examples-docs assertions with revamped docs PR #103 (setup/guide doc revamp) reworded several CLI examples and connection labels; the assertions in scripts/examples-docs.test.mjs still referenced the pre-revamp wording and were failing in CI on main. Update the regexes to match the post-revamp content: - drop the `--json` flag from the sl-query example expectation - move the `Driver:` / `Status: ok` probe to the connection reference, which is where that output now lives (driver id is lowercase `postgres`, not the display name `PostgreSQL`) - drop the obsolete `Install \`uv\`...` troubleshooting line - accept `` everywhere; the docs no longer use the hyphenated `` form - match the `warehouse` connection id used in the quickstart instead of the `postgres-warehouse` id only used in the README and setup ref --- scripts/examples-docs.test.mjs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/examples-docs.test.mjs b/scripts/examples-docs.test.mjs index 5e6a93d7..bc96e372 100644 --- a/scripts/examples-docs.test.mjs +++ b/scripts/examples-docs.test.mjs @@ -168,7 +168,7 @@ describe('standalone example docs', () => { 'ktx status --json', 'ktx sl list --json', 'ktx sl search "revenue" --json', - 'ktx sl query --json', + 'ktx sl query', 'ktx wiki search "revenue recognition" --json', ]) { assert.match(servingAgents, new RegExp(command.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'))); @@ -183,7 +183,8 @@ describe('standalone example docs', () => { assert.match(connectionReference, /ktx connection test my-warehouse/); assert.match(connectionReference, /ktx connection test --all/); assert.match(quickstart, /Connection test passed/); - assert.match(quickstart, /Driver: PostgreSQL .* Status: ok/); + assert.match(connectionReference, /Driver: postgres/); + assert.match(connectionReference, /Status: ok/); }); it('documents public npm and managed runtime usage', async () => { @@ -195,7 +196,6 @@ describe('standalone example docs', () => { assert.match(quickstart, publicPackagePattern('npm install -g {package}')); assert.match(quickstart, /ktx dev runtime install --feature local-embeddings --yes/); assert.match(quickstart, /ktx dev runtime start --feature local-embeddings/); - assert.match(quickstart, /Install `uv`, run `ktx dev runtime status`/); assert.match(packageArtifacts, /requires `uv` on `PATH`/); assert.match(packageArtifacts, /ktx dev runtime status/); assert.match(packageArtifacts, /ktx dev runtime status/); @@ -255,15 +255,15 @@ describe('standalone example docs', () => { assert.match(ingestReference, /ktx ingest /); assert.match(ingestReference, /ktx ingest --all --deep/); assert.match(ingestReference, /--query-history-window-days /); - assert.match(buildingContext, /ktx ingest /); + assert.match(buildingContext, /ktx ingest /); assert.match(buildingContext, /ktx ingest --all/); assert.match(contextSources, /ktx ingest /); assert.match(contextAsCode, /ktx ingest --all --no-input/); assert.match(quickstart, /schema context/); assert.match(primarySources, /context:\n queryHistory:/); assert.match(rootReadme, /Databases configured: yes \(postgres-warehouse\)/); - assert.match(quickstart, /Databases:\n postgres-warehouse: deep context complete/); - assert.match(quickstart, /Databases configured: yes \(postgres-warehouse\)/); + assert.match(quickstart, /Databases:\n warehouse: deep context complete/); + assert.match(quickstart, /Databases configured: yes \(warehouse\)/); assert.match(setupReference, /Databases configured: yes \(postgres-warehouse\)/); assert.doesNotMatch(rootReadme, new RegExp(['Primary sources', 'configured'].join(' '))); assert.doesNotMatch(quickstart, new RegExp(['Primary', 'sources'].join(' ')));