Skip to content

feat(ci): Milvus integration tests and CLI flags for CI #6

feat(ci): Milvus integration tests and CLI flags for CI

feat(ci): Milvus integration tests and CLI flags for CI #6

name: Integration tests
on:
workflow_dispatch:
pull_request:
branches: [main]
types: [opened, synchronize, reopened]
paths-ignore:
- "**/*.md"
- "docs/**"
concurrency:
group: integration-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
MILVUS_URI: http://127.0.0.1:19530
jobs:
integration:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Resolve latest stable Milvus image tag
id: milvus
run: |
TAG=$(curl -sL https://api.github.com/repos/milvus-io/milvus/releases/latest | python3 -c "import sys, json; print(json.load(sys.stdin)['tag_name'])")
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "Using Milvus release ${TAG}"
- name: Install pymilvus (readiness probe)
run: |
python -m pip install --upgrade pip
pip install "pymilvus>=2.6.0"
- name: Start Milvus (standalone)
env:
MILVUS_IMAGE_TAG: ${{ steps.milvus.outputs.tag }}
run: |
wget -q https://raw.githubusercontent.com/milvus-io/milvus/master/deployments/docker/standalone/docker-compose.yml -O docker-compose.yml
sed -i "s|milvusdb/milvus:.*|milvusdb/milvus:${MILVUS_IMAGE_TAG}|g" docker-compose.yml
docker compose up -d
- name: Wait for MinIO
run: |
for i in $(seq 1 30); do
if curl -sf http://127.0.0.1:9000/minio/health/live; then
echo "MinIO is ready"
exit 0
fi
echo "attempt $i/30..."
sleep 2
done
exit 1
- name: Wait for Milvus
run: |
python << 'EOF'
import time
from pymilvus import connections
for _ in range(60):
try:
connections.connect(uri="http://127.0.0.1:19530")
connections.disconnect("default")
print("Milvus is ready")
break
except Exception:
time.sleep(2)
else:
raise SystemExit("Milvus did not become ready in time")
EOF
- name: Install package and pytest
run: |
pip install pytest
pip install .
- name: Run integration tests
env:
MILVUS_URI: ${{ env.MILVUS_URI }}
run: pytest tests/ -v --tb=short
- name: Print Docker logs on failure
if: failure()
run: docker compose logs --no-color || true