From 238296585cac6b86427933b3b5570e25b461010a Mon Sep 17 00:00:00 2001 From: MaximilianSoerenPollak Date: Tue, 24 Mar 2026 10:56:09 +0100 Subject: [PATCH 01/14] Testing consumer output in files --- .github/workflows/consumer_test.yml | 12 ++++- src/tests/test_consumer.py | 82 +++++++++++++++++------------ 2 files changed, 58 insertions(+), 36 deletions(-) diff --git a/.github/workflows/consumer_test.yml b/.github/workflows/consumer_test.yml index ac8f77b17..b2e8eea9c 100644 --- a/.github/workflows/consumer_test.yml +++ b/.github/workflows/consumer_test.yml @@ -45,7 +45,17 @@ jobs: run: | set -o pipefail - .venv_docs/bin/python -m pytest -s -v src/tests/ --repo="$CONSUMER" --junitxml="reports/${{ matrix.consumer }}.xml" | tee "reports/${{ matrix.consumer }}.log" + .venv_docs/bin/python -m pytest -s -vv src/tests/ --repo="$CONSUMER" --junitxml="reports/${{ matrix.consumer }}.xml" | tee "reports/${{ matrix.consumer }}.log" + if [ -f "consumer_test.log" ]; then + mv "consumer_test.log" "reports/${{ matrix.consumer }}.log" + elif [ -f "reports/rich.log" ]; then + mv "reports/consumer_test.log" "reports/${{ matrix.consumer }}.log" + else + echo "conumser_test.log not found; expected at ./consumer_test.log or ./reports/consumer_test.log" + exit 1 + fi + echo "=== Tail 12 lines: $out_log ===" + tail -n 12 "reports/${{ matrix.consumer }}.log" || true env: FORCE_COLOR: "1" TERM: xterm-256color diff --git a/src/tests/test_consumer.py b/src/tests/test_consumer.py index 81416f5fe..221968a07 100644 --- a/src/tests/test_consumer.py +++ b/src/tests/test_consumer.py @@ -47,10 +47,11 @@ # Max width of the printout # Trial and error has shown that 80 the best value is for GH CI output -len_max = 80 +len_max = 120 CACHE_DIR = Path.home() / ".cache" / "docs_as_code_consumer_tests" - -console = Console(force_terminal=True if os.getenv("CI") else None, width=80) +log_file_name = "consumer_test.log" +log_fp = open(log_file_name, "a", encoding="utf-8") # ruff-ignore: SIM115 +console = Console(file=log_fp, force_terminal=False, width=120, color_system=None) @dataclass @@ -125,11 +126,11 @@ def sphinx_base_dir(tmp_path_factory: TempPathFactory, pytestconfig: Config) -> if disable_cache: # Use persistent cache directory for local development temp_dir = tmp_path_factory.mktemp("testing_dir") - print(f"[blue]Using temporary directory: {temp_dir}[/blue]") + console.print(f"[blue]Using temporary directory: {temp_dir}[/blue]") return temp_dir CACHE_DIR.mkdir(parents=True, exist_ok=True) - print(f"[green]Using persistent cache directory: {CACHE_DIR}[/green]") + console.print(f"[green]Using persistent cache directory: {CACHE_DIR}[/green]") return CACHE_DIR @@ -174,13 +175,15 @@ def filter_repos(repo_filter: str | None) -> list[ConsumerRepo]: # Warn about any repos that weren't found if requested_repos: available_names = [repo.name for repo in REPOS_TO_TEST] - print(f"[yellow]Warning: Unknown repositories: {requested_repos}[/yellow]") - print(f"[yellow]Available repositories: {available_names}[/yellow]") + console.print( + f"[yellow]Warning: Unknown repositories: {requested_repos}[/yellow]" + ) + console.print(f"[yellow]Available repositories: {available_names}[/yellow]") # If no valid repos were found but filter was provided, return all repos # This prevents accidentally running zero tests due to typos if not filtered_repos and repo_filter: - print( + console.print( "[red]No valid repositories found in filter, " "running all repositories instead[/red]" ) @@ -254,9 +257,9 @@ def parse_bazel_output(BR: BuildOutput, pytestconfig: Config) -> BuildOutput: warning_dict: dict[str, list[str]] = defaultdict(list) if pytestconfig.get_verbosity() >= 2 and os.getenv("CI"): - print("[DEBUG] Raw warnings in CI:") + console.print("[DEBUG] Raw warnings in CI:") for i, warning in enumerate(split_warnings): - print(f"[DEBUG] Warning {i}: {repr(warning)}") + console.print(f"[DEBUG] Warning {i}: {repr(warning)}") for raw_warning in split_warnings: # In the CLI we seem to have some ansi codes in the warnings. @@ -279,15 +282,15 @@ def parse_bazel_output(BR: BuildOutput, pytestconfig: Config) -> BuildOutput: def print_overview_logs(BR: BuildOutput): warning_loggers = list(BR.warnings.keys()) len_left_test_result = len_max - len("TEST RESULTS") - print( + console.print( f"[blue]{'=' * int(len_left_test_result / 2)}" f"TEST RESULTS" f"{'=' * int(len_left_test_result / 2)}[/blue]" ) - print(f"[navy_blue]{'=' * len_max}[/navy_blue]") + console.print(f"[navy_blue]{'=' * len_max}[/navy_blue]") warning_total_loggers_msg = f"Warning Loggers Total: {len(warning_loggers)}" len_left_loggers = len_max - len(warning_total_loggers_msg) - print( + console.print( f"[blue]{'=' * int(len_left_loggers / 2)}" f"{warning_total_loggers_msg}" f"{'=' * int(len_left_loggers / 2)}[/blue]" @@ -295,7 +298,7 @@ def print_overview_logs(BR: BuildOutput): warning_loggers = list(BR.warnings.keys()) warning_total_msg = "Logger Warnings Accumulated" len_left_loggers_total = len_max - len(warning_total_msg) - print( + console.print( f"[blue]{'=' * int(len_left_loggers_total / 2)}" f"{warning_total_msg}" f"{'=' * int(len_left_loggers_total / 2)}[/blue]" @@ -306,12 +309,12 @@ def print_overview_logs(BR: BuildOutput): color = "orange1" if logger == "[NO SPECIFIC LOGGER]" else "red" warning_logger_msg = f"{logger} has {len(BR.warnings[logger])} warnings" len_left_logger = len_max - len(warning_logger_msg) - print( + console.print( f"[{color}]{'=' * int(len_left_logger / 2)}" f"{warning_logger_msg}" f"{'=' * int(len_left_logger / 2)}[/{color}]" ) - print(f"[blue]{'=' * len_max}[/blue]") + console.print(f"[blue]{'=' * len_max}[/blue]") def verbose_printout(BR: BuildOutput): @@ -319,7 +322,7 @@ def verbose_printout(BR: BuildOutput): warning_loggers = list(BR.warnings.keys()) for logger in warning_loggers: len_left_logger = len_max - len(logger) - print( + console.print( f"[cornflower_blue]{'=' * int(len_left_logger / 2)}" f"{logger}" f"{'=' * int(len_left_logger / 2)}[/cornflower_blue]" @@ -329,12 +332,12 @@ def verbose_printout(BR: BuildOutput): color = "red" if logger == "[NO SPECIFIC LOGGER]": color = "orange1" - print( + console.print( f"[{color}]{'=' * int(len_left_warnings / 2)}" f"{f'Warnings Found: {len(warnings)}'}" f"{'=' * int(len_left_warnings / 2)}[/{color}]" ) - print("\n".join(f"[{color}]{x}[/{color}]" for x in warnings)) + console.print("\n".join(f"[{color}]{x}[/{color}]" for x in warnings)) def print_running_cmd(repo: str, cmd: str, local_or_git: str): @@ -342,23 +345,23 @@ def print_running_cmd(repo: str, cmd: str, local_or_git: str): len_left_cmd = len_max - len(cmd) len_left_repo = len_max - len(repo) len_left_local = len_max - len(local_or_git) - print(f"\n[cyan]{'=' * len_max}[/cyan]") - print( + console.print(f"\n[cyan]{'=' * len_max}[/cyan]") + console.print( f"[cornflower_blue]{'=' * int(len_left_repo / 2)}" f"{repo}" f"{'=' * int(len_left_repo / 2)}[/cornflower_blue]" ) - print( + console.print( f"[cornflower_blue]{'=' * int(len_left_local / 2)}" f"{local_or_git}" f"{'=' * int(len_left_local / 2)}[/cornflower_blue]" ) - print( + console.print( f"[cornflower_blue]{'=' * int(len_left_cmd / 2)}" f"{cmd}" f"{'=' * int(len_left_cmd / 2)}[/cornflower_blue]" ) - print(f"[cyan]{'=' * len_max}[/cyan]") + console.print(f"[cyan]{'=' * len_max}[/cyan]") def analyze_build_success(BR: BuildOutput) -> tuple[bool, str]: @@ -401,8 +404,8 @@ def print_final_result(BR: BuildOutput, repo_name: str, cmd: str, pytestconfig: verbose_printout(BR) if pytestconfig.get_verbosity() >= 2: # Verbosity Level 2 (-vv) - print("==== STDOUT ====:\n\n", BR.stdout) - print("==== STDERR ====:\n\n", BR.stderr) + console.print("==== STDOUT ====:\n\n", BR.stdout) + console.print("==== STDERR ====:\n\n", BR.stderr) is_success, reason = analyze_build_success(BR) @@ -412,13 +415,13 @@ def print_final_result(BR: BuildOutput, repo_name: str, cmd: str, pytestconfig: # Printing a small 'report' for each cmd. result_msg = f"{repo_name} - {cmd}: {status}" len_left = len_max - len(result_msg) - print( + console.print( f"[{color}]{'=' * int(len_left / 2)}" f"{result_msg}" f"{'=' * int(len_left / 2)}[/{color}]" ) - print(f"[{color}]Reason: {reason}[/{color}]") - print(f"[{color}]{'=' * len_max}[/{color}]") + console.print(f"[{color}]Reason: {reason}[/{color}]") + console.print(f"[{color}]{'=' * len_max}[/{color}]") return is_success, reason @@ -441,12 +444,12 @@ def print_result_table(results: list[Result]): result.reason, style=style, ) - print(table) + console.print(table) def stream_subprocess_output(cmd: str, repo_name: str): """Stream subprocess output in real-time for maximum verbosity""" - print(f"[green]Streaming output for: {cmd}[/green]") + console.print(f"[green]Streaming output for: {cmd}[/green]") process = subprocess.Popen( cmd.split(), @@ -461,7 +464,7 @@ def stream_subprocess_output(cmd: str, repo_name: str): if process.stdout is not None: for line in iter(process.stdout.readline, ""): if line: - print(line.rstrip()) # Print immediately + console.print(line.rstrip()) # Print immediately output_lines.append(line) process.stdout.close() @@ -584,7 +587,7 @@ def prepare_repo_overrides( repo_path = Path(repo_name) if not use_cache and repo_path.exists(): - print(f"[green]Using cached repository: {repo_name}[/green]") + console.print(f"[green]Using cached repository: {repo_name}[/green]") # Update the existing repo os.chdir(repo_name) subprocess.run(["git", "fetch", "origin"], check=True, capture_output=True) @@ -616,6 +619,7 @@ def prepare_repo_overrides( # Updated version of your test loop def test_and_clone_repos_updated(sphinx_base_dir: Path, pytestconfig: Config): + global log_file_name # Get command line options from pytest config repo_tests: str | None = cast(str | None, pytestconfig.getoption("--repo")) @@ -623,12 +627,13 @@ def test_and_clone_repos_updated(sphinx_base_dir: Path, pytestconfig: Config): repos_to_test = filter_repos(repo_tests) + # Exit early if we don't find repos to test. if not repos_to_test: - print("[red]No repositories to test after filtering![/red]") + console.print("[red]No repositories to test after filtering![/red]") return - print( + console.print( f"[green]Testing {len(repos_to_test)} repositories: " f"{[r.name for r in repos_to_test]}[/green]" ) @@ -642,6 +647,12 @@ def test_and_clone_repos_updated(sphinx_base_dir: Path, pytestconfig: Config): results: list[Result] = [] for repo in repos_to_test: + len_left_repo = len_max - len(repo.name) + console.print(f"{'=' * len_max}") + console.print(f"{'=' * len_max}") + console.print( + f"{'=' * int(len_left_repo / 2)}{repo.name}{'=' * int(len_left_repo / 2)}" + ) # ┌─────────────────────────────────────────┐ # │ Preparing the Repository for testing │ # └─────────────────────────────────────────┘ @@ -692,3 +703,4 @@ def test_and_clone_repos_updated(sphinx_base_dir: Path, pytestconfig: Config): pytest.fail( reason="Consumer Tests failed, see table for which commands specifically. " ) + log_fp.close() From 4ec8724b9797701b9790df22986214fea5dcce36 Mon Sep 17 00:00:00 2001 From: MaximilianSoerenPollak Date: Tue, 24 Mar 2026 11:05:24 +0100 Subject: [PATCH 02/14] Removing pipefail --- .github/workflows/consumer_test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/consumer_test.yml b/.github/workflows/consumer_test.yml index b2e8eea9c..5b48746a0 100644 --- a/.github/workflows/consumer_test.yml +++ b/.github/workflows/consumer_test.yml @@ -44,8 +44,7 @@ jobs: - name: Run Consumer tests run: | - set -o pipefail - .venv_docs/bin/python -m pytest -s -vv src/tests/ --repo="$CONSUMER" --junitxml="reports/${{ matrix.consumer }}.xml" | tee "reports/${{ matrix.consumer }}.log" + .venv_docs/bin/python -m pytest -s -vv src/tests/ --repo="$CONSUMER" --junitxml="reports/${{ matrix.consumer }}.xml" if [ -f "consumer_test.log" ]; then mv "consumer_test.log" "reports/${{ matrix.consumer }}.log" elif [ -f "reports/rich.log" ]; then From 7bd051b5a46ffd646ba626f12340cdd85b7ffa6b Mon Sep 17 00:00:00 2001 From: MaximilianSoerenPollak Date: Tue, 24 Mar 2026 11:22:09 +0100 Subject: [PATCH 03/14] Fix exit code handeling --- .github/workflows/consumer_test.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/consumer_test.yml b/.github/workflows/consumer_test.yml index 5b48746a0..6b8505b4c 100644 --- a/.github/workflows/consumer_test.yml +++ b/.github/workflows/consumer_test.yml @@ -44,17 +44,27 @@ jobs: - name: Run Consumer tests run: | - .venv_docs/bin/python -m pytest -s -vv src/tests/ --repo="$CONSUMER" --junitxml="reports/${{ matrix.consumer }}.xml" + .venv_docs/bin/python -m pytest -vv src/tests/ \ + --repo="$CONSUMER" \ + --junitxml="reports/${{ matrix.consumer }}.xml" + pytest_rc=$? + if [ -f "consumer_test.log" ]; then - mv "consumer_test.log" "reports/${{ matrix.consumer }}.log" - elif [ -f "reports/rich.log" ]; then - mv "reports/consumer_test.log" "reports/${{ matrix.consumer }}.log" + src_log="consumer_test.log" + elif [ -f "reports/consumer_test.log" ]; then + src_log="reports/consumer_test.log" else - echo "conumser_test.log not found; expected at ./consumer_test.log or ./reports/consumer_test.log" - exit 1 + echo "consumer_test.log not found; expected at ./consumer_test.log or ./reports/consumer_test.log" + exit ${pytest_rc:-1} fi - echo "=== Tail 12 lines: $out_log ===" - tail -n 12 "reports/${{ matrix.consumer }}.log" || true + + dest_log="reports/${{ matrix.consumer }}.log" + mv "$src_log" "$dest_log" + + echo "=== Tail 12 lines: $dest_log ===" + tail -n 12 "$dest_log" || true + + exit $pytest_rc env: FORCE_COLOR: "1" TERM: xterm-256color From d892973bd303071f11f3a6af1f060527b0b77574 Mon Sep 17 00:00:00 2001 From: MaximilianSoerenPollak Date: Tue, 24 Mar 2026 11:39:19 +0100 Subject: [PATCH 04/14] Fix of exit code? --- .github/workflows/consumer_test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/consumer_test.yml b/.github/workflows/consumer_test.yml index 6b8505b4c..d6816ee08 100644 --- a/.github/workflows/consumer_test.yml +++ b/.github/workflows/consumer_test.yml @@ -44,10 +44,12 @@ jobs: - name: Run Consumer tests run: | + pytest_rc=0 .venv_docs/bin/python -m pytest -vv src/tests/ \ --repo="$CONSUMER" \ - --junitxml="reports/${{ matrix.consumer }}.xml" - pytest_rc=$? + --junitxml="reports/${{ matrix.consumer }}.xml" \ + || pytest_rc=$? + if [ -f "consumer_test.log" ]; then src_log="consumer_test.log" From b2d32e4924de1386e0231135e32c2c7b740ca5d7 Mon Sep 17 00:00:00 2001 From: MaximilianSoerenPollak Date: Tue, 24 Mar 2026 11:59:53 +0100 Subject: [PATCH 05/14] Ignore ruff error --- src/tests/test_consumer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tests/test_consumer.py b/src/tests/test_consumer.py index 221968a07..cf4e9896f 100644 --- a/src/tests/test_consumer.py +++ b/src/tests/test_consumer.py @@ -50,7 +50,10 @@ len_max = 120 CACHE_DIR = Path.home() / ".cache" / "docs_as_code_consumer_tests" log_file_name = "consumer_test.log" -log_fp = open(log_file_name, "a", encoding="utf-8") # ruff-ignore: SIM115 +# Need to ignore the ruff error here. Due to how the script is written, +# can not use a context manager to open the log file, even though it would be preferable +# In a future re-write this should be considered. +log_fp = open(log_file_name, "a", encoding="utf-8") # noqa: SIM115 console = Console(file=log_fp, force_terminal=False, width=120, color_system=None) @@ -627,7 +630,6 @@ def test_and_clone_repos_updated(sphinx_base_dir: Path, pytestconfig: Config): repos_to_test = filter_repos(repo_tests) - # Exit early if we don't find repos to test. if not repos_to_test: console.print("[red]No repositories to test after filtering![/red]") From 478a3004249bb8e216bbc77307cd86bdcd93aa2c Mon Sep 17 00:00:00 2001 From: MaximilianSoerenPollak Date: Tue, 24 Mar 2026 12:51:24 +0100 Subject: [PATCH 06/14] Add verbose mode --- docs.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/docs.bzl b/docs.bzl index cd41a4c83..d55087b49 100644 --- a/docs.bzl +++ b/docs.bzl @@ -286,6 +286,7 @@ def docs(source_dir = "docs", data = [], deps = [], scan_code = []): "--jobs", "auto", "--define=external_needs_source=" + str(data), + "-v", ], formats = ["needs"], sphinx = ":sphinx_build", From 6cdb5a9843ea936e2c34427cd67cfcc4475c5894 Mon Sep 17 00:00:00 2001 From: MaximilianSoerenPollak Date: Tue, 24 Mar 2026 16:44:20 +0100 Subject: [PATCH 07/14] Trying printing logs & adding tail to step summary --- .github/workflows/consumer_test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/consumer_test.yml b/.github/workflows/consumer_test.yml index d6816ee08..ff4bb99ba 100644 --- a/.github/workflows/consumer_test.yml +++ b/.github/workflows/consumer_test.yml @@ -63,9 +63,11 @@ jobs: dest_log="reports/${{ matrix.consumer }}.log" mv "$src_log" "$dest_log" - echo "=== Tail 12 lines: $dest_log ===" - tail -n 12 "$dest_log" || true + tail -n 15 "$dest_log" >> "$GITHUB_STEP_SUMMARY" + .venv_docs/bin/python -c "from rich import print; \ + f = open(sys.argv[1], 'r', encoding='utf-8'); \ + print(f.read_text())" "$dest_log" exit $pytest_rc env: FORCE_COLOR: "1" From 1c6b1d3ccc03eb13d62a264269baaae7a71e2b75 Mon Sep 17 00:00:00 2001 From: MaximilianSoerenPollak Date: Tue, 24 Mar 2026 17:07:17 +0100 Subject: [PATCH 08/14] Fix import error --- .github/workflows/consumer_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/consumer_test.yml b/.github/workflows/consumer_test.yml index ff4bb99ba..c7266bf86 100644 --- a/.github/workflows/consumer_test.yml +++ b/.github/workflows/consumer_test.yml @@ -66,6 +66,7 @@ jobs: tail -n 15 "$dest_log" >> "$GITHUB_STEP_SUMMARY" .venv_docs/bin/python -c "from rich import print; \ + import sys; \ f = open(sys.argv[1], 'r', encoding='utf-8'); \ print(f.read_text())" "$dest_log" exit $pytest_rc From ff7feba4a55cf41b6222404c53b7f54694b21e15 Mon Sep 17 00:00:00 2001 From: MaximilianSoerenPollak Date: Tue, 24 Mar 2026 17:18:30 +0100 Subject: [PATCH 09/14] Fixing method --- .github/workflows/consumer_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/consumer_test.yml b/.github/workflows/consumer_test.yml index c7266bf86..cd1e20482 100644 --- a/.github/workflows/consumer_test.yml +++ b/.github/workflows/consumer_test.yml @@ -68,7 +68,7 @@ jobs: .venv_docs/bin/python -c "from rich import print; \ import sys; \ f = open(sys.argv[1], 'r', encoding='utf-8'); \ - print(f.read_text())" "$dest_log" + print(f.read())" "$dest_log" exit $pytest_rc env: FORCE_COLOR: "1" From 23f050bed2e1713b38d5c52f431c95880ecfd0a4 Mon Sep 17 00:00:00 2001 From: MaximilianSoerenPollak Date: Tue, 24 Mar 2026 17:32:25 +0100 Subject: [PATCH 10/14] Maybe a simpler version --- .github/workflows/consumer_test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/consumer_test.yml b/.github/workflows/consumer_test.yml index cd1e20482..0d8593faf 100644 --- a/.github/workflows/consumer_test.yml +++ b/.github/workflows/consumer_test.yml @@ -65,10 +65,7 @@ jobs: tail -n 15 "$dest_log" >> "$GITHUB_STEP_SUMMARY" - .venv_docs/bin/python -c "from rich import print; \ - import sys; \ - f = open(sys.argv[1], 'r', encoding='utf-8'); \ - print(f.read())" "$dest_log" + cat "$dest_log" exit $pytest_rc env: FORCE_COLOR: "1" From 863540dd24dee91883e4f27d80a0ff5f15cf8f8b Mon Sep 17 00:00:00 2001 From: MaximilianSoerenPollak Date: Tue, 24 Mar 2026 17:59:38 +0100 Subject: [PATCH 11/14] Change output table to markdown style --- src/tests/test_consumer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/test_consumer.py b/src/tests/test_consumer.py index cf4e9896f..afe386424 100644 --- a/src/tests/test_consumer.py +++ b/src/tests/test_consumer.py @@ -22,7 +22,7 @@ import pytest from _pytest.config import Config from pytest import TempPathFactory -from rich import print +from rich import box, print from rich.console import Console from rich.table import Table @@ -431,7 +431,7 @@ def print_final_result(BR: BuildOutput, repo_name: str, cmd: str, pytestconfig: def print_result_table(results: list[Result]): """Printing an 'overview' table to show all results.""" - table = Table(title="Docs-As-Code Consumer Test Result") + table = Table(title="Docs-As-Code Consumer Test Result", box=box.MARKDOWN) table.add_column("Repository") table.add_column("CMD") table.add_column("LOCAL OR GIT") From 1bd3a52413811024b62767eb36f7fa53f1de0d61 Mon Sep 17 00:00:00 2001 From: MaximilianSoerenPollak Date: Tue, 24 Mar 2026 18:22:46 +0100 Subject: [PATCH 12/14] Delete venv too conditinally --- src/tests/test_consumer.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tests/test_consumer.py b/src/tests/test_consumer.py index afe386424..4a2885198 100644 --- a/src/tests/test_consumer.py +++ b/src/tests/test_consumer.py @@ -137,14 +137,16 @@ def sphinx_base_dir(tmp_path_factory: TempPathFactory, pytestconfig: Config) -> return CACHE_DIR -def cleanup(): +def cleanup(cmd: str): """ Cleanup before tests are run """ for p in Path(".").glob("*/ubproject.toml"): p.unlink() shutil.rmtree("_build", ignore_errors=True) - cmd = "bazel clean --async" + if cmd == "bazel run //:ide_support": + shutil.rmtree(".venv_docs", ignore_errors=True) + cmd = "bazel clean --async" subprocess.run(cmd.split(), text=True) @@ -489,7 +491,7 @@ def run_cmd( ) -> tuple[list[Result], bool]: verbosity: int = pytestconfig.get_verbosity() - cleanup() + cleanup(cmd) if verbosity >= 3: # Level 3 (-vvv): Stream output in real-time From 79636649d8f5b524cc0e4df41597059bcd576aa9 Mon Sep 17 00:00:00 2001 From: MaximilianSoerenPollak Date: Wed, 25 Mar 2026 16:27:42 +0100 Subject: [PATCH 13/14] Remove debug argument --- docs.bzl | 1 - 1 file changed, 1 deletion(-) diff --git a/docs.bzl b/docs.bzl index d55087b49..cd41a4c83 100644 --- a/docs.bzl +++ b/docs.bzl @@ -286,7 +286,6 @@ def docs(source_dir = "docs", data = [], deps = [], scan_code = []): "--jobs", "auto", "--define=external_needs_source=" + str(data), - "-v", ], formats = ["needs"], sphinx = ":sphinx_build", From 2b1985995fa57089c991cbf58a1b5ca96b0e6874 Mon Sep 17 00:00:00 2001 From: MaximilianSoerenPollak Date: Wed, 25 Mar 2026 16:32:40 +0100 Subject: [PATCH 14/14] Remove unnecessary elif --- .github/workflows/consumer_test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/consumer_test.yml b/.github/workflows/consumer_test.yml index 0d8593faf..b884894dd 100644 --- a/.github/workflows/consumer_test.yml +++ b/.github/workflows/consumer_test.yml @@ -53,10 +53,8 @@ jobs: if [ -f "consumer_test.log" ]; then src_log="consumer_test.log" - elif [ -f "reports/consumer_test.log" ]; then - src_log="reports/consumer_test.log" else - echo "consumer_test.log not found; expected at ./consumer_test.log or ./reports/consumer_test.log" + echo "consumer_test.log not found; expected at ./consumer_test.log" exit ${pytest_rc:-1} fi