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.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user