-
-
Notifications
You must be signed in to change notification settings - Fork 427
Expand file tree
/
Copy pathsmoke-test-llm-docs.sh
More file actions
executable file
·69 lines (55 loc) · 1.9 KB
/
smoke-test-llm-docs.sh
File metadata and controls
executable file
·69 lines (55 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
#
# Smoke test all llm-docs routes (llms.txt, llms-full.txt, .md)
# Usage: ./scripts/smoke-test-llm-docs.sh http://localhost:3333
set -euo pipefail
BASE="${1:?Usage: $0 <base-url>}"
BASE="${BASE%/}" # strip trailing slash
PASS=0
FAIL=0
check() {
local label="$1"
local url="$2"
local expect_status="${3:-200}"
status=$(curl -s -o /dev/null -w "%{http_code}" -L "$url")
if [ "$status" = "$expect_status" ]; then
echo " PASS GET $url $status $label"
PASS=$((PASS + 1))
else
echo " FAIL GET $url $status $label (expected $expect_status)"
FAIL=$((FAIL + 1))
fi
}
echo "=== Root ==="
check "Root llms.txt" "$BASE/llms.txt"
echo ""
echo "=== Unscoped package (latest) ==="
check "llms.txt" "$BASE/package/nuxt/llms.txt"
check "llms-full.txt" "$BASE/package/nuxt/llms-full.txt"
check ".md" "$BASE/package/nuxt.md"
echo ""
echo "=== Unscoped package (versioned) ==="
check "llms.txt" "$BASE/package/nuxt/v/3.16.2/llms.txt"
check "llms-full.txt" "$BASE/package/nuxt/v/3.16.2/llms-full.txt"
echo ""
echo "=== Scoped package (latest) ==="
check "llms.txt" "$BASE/package/@nuxt/kit/llms.txt"
check "llms-full.txt" "$BASE/package/@nuxt/kit/llms-full.txt"
check ".md" "$BASE/package/@nuxt/kit.md"
echo ""
echo "=== Scoped package (versioned) ==="
check "llms.txt" "$BASE/package/@nuxt/kit/v/4.3.1/llms.txt"
check "llms-full.txt" "$BASE/package/@nuxt/kit/v/4.3.1/llms-full.txt"
echo ""
echo "=== Org-level ==="
check "Org llms.txt" "$BASE/package/@nuxt/llms.txt"
echo ""
echo "=== Shorthand redirects (follow → 200) ==="
check "Unscoped .md redirect" "$BASE/nuxt.md"
check "Scoped .md redirect" "$BASE/@nuxt/kit.md"
check "Unscoped llms.txt redirect" "$BASE/nuxt/llms.txt"
check "Scoped llms.txt redirect" "$BASE/@nuxt/kit/llms.txt"
echo ""
echo "=== Results ==="
echo " $PASS passed, $FAIL failed"
exit $FAIL