From b55098f044d0a90ae66bb1b529bcf06d387d1651 Mon Sep 17 00:00:00 2001 From: Palash Debnath Date: Wed, 9 Sep 2026 13:43:17 -0700 Subject: [PATCH] fix: repair the Colab cell edit and point the clear test at the split resolver Two CI failures, both mine to fix. The warning I added to the Colab ASR cell used \n escapes inside the notebook JSON, and they landed as real newlines, so the cell's Python had an unterminated string and tests/test_colab_asr_setup.py could not exec it. The block prints line by line now, with no escapes to get wrong. test_tauri_log_clear_reports_truncate_failure patched _tauri_log_candidates, but #1925 moved Clear onto _tauri_plugin_log_candidates, so the patch no longer reached the code under test and the real resolver was consulted instead. It passed on a machine with a shell log on disk and failed on a clean runner. Patches both halves, matching the fixture in test_tauri_log_clear.py. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_017ypcgSsh5j2PEonSJiAU1S --- notebooks/OmniVoice_Studio_Colab.ipynb | 12 ++++++------ tests/test_destructive_cleanup.py | 8 ++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/notebooks/OmniVoice_Studio_Colab.ipynb b/notebooks/OmniVoice_Studio_Colab.ipynb index 0d6274edb..21bcab629 100644 --- a/notebooks/OmniVoice_Studio_Colab.ipynb +++ b/notebooks/OmniVoice_Studio_Colab.ipynb @@ -682,12 +682,12 @@ "try:\n", " import ctranslate2 # noqa: F401\n", "except Exception as _exc:\n", - " print(\n", - " \"\n⚠️ CTranslate2 is not importable here, so the backend will fall back\"\n", - " \"\n to its PyTorch Whisper default and download that model separately.\"\n", - " f\"\n Reason: {_exc}\"\n", - " \"\n Re-run the cuDNN 8 setup cell above before continuing.\"\n", - " )\n" + " print(\"\")\n", + " print(\"WARNING: CTranslate2 is not importable here, so the backend will\")\n", + " print(\" fall back to its PyTorch Whisper default and download\")\n", + " print(\" that model separately - several more GB.\")\n", + " print(f\" Reason: {_exc}\")\n", + " print(\" Re-run the cuDNN 8 setup cell above before continuing.\")\n" ] }, { diff --git a/tests/test_destructive_cleanup.py b/tests/test_destructive_cleanup.py index 7a7da8d55..28a5204f4 100644 --- a/tests/test_destructive_cleanup.py +++ b/tests/test_destructive_cleanup.py @@ -114,6 +114,14 @@ async def test_tauri_log_clear_reports_truncate_failure(monkeypatch, tmp_path, a log = tmp_path / "webview.log" log.write_text("data", encoding="utf-8") monkeypatch.setattr(system, "_tauri_log_candidates", lambda: [str(log)]) + # Clear now goes through the plugin-log half only, so patching the + # composite alone no longer reaches it. Patching both keeps this honest + # against the pre-split code too; without it the real resolver is + # consulted and the result depends on whether the machine running the + # test happens to have a shell log on disk. + monkeypatch.setattr( + system, "_tauri_plugin_log_candidates", lambda: [str(log)], raising=False + ) monkeypatch.setattr( system, "_truncate_file",