from pathlib import Path


ROOT = Path(__file__).resolve().parents[1]


def test_embedding_probe_failure_is_not_reported_as_version_skip():
    script = (ROOT / "scripts" / "ops" / "diagnose_ollama_gcp_failover.sh").read_text(
        encoding="utf-8"
    )

    assert 'if [[ "$primary_version_ok" == "1" ]]; then' in script
    assert 'if [[ "$secondary_version_ok" == "1" ]]; then' in script
    assert 'embed_probe "GCP-B embed" "$SECONDARY_URL" || true' in script
    assert '&& embed_probe "GCP-B embed"' not in script
