Date: 2026-03-31 From: Engineering To: SQA Team Priority: High Scope: VIL CLI (v0.1.18), 88 examples, vil init templates, website quickstart, Vastar Bench
Clone the automated test suite first:
git clone https://github.com/OceanOS-id/vil-testsuite.git
cd vil-testsuiteRun all automated tests:
# Run everything
./run.sh
# Run specific spec
./run.sh cli # CLI commands only
./run.sh init # All 88 template init tests
./run.sh bench # Vastar Bench output format
./run.sh observer # Observer API endpoints
./run.sh runtime # Build + run + curl all examples
./run.sh edge_cases # Edge case scenarios
# List available specs
./run.sh --list
# Run runtime tests including simulator-dependent examples
RUNTIME_ALL=1 ./run.sh runtimeTest suite auto-discovers all 88 examples from template-index.json. When new examples are added, pull latest and re-run — no test code changes needed.
Update test suite:
cd vil-testsuite
git pullUpdate template index (after new examples added to VIL):
cd vil # VIL repo
python3 scripts/generate-all-templates.py # generate template.toml for new examples
python3 scripts/generate-all-templates.py --index > template-index.json # regenerate indexInstall these on test machine before starting:
# Rust toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
# VIL CLI
cargo install vil_cli
vil --help # verify: should show 30+ subcommands
# Vastar Bench
cargo install vastar
vastar --version # verify: v0.1.8
# AI Endpoint Simulator
cargo install ai-endpoint-simulator
ai-endpoint-simulator & # runs on port 4545vil templatesExpected:
- Fetches from GitHub
- Shows 10 templates with ID, TITLE, DESCRIPTION
- Sync status: OK (if previously synced) or -- (not synced)
- Usage hint at bottom
vil templates --syncExpected:
- Downloads all 10 templates to
~/vastar/vil/examples/ - Shows progress per template
- "DONE Synced 10 templates, N files"
vil templatesExpected: All 10 show "OK" status
# Disconnect internet / block GitHub
vil templatesExpected: Falls back to local VASTAR_HOME, still shows templates
Test each template with explicit arguments. Each test:
- Init project
- Verify files generated
- Verify package name replaced
- Build (where applicable)
rm -rf ~/vastar/test-ai-gw
vil init test-ai-gw --template ai-gateway --lang rust --port 3080
# Verify
cat ~/vastar/test-ai-gw/Cargo.toml | grep "name"
# Expected: name = "test-ai-gw"
cat ~/vastar/test-ai-gw/src/main.rs | grep "port"
# Expected: .port(3080)
# Build
cd ~/vastar/test-ai-gw && cargo build --release
# Expected: builds without errorrm -rf /tmp/test-blank
vil init /tmp/test-blank --template blank --port 9090
cat /tmp/test-blank/Cargo.toml | grep "name"
# Expected: name = "test-blank"
cat /tmp/test-blank/src/main.rs | grep "port\|transform\|echo\|health"
# Expected: endpoints visiblerm -rf /tmp/test-crud
vil init /tmp/test-crud --template rest-crud
cat /tmp/test-crud/Cargo.toml | grep "name"
# Expected: name = "test-crud"
ls /tmp/test-crud/
# Expected: Cargo.toml, src/main.rs, app.vil.yaml, README.md, vil-server.yamlrm -rf /tmp/test-ws
vil init /tmp/test-ws --template websocket-chat
cat /tmp/test-ws/Cargo.toml | grep "name"
# Expected: name = "test-ws"rm -rf /tmp/test-router
vil init /tmp/test-router --template multi-model-router --port 3090
cat /tmp/test-router/Cargo.toml | grep "name"
cat /tmp/test-router/src/main.rs | grep "UPSTREAM_URL"
# Expected: name = "test-router", upstream URL presentrm -rf /tmp/test-rag
vil init /tmp/test-rag --template rag-pipeline
cat /tmp/test-rag/Cargo.toml | grep "name"
# Expected: name = "test-rag"rm -rf /tmp/test-agent
vil init /tmp/test-agent --template agent
cat /tmp/test-agent/Cargo.toml | grep "name"
# Expected: name = "test-agent"rm -rf /tmp/test-wasm
vil init /tmp/test-wasm --template wasm-faas
cat /tmp/test-wasm/Cargo.toml | grep "name"
# Expected: name = "test-wasm"rm -rf /tmp/test-iot
vil init /tmp/test-iot --template iot-gateway
cat /tmp/test-iot/Cargo.toml | grep "name"
# Expected: name = "test-iot"rm -rf /tmp/test-obs
vil init /tmp/test-obs --template observer-demo
cat /tmp/test-obs/Cargo.toml | grep "name"
# Expected: name = "test-obs"vil initInteraction sequence:
- Project name → type:
wizard-test - Language → type:
1(Rust) - Template list → verify 10 templates from GitHub, not hardcoded 12
- Template → type:
1(AI Gateway) - Token → press Enter (default: shm)
- Port → press Enter (default: 3081)
- Upstream → press Enter (default)
Expected:
- "FETCH Downloading template files..."
- "DONE Project 'wizard-test' created!"
- Files at
~/vastar/wizard-test/
vil initSelect language: 2 (Python)
Expected: Falls back to legacy codegen (not example-based). Generates Python SDK file.
Test selecting template by number (1-10) and by name (e.g., rest-crud).
mkdir -p /tmp/test-exists
vil init /tmp/test-exists --template blankExpected: Error message about directory existing
vil init /tmp/test-invalid --template nonexistentExpected: Error or fallback to legacy. Should not crash.
vil templates --sync # sync first
# Disconnect internet
vil init /tmp/test-offline --template ai-gatewayExpected: Uses local VASTAR_HOME templates, succeeds
rm -rf ~/vastar/vil/examples/ # remove synced templates
# Disconnect internet
vil init /tmp/test-offline2 --template ai-gatewayExpected: Falls back to legacy codegen, still generates project
vil init "/tmp/test with spaces" --template blankExpected: Creates directory with spaces, files generated correctly
Replicate exactly what user sees at vastar.id/products/vil.
# Install Rust (skip if already installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install vastar
curl -sSf https://raw.githubusercontent.com/Vastar-AI/vastar/main/install.sh | sh
vastar --version
# Expected: vastar 0.1.x
# Alternative: hey
# mkdir -p ~/.local/bin
# curl -sL https://hey-release.s3.us-east-2.amazonaws.com/hey_linux_amd64 -o ~/.local/bin/hey
# chmod +x ~/.local/bin/heycargo install vil_cli ai-endpoint-simulator
# List templates
vil templates
# Create project
vil init my-gateway --lang rust --template ai-gateway
# Or use wizard
# vil initVerify:
~/vastar/my-gateway/Cargo.tomlexistsname = "my-gateway"src/main.rshas VilApp code
ai-endpoint-simulator &
cd ~/vastar/my-gateway
cargo run --releaseExpected:
- Simulator on port 4545
- Gateway starts on port 3081
- Shows curl/hey/vastar instructions
# In another terminal
# Curl test
curl -s -X POST http://localhost:3081/api/gw/trigger \
-H 'Content-Type: application/json' \
-d '{"prompt":"hello"}'
# Expected: JSON response with AI content
# Vastar benchmark
vastar -m POST -H 'Content-Type: application/json' \
-d '{"prompt":"bench"}' -c 300 -n 3000 \
http://localhost:3081/api/gw/trigger
# Expected: Summary, histogram, SLO, Insight
# Hey benchmark (if installed)
hey -m POST -H 'Content-Type: application/json' \
-d '{"prompt":"bench"}' -c 300 -n 3000 \
http://localhost:3081/api/gw/trigger
# Expected: Summary with RPSOBSERVER=1 cargo run --releaseOpen browser: http://localhost:3081/_vil/dashboard/
Verify:
- Dashboard loads (dark theme)
- Sidebar: Dashboard + Topology icons
- Throughput gauges update live
- Routes table shows POST /api/gw/trigger
- Right sidebar: SLO Budget, Alerts, System, Config
- Run vastar bench → dashboard shows live metrics
- Click Topology → shows service graph
vastar -n 1000 -c 100 http://localhost:3081/api/gw/triggerVerify:
- Summary section (Total, Slowest, Fastest, Average, RPS)
- Response time distribution (p10 through p99.99)
- Key percentiles highlighted with (ms): p50, p95, p99, p99.9
- Response time histogram (11 buckets, colored bars ■)
- SLO legend (4 rows × 3 columns)
- SLO note: "SLO levels are relative to this run's..."
- Status code distribution (colored: green=200, red=5xx)
- Details (req write, resp wait, resp read)
- Insight (spread, tail, outlier)
- Newline after every section header
# Stop the gateway, then:
vastar -n 100 -c 10 http://localhost:9999/Expected:
- "Errors: 10 total"
- "All 10 requests failed. Is the target running?"
- No histogram, no Insight
# Run gateway, increase concurrency until 502s appear
vastar -n 10000 -c 600 -m POST -H 'Content-Type: application/json' \
-d '{"prompt":"bench"}' http://localhost:3081/api/gw/triggerExpected:
- Status codes: [200] N, [502] M -- Bad Gateway
- Insight: Error rate X% -- CRITICAL (502xM)
- Colored: 200=green, 502=dark red
vastar -n 50000 -c 300 -m POST -T "application/json" \
-d '{"prompt":"bench"}' http://localhost:4545/v1/chat/completionsExpected:
- Live progress: colored ■ bar gradient
- RPS and Avg colored green
- Updates 10 FPS
- No progress when piped:
vastar ... 2>/dev/null
With gateway running (OBSERVER=1):
# Prometheus
curl -s http://localhost:3081/_vil/metrics | head -10
# Expected: Prometheus text format, vil_uptime_seconds, vil_requests_total
# SLO
curl -s http://localhost:3081/_vil/api/slo | python3 -m json.tool
# Expected: target_pct, current_pct, budget_remaining, status
# Alerts
curl -s http://localhost:3081/_vil/api/alerts | python3 -m json.tool
# Expected: alerts array (empty if no issues)
# Routes
curl -s http://localhost:3081/_vil/api/routes | python3 -m json.tool
# Expected: route info with method, path, latency percentiles
# System
curl -s http://localhost:3081/_vil/api/system | python3 -m json.tool
# Expected: pid, cpu_count, memory_rss_kb, uptime_secs
# Health
curl -s http://localhost:3081/_vil/api/health
# Expected: {"status":"healthy",...}| Test Area | Cases | Priority |
|---|---|---|
vil templates |
list, sync, offline fallback | High |
vil init (10 templates) |
each template, file verification, name replacement | High |
vil init wizard |
full flow, language fallback, template selection | High |
vil init edge cases |
exists, invalid, offline, spaces | Medium |
| Website quickstart | Step 0-4, exact copy-paste from website | Critical |
| Vastar Bench output | all sections, errors, progress bar | High |
| Observer dashboard | UI, API endpoints, SLO, alerts | High |
| Observer Prometheus | scrape format, per-route metrics | Medium |
- Package name with full path —
vil init /tmp/test-x --template blankmay set name to/tmp/test-xinstead oftest-x. Fix deployed in v0.1.18 but verify. - Wizard template list — should show 10 dynamic templates from GitHub, not 12 hardcoded. Verify wizard fetches from GitHub.
- SLO Budget "exhausted" at 0 requests — fixed, should show "healthy" when no traffic. Verify.
- Vastar progress bar — only visible when stderr is a TTY. When piped (
2>/dev/null), no progress output. - Observer alert logging — alerts print to stderr with
[VIL ALERT]prefix. Check server terminal output during high-error bench.
rm -rf ~/vastar/test-*
rm -rf ~/vastar/my-gateway
rm -rf ~/vastar/wizard-test
rm -rf /tmp/test-*
pkill ai-endpoint-simulatorContact: Engineering team for any blockers or unexpected behavior.