4a19d70af1
Lint with Ruff / ruff (push) Has been cancelled
MCP Server Tests / live-mcp-tests (push) Has been cancelled
Tests / unit-tests (push) Has been cancelled
Tests / database-integration-tests (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Server Tests / live-server-tests (push) Has been cancelled
Pyright Type Check / pyright (push) Has been cancelled
108 lines
4.1 KiB
YAML
108 lines
4.1 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
unit-tests:
|
|
runs-on: depot-ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
- name: Set up Python
|
|
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
|
with:
|
|
python-version: "3.10"
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3
|
|
with:
|
|
version: "latest"
|
|
- name: Install dependencies
|
|
run: uv sync --all-extras
|
|
- name: Run unit tests (no external dependencies)
|
|
env:
|
|
PYTHONPATH: ${{ github.workspace }}
|
|
DISABLE_NEPTUNE: 1
|
|
DISABLE_NEO4J: 1
|
|
DISABLE_FALKORDB: 1
|
|
DISABLE_KUZU: 1
|
|
run: |
|
|
uv run pytest tests/ -m "not integration" \
|
|
--ignore=tests/test_graphiti_int.py \
|
|
--ignore=tests/test_graphiti_mock.py \
|
|
--ignore=tests/test_node_int.py \
|
|
--ignore=tests/test_edge_int.py \
|
|
--ignore=tests/test_entity_exclusion_int.py \
|
|
--ignore=tests/driver/ \
|
|
--ignore=tests/llm_client/test_anthropic_client_int.py \
|
|
--ignore=tests/utils/maintenance/test_temporal_operations_int.py \
|
|
--ignore=tests/cross_encoder/test_bge_reranker_client_int.py \
|
|
--ignore=tests/evals/
|
|
|
|
database-integration-tests:
|
|
runs-on: depot-ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
- name: Set up Python
|
|
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
|
with:
|
|
python-version: "3.10"
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3
|
|
with:
|
|
version: "latest"
|
|
- name: Start databases
|
|
# Run the databases ourselves on the host network rather than via a GitHub
|
|
# Actions `services:` block. On the depot-ubuntu runner pool, bridge-network
|
|
# NAT silently drops packets to published service-container ports, so the job
|
|
# host can't reach a `services:` container (connect black-holes -> the wait step
|
|
# times out with exit 124). `services:` always uses bridge networking and can't
|
|
# be overridden, so we use `docker run --network host` instead. Readiness is
|
|
# checked via `docker exec`, which doesn't depend on host->container networking.
|
|
run: |
|
|
docker run -d --name falkordb --network host falkordb/falkordb:latest
|
|
docker run -d --name neo4j --network host \
|
|
-e NEO4J_AUTH=neo4j/testpass \
|
|
-e NEO4J_PLUGINS='["apoc"]' \
|
|
neo4j:5.26-community
|
|
- name: Install dependencies
|
|
run: uv sync --all-extras
|
|
- name: Wait for databases
|
|
run: |
|
|
for i in $(seq 1 30); do
|
|
if docker exec falkordb redis-cli ping 2>/dev/null | grep -q PONG; then
|
|
echo "falkordb ready after ${i}s"; break
|
|
fi
|
|
if [ "$i" -eq 30 ]; then echo "falkordb did not become ready in 30s" >&2; docker logs falkordb; exit 1; fi
|
|
sleep 1
|
|
done
|
|
for i in $(seq 1 60); do
|
|
if docker exec neo4j cypher-shell -u neo4j -p testpass 'RETURN 1' >/dev/null 2>&1; then
|
|
echo "neo4j ready after ${i}s"; break
|
|
fi
|
|
if [ "$i" -eq 60 ]; then echo "neo4j did not become ready in 60s" >&2; docker logs neo4j; exit 1; fi
|
|
sleep 1
|
|
done
|
|
- name: Run database integration tests
|
|
env:
|
|
PYTHONPATH: ${{ github.workspace }}
|
|
NEO4J_URI: bolt://127.0.0.1:7687
|
|
NEO4J_USER: neo4j
|
|
NEO4J_PASSWORD: testpass
|
|
FALKORDB_HOST: 127.0.0.1
|
|
FALKORDB_PORT: 6379
|
|
DISABLE_NEPTUNE: 1
|
|
run: |
|
|
uv run pytest \
|
|
tests/test_graphiti_mock.py \
|
|
tests/test_node_int.py \
|
|
tests/test_edge_int.py \
|
|
tests/cross_encoder/test_bge_reranker_client_int.py \
|
|
tests/driver/test_falkordb_driver.py \
|
|
-m "not integration"
|