From 8d9d1d343907d6f222fed1e76446f9ff2e471337 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Tue, 4 Aug 2026 07:28:47 -0400 Subject: [PATCH] test(docs): skip the publishability gate where there is no docs/ to check The GitHub backend job failed on test_there_are_docs_to_check, correctly. docs/ is stripped from the published repository - it lives in the wiki on that side - so on the mirror the glob matched nothing and the guard fired exactly as designed. An absent docs/ and a glob that silently matches nothing in a tree that HAS docs are different conditions, and the test conflated them. The module now skips when the directory is not there at all, and the guard still fails when it is there and empty. Verified all three ways: 7 pass here, 7 skip in a docs-less checkout, and the guard still fails against a docs/ containing no markdown. The gate has to ship rather than be excluded from publication, because the published tree is where the GitHub CI that would catch a regression runs. --- tests/test_docs_publishable.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_docs_publishable.py b/tests/test_docs_publishable.py index 3e29ce6..84f4339 100644 --- a/tests/test_docs_publishable.py +++ b/tests/test_docs_publishable.py @@ -21,6 +21,17 @@ import pytest REPO = Path(__file__).resolve().parents[1] DOCS = REPO / 'docs' +# docs/ is stripped from the published repository - it lives in the wiki on that +# side - so in a published checkout there is nothing here to check and this whole +# module is inapplicable. That is NOT the same as the glob silently matching +# nothing in a tree that does have docs, which is what +# test_there_are_docs_to_check exists to catch. Distinguishing the two matters: +# collapsing them either breaks CI on the published mirror (this module failed +# there for exactly this reason) or quietly disables the guard everywhere. +pytestmark = pytest.mark.skipif( + not DOCS.is_dir(), + reason='no docs/ in this checkout - it is excluded from publication and lives in the wiki') + # Kept in step with the scrub list in tools/export-github.sh. Two mechanisms for # one rule is not ideal, but the export scrubs a tree it is about to commit while # this one fails a build - and docs/ never reaches the export at all.