Skip to content

Commit 3db17c2

Browse files
committed
test(indexability): follow llms.txt redirect to weaviate.io; skip on network reset
/llms.txt 301-redirects to weaviate.io/llms.txt. Add weaviate.io to the Claude web_fetch allowed_domains so it can follow the redirect, and make test_llms_txt_accessible use a browser UA and treat a transient connection reset/timeout as an inconclusive skip (matching test_llms_txt_code.py) rather than a hard failure.
1 parent 7d55f67 commit 3db17c2

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

tests/test_docs_indexability.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,21 @@ def test_llm_notice_present(path):
277277
@pytest.mark.indexability
278278
def test_llms_txt_accessible():
279279
"""/llms.txt returns 200, has substantial content, and mentions Weaviate."""
280-
resp = requests.get(
281-
f"{BASE_URL}/llms.txt",
282-
timeout=30,
283-
headers={"User-Agent": "WeaviateDocsIndexabilityTest/1.0"},
284-
)
280+
try:
281+
resp = requests.get(
282+
f"{BASE_URL}/llms.txt",
283+
timeout=30,
284+
headers={
285+
"User-Agent": (
286+
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) "
287+
"AppleWebKit/537.36 (KHTML, like Gecko) "
288+
"Chrome/124.0.0.0 Safari/537.36"
289+
)
290+
},
291+
)
292+
except (requests.exceptions.ConnectionError, requests.exceptions.Timeout) as exc:
293+
# network failure must not flake the suite
294+
pytest.skip(f"Network issue fetching /llms.txt: {exc}")
285295
assert resp.status_code == 200, f"/llms.txt returned {resp.status_code}"
286296
assert len(resp.text) > 500, f"/llms.txt content too short ({len(resp.text)} chars)"
287297
assert "weaviate" in resp.text.lower(), "/llms.txt doesn't mention Weaviate"
@@ -450,7 +460,7 @@ def test_claude_can_fetch_llms_txt():
450460
"type": "web_fetch_20250910",
451461
"name": "web_fetch",
452462
"max_uses": 1,
453-
"allowed_domains": ["docs.weaviate.io"],
463+
"allowed_domains": ["docs.weaviate.io", "weaviate.io"],
454464
}],
455465
messages=[{
456466
"role": "user",

0 commit comments

Comments
 (0)