mirror of
https://github.com/debpalash/VoiceStudio.git
synced 2026-10-02 01:26:35 +08:00
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) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ypcgSsh5j2PEonSJiAU1S
This commit is contained in:
co-authored by
Claude Opus 5
parent
8526ff56f7
commit
b55098f044
@@ -682,12 +682,12 @@
|
|||||||
"try:\n",
|
"try:\n",
|
||||||
" import ctranslate2 # noqa: F401\n",
|
" import ctranslate2 # noqa: F401\n",
|
||||||
"except Exception as _exc:\n",
|
"except Exception as _exc:\n",
|
||||||
" print(\n",
|
" print(\"\")\n",
|
||||||
" \"\n⚠️ CTranslate2 is not importable here, so the backend will fall back\"\n",
|
" print(\"WARNING: CTranslate2 is not importable here, so the backend will\")\n",
|
||||||
" \"\n to its PyTorch Whisper default and download that model separately.\"\n",
|
" print(\" fall back to its PyTorch Whisper default and download\")\n",
|
||||||
" f\"\n Reason: {_exc}\"\n",
|
" print(\" that model separately - several more GB.\")\n",
|
||||||
" \"\n Re-run the cuDNN 8 setup cell above before continuing.\"\n",
|
" print(f\" Reason: {_exc}\")\n",
|
||||||
" )\n"
|
" print(\" Re-run the cuDNN 8 setup cell above before continuing.\")\n"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -114,6 +114,14 @@ async def test_tauri_log_clear_reports_truncate_failure(monkeypatch, tmp_path, a
|
|||||||
log = tmp_path / "webview.log"
|
log = tmp_path / "webview.log"
|
||||||
log.write_text("data", encoding="utf-8")
|
log.write_text("data", encoding="utf-8")
|
||||||
monkeypatch.setattr(system, "_tauri_log_candidates", lambda: [str(log)])
|
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(
|
monkeypatch.setattr(
|
||||||
system,
|
system,
|
||||||
"_truncate_file",
|
"_truncate_file",
|
||||||
|
|||||||
Reference in New Issue
Block a user