30 lines
822 B
Bash
Executable File
30 lines
822 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "${ROOT_DIR}"
|
|
|
|
log() {
|
|
printf '[smoke] %s\n' "$*"
|
|
}
|
|
|
|
log "Bootstrapping demo repo"
|
|
./scripts/bootstrap.sh
|
|
|
|
log "Starting services"
|
|
docker compose up -d --build
|
|
|
|
log "Checking health"
|
|
curl -fsS http://127.0.0.1:8181/health >/dev/null
|
|
curl -fsS http://127.0.0.1:8787/health >/dev/null
|
|
|
|
log "Running query through memory-gateway"
|
|
query_output="$(curl -fsS -X POST http://127.0.0.1:8787/query \
|
|
-H 'content-type: application/json' \
|
|
-d '{"branch":"main","query_type":"search","query":"router","require_latest":true,"debug":true}')"
|
|
printf '%s\n' "${query_output}"
|
|
printf '%s\n' "${query_output}" | grep -F 'commit_hash' >/dev/null
|
|
printf '%s\n' "${query_output}" | grep -F 'branch' >/dev/null
|
|
|
|
log "Smoke test passed"
|