From 5e0cc09802bd3122c6b77b57e3513cbb53c18f20 Mon Sep 17 00:00:00 2001 From: shegazyy Date: Sun, 5 Jul 2026 14:48:45 +0300 Subject: [PATCH] Remove test log display from docs and clean up conf.py The DisplayTestLogs Sphinx directive collected bazel-testlogs at build time and embedded them in the verification report. This had two problems: - The directive was registered in the local conf.py which is not executed in the score reference integration (docs-as-code), making it a no-op in official releases. - The project has decided not to include test logs in documentation. Remove the directive class, its registration, and the "Test Log Files" section in statistics.rst. Also drop the now-unused docutils imports. Closes #266 --- conf.py | 42 ------------------------- docs/verification_report/statistics.rst | 6 ---- 2 files changed, 48 deletions(-) diff --git a/conf.py b/conf.py index 6f70bf190..70dfb7e99 100644 --- a/conf.py +++ b/conf.py @@ -18,12 +18,8 @@ import os import shutil -from itertools import chain from pathlib import Path -from docutils import nodes -from docutils.parsers.rst import Directive - # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information @@ -73,45 +69,7 @@ numfig = True -class DisplayTestLogs(Directive): - """Find and display the raw content of all test.log files.""" - - def run(self): - env = self.state.document.settings.env - ws_root = Path(env.app.srcdir) - - result_nodes = [] - for log_file in chain( - (ws_root / "bazel-testlogs").rglob("test.log"), - (ws_root / "tests-report").rglob("test.log"), - ): - rel_path = log_file.relative_to(ws_root) - - title = nodes.rubric(text=str(rel_path)) - result_nodes.append(title) - - try: - content = log_file.read_text(encoding="utf-8") - except Exception as e: - content = f"Error reading file: {e}" - - code = nodes.literal_block(content, content) - code["language"] = "text" - code["source"] = str(rel_path) - result_nodes.append(code) - - if not result_nodes: - para = nodes.paragraph( - text="No test.log files found in bazel-testlogs or tests-report." - ) - result_nodes.append(para) - - return result_nodes - - def setup(app): - app.add_directive("display-test-logs", DisplayTestLogs) - # When Sphinx runs inside a Bazel action (bazel build //:needs_json), the # CWD is the execroot / sandbox root and the JSON schema files are linked # there at their workspace-relative paths (src/...) because they are diff --git a/docs/verification_report/statistics.rst b/docs/verification_report/statistics.rst index 27ead3fe0..a1c18d55f 100644 --- a/docs/verification_report/statistics.rst +++ b/docs/verification_report/statistics.rst @@ -114,9 +114,3 @@ Details About Testcases type == 'testcase' and derivation_technique == 'fuzz-testing' type == 'testcase' and derivation_technique == 'error-guessing' type == 'testcase' and derivation_technique == 'explorative-testing' - - -Test Log Files --------------- - -.. display-test-logs::