test: run pytest in CI — real unit job + Qdrant-backed integration job #52

Merged
jcabillot merged 10 commits from tests/ci-pytest into main 2026-10-09 15:53:53 -04:00
4 changed files with 173 additions and 10 deletions
Showing only changes of commit de27820cc7 - Show all commits

No files matched your search

+52 -3
View File
@@ -18,11 +18,60 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
- run: docker build -f pkg/Dockerfile -t ci-image:${{ github.sha }} .
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: "3.13"
- name: Install dependencies
run: pip install -r requirements.txt pytest
- name: Run unit tests
run: pytest tests/ -v
env:
# indexer/server read env at import; unit tests need no real backend
QDRANT_URL: http://localhost:6333
COLLECTION_NAME: test
integration-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Cleanup old Qdrant container
run: |
docker rm -f mcp-maildir-ci-qdrant 2>/dev/null || true
- name: Start Qdrant
run: |
docker run -d --name mcp-maildir-ci-qdrant \
--network "container:$(hostname)" \
docker.io/qdrant/qdrant:latest
- name: Wait for Qdrant
run: |
for i in $(seq 1 30); do
curl -s http://localhost:6333/healthz \
&& echo "QDRANT ready" && break
echo "Waiting for Qdrant... ($i/30)"
sleep 1
done
curl -s http://localhost:6333/healthz > /dev/null
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: "3.13"
- name: Install dependencies
run: pip install -r requirements.txt pytest
- name: Run integration tests
run: pytest tests/ -v -m integration
env:
QDRANT_URL: http://localhost:6333
COLLECTION_NAME: test_mcp_maildir
- name: Cleanup Qdrant
if: always()
run: docker rm -f mcp-maildir-ci-qdrant || true
build-push:
needs: [test]
needs: [test, integration-test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
+52 -3
View File
@@ -18,11 +18,60 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
- run: docker build -f pkg/Dockerfile -t ci-image:${{ github.sha }} .
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: "3.13"
- name: Install dependencies
run: pip install -r requirements.txt pytest
- name: Run unit tests
run: pytest tests/ -v
env:
# indexer/server read env at import; unit tests need no real backend
QDRANT_URL: http://localhost:6333
COLLECTION_NAME: test
integration-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Cleanup old Qdrant container
run: |
docker rm -f mcp-maildir-ci-qdrant 2>/dev/null || true
- name: Start Qdrant
run: |
docker run -d --name mcp-maildir-ci-qdrant \
--network "container:$(hostname)" \
docker.io/qdrant/qdrant:latest
- name: Wait for Qdrant
run: |
for i in $(seq 1 30); do
curl -s http://localhost:6333/healthz \
&& echo "QDRANT ready" && break
echo "Waiting for Qdrant... ($i/30)"
sleep 1
done
curl -s http://localhost:6333/healthz > /dev/null
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: "3.13"
- name: Install dependencies
run: pip install -r requirements.txt pytest
- name: Run integration tests
run: pytest tests/ -v -m integration
env:
QDRANT_URL: http://localhost:6333
COLLECTION_NAME: test_mcp_maildir
- name: Cleanup Qdrant
if: always()
run: docker rm -f mcp-maildir-ci-qdrant || true
build:
needs: [test]
needs: [test, integration-test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
+17 -1
View File
@@ -14,9 +14,25 @@ jobs:
with:
dockerfile: pkg/Dockerfile
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: "3.13"
- name: Install dependencies
run: pip install -r requirements.txt pytest
- name: Run unit tests
run: pytest tests/ -v
env:
# indexer/server read env at import; unit tests need no real backend
QDRANT_URL: http://localhost:6333
COLLECTION_NAME: test
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
- run: docker build -f pkg/Dockerfile -t ci-image:${{ github.sha }} .
- run: docker build -f pkg/Dockerfile -t ci-image:${{ github.sha }} .
+52 -3
View File
@@ -18,11 +18,60 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
- run: docker build -f pkg/Dockerfile -t ci-image:${{ github.sha }} .
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: "3.13"
- name: Install dependencies
run: pip install -r requirements.txt pytest
- name: Run unit tests
run: pytest tests/ -v
env:
# indexer/server read env at import; unit tests need no real backend
QDRANT_URL: http://localhost:6333
COLLECTION_NAME: test
integration-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Cleanup old Qdrant container
run: |
docker rm -f mcp-maildir-ci-qdrant 2>/dev/null || true
- name: Start Qdrant
run: |
docker run -d --name mcp-maildir-ci-qdrant \
--network "container:$(hostname)" \
docker.io/qdrant/qdrant:latest
- name: Wait for Qdrant
run: |
for i in $(seq 1 30); do
curl -s http://localhost:6333/healthz \
&& echo "QDRANT ready" && break
echo "Waiting for Qdrant... ($i/30)"
sleep 1
done
curl -s http://localhost:6333/healthz > /dev/null
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: "3.13"
- name: Install dependencies
run: pip install -r requirements.txt pytest
- name: Run integration tests
run: pytest tests/ -v -m integration
env:
QDRANT_URL: http://localhost:6333
COLLECTION_NAME: test_mcp_maildir
- name: Cleanup Qdrant
if: always()
run: docker rm -f mcp-maildir-ci-qdrant || true
build-push:
needs: [test]
needs: [test, integration-test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7