From 3527ea3eb2a9c331518b3f22b95247bd59ffff74 Mon Sep 17 00:00:00 2001 From: Elliot Chen Date: Sat, 6 Jun 2026 08:51:41 +0800 Subject: [PATCH] ci: fix docs and integration checks --- .github/workflows/docs.yml | 2 +- .../test_cascade_cli_integration.py | 21 +++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6cdad62..0aee1d5 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -81,7 +81,7 @@ jobs: files = { Path("README.md"): "## Use Cases", - Path("use-cases/README.md"): "## Use Case Catalogue", + Path("use-cases/README.md"): "## Use Cases", } failures = [] diff --git a/tests/integration/test_cascade_cli_integration.py b/tests/integration/test_cascade_cli_integration.py index dcb72fe..613eabd 100644 --- a/tests/integration/test_cascade_cli_integration.py +++ b/tests/integration/test_cascade_cli_integration.py @@ -39,6 +39,13 @@ class _StubEmbedder(EmbeddingProvider): return [[0.0] * self.dim for _ in texts] +_ANSI_RE = re.compile(r"\x1b\[[0-?]*[ -/]*[@-~]") + + +def _strip_ansi(text: str) -> str: + return _ANSI_RE.sub("", text) + + @pytest.fixture def cli_runtime(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Iterator[Path]: """Tmp memory root + clean singletons; CLI bootstraps the schema itself.""" @@ -120,16 +127,12 @@ def test_sync_with_path_outside_root_errors( other.write_text("# unrelated\n") result = CliRunner().invoke(cascade_mod.app, ["sync", str(other)]) assert result.exit_code != 0 - # Typer.BadParameter surfaces in stderr / mixed output. The rich - # error box wraps the message at terminal width and pads each line - # with ``│`` (U+2502 box-drawing); so ``not under`` and - # ``memory root`` end up separated by spaces *plus* box characters - # *plus* a newline. ``\s`` doesn't match ``│``, so widen to - # ``[^\w]+`` (anything that isn't an alnum / underscore) — that - # tolerates the rich frame without falsely matching real text - # between the two tokens. + # Typer.BadParameter surfaces in stderr / mixed output. The Rich + # error box may wrap the message, pad each line with box characters, + # and inject ANSI control codes on CI. Strip ANSI first, then allow + # non-word separators between the split message fragments. output = result.stdout + (result.stderr or "") - assert re.search(r"not under[^\w]+memory root", output), output + assert re.search(r"not under[^\w]+memory root", _strip_ansi(output)), output def test_sync_with_unmatched_path(