From 2ff8bc46b1ef3474bd80e3aba6b658d126861443 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Tue, 19 May 2026 02:37:48 +0000 Subject: [PATCH] =?UTF-8?q?fix(claude=5Fcode):=20greptile=20=E2=80=94=20ro?= =?UTF-8?q?bust=20version=20extraction=20+=20narrow=20pytest.raises?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - run_daily.sh: extract semver via grep -oE instead of awk '{print $1}' so the parsed version survives a 'claude --version' output that ever prepends a label (e.g. 'Claude Code vX.Y.Z'). The previous awk pattern would silently publish the wrong string in that case. - _driver_unit_tests/test_basic_messaging.py: narrow pytest.raises(BaseException) to pytest.raises(pytest.fail.Exception). pytest.fail() raises Failed, which inherits from BaseException; the new bound matches what the helper raises without also swallowing KeyboardInterrupt/SystemExit. --- tests/claude_code/_driver_unit_tests/test_basic_messaging.py | 4 ++-- tests/claude_code/cron_vm/run_daily.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/claude_code/_driver_unit_tests/test_basic_messaging.py b/tests/claude_code/_driver_unit_tests/test_basic_messaging.py index 87ddaca8281..f553584c920 100644 --- a/tests/claude_code/_driver_unit_tests/test_basic_messaging.py +++ b/tests/claude_code/_driver_unit_tests/test_basic_messaging.py @@ -146,7 +146,7 @@ def test_verify_streaming_fails_when_proxy_buffers(monkeypatch): outcome = DriverResult(text="1\n2\n3", events=_buffered_events()) _install_fake_runner(monkeypatch, outcomes_by_model={model: outcome}) - with pytest.raises(BaseException): + with pytest.raises(pytest.fail.Exception): run_basic_messaging_cell( compat_result=fake_result, models=[model], @@ -189,7 +189,7 @@ def test_verify_streaming_requires_all_models_to_stream(monkeypatch): } _install_fake_runner(monkeypatch, outcomes_by_model=outcomes) - with pytest.raises(BaseException): + with pytest.raises(pytest.fail.Exception): run_basic_messaging_cell( compat_result=fake_result, models=list(outcomes.keys()), diff --git a/tests/claude_code/cron_vm/run_daily.sh b/tests/claude_code/cron_vm/run_daily.sh index 46196e60fe3..fd44e1bac15 100755 --- a/tests/claude_code/cron_vm/run_daily.sh +++ b/tests/claude_code/cron_vm/run_daily.sh @@ -163,8 +163,8 @@ LITELLM_VERSION="$( [[ -n "${LITELLM_VERSION}" ]] || die "could not resolve latest v*-stable tag in 5 pages of releases" log "resolved litellm: ${LITELLM_VERSION}" -CLAUDE_CODE_VERSION="$(claude --version 2>/dev/null | awk '{print $1}')" -[[ -n "${CLAUDE_CODE_VERSION}" ]] || die "could not read 'claude --version'" +CLAUDE_CODE_VERSION="$(claude --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+([.-][A-Za-z0-9.-]+)?' | head -n1)" +[[ -n "${CLAUDE_CODE_VERSION}" ]] || die "could not parse semver from 'claude --version'" log "local claude code: ${CLAUDE_CODE_VERSION}" # ---------------------------------------------------------------------------