-
Notifications
You must be signed in to change notification settings - Fork 187
134 lines (131 loc) · 4.74 KB
/
pr-e2e-tests.yaml
File metadata and controls
134 lines (131 loc) · 4.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: 'Neo4j-GraphRAG PR E2E Tests'
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
e2e-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.14']
neo4j-tag:
- 'latest'
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Free up disk space (ubuntu-latest)
run: |
sudo rm -rf /usr/local/lib/android \
/usr/share/dotnet \
/opt/ghc \
/opt/hostedtoolcache
docker system prune -af || true
docker volume prune -f || true
docker builder prune -af || true
sudo apt-get clean || true
df -h
- name: Create Docker network
run: docker network create test-network
- name: Start t2v-transformers
run: |
for i in 1 2 3; do
docker pull cr.weaviate.io/semitechnologies/transformers-inference:sentence-transformers-all-MiniLM-L6-v2 \
&& break || sleep $((30 + RANDOM % 30))
done
docker run -d --name t2v-transformers \
--network test-network \
-e ENABLE_CUDA=0 \
cr.weaviate.io/semitechnologies/transformers-inference:sentence-transformers-all-MiniLM-L6-v2
- name: Start Weaviate
run: |
for i in 1 2 3; do
docker pull cr.weaviate.io/semitechnologies/weaviate:1.27.0 \
&& break || sleep $((30 + RANDOM % 30))
done
docker run -d --name weaviate \
--network test-network \
-p 8080:8080 -p 50051:50051 \
-e TRANSFORMERS_INFERENCE_API='http://t2v-transformers:8080' \
-e AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED='true' \
-e DEFAULT_VECTORIZER_MODULE='text2vec-transformers' \
-e ENABLE_MODULES='text2vec-transformers' \
-e CLUSTER_HOSTNAME='node1' \
cr.weaviate.io/semitechnologies/weaviate:1.27.0
- name: Start Neo4j
run: |
for i in 1 2 3; do
docker pull neo4j:${{ matrix.neo4j-tag }} \
&& break || sleep $((30 + RANDOM % 30))
done
docker run -d --name neo4j \
--network test-network \
-p 7687:7687 -p 7474:7474 \
-e NEO4J_AUTH=neo4j/password \
-e NEO4J_ACCEPT_LICENSE_AGREEMENT=eval \
-e NEO4J_PLUGINS='["apoc"]' \
neo4j:${{ matrix.neo4j-tag }}
- name: Start Qdrant
run: |
for i in 1 2 3; do
docker pull qdrant/qdrant \
&& break || sleep $((30 + RANDOM % 30))
done
docker run -d --name qdrant \
--network test-network \
-p 6333:6333 \
qdrant/qdrant
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv
uses: astral-sh/setup-uv@v3
- name: Load cached venv
id: cached-venv
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('**/uv.lock') }}
- name: Install dependencies
if: steps.cached-venv.outputs.cache-hit != 'true'
run: uv sync --frozen --all-extras --group dev
- name: Show disk usage after dependency installation
run: |
df -h
- name: Wait for Weaviate to start
shell: bash
run: |
set +e
count=0; until curl -s --fail localhost:8080/v1/.well-known/ready; do ((count++)); [ $count -ge 10 ] && echo "Reached maximum retry limit" && exit 1; sleep 15; done
- name: Wait for Neo4j to be ready
shell: bash
run: |
echo "Waiting for Neo4j to be ready..."
count=0
until curl -s --fail http://localhost:7474 > /dev/null 2>&1; do
((count++))
if [ $count -ge 30 ]; then
echo "Neo4j failed to start within timeout"
docker logs neo4j
exit 1
fi
echo "Waiting for Neo4j... (attempt $count/30)"
sleep 5
done
echo "Neo4j is ready!"
- name: Run tests
shell: bash
run: |
if [[ "${{ matrix.neo4j-tag }}" == "latest" || "${{ matrix.neo4j-tag }}" == "community" ]]; then
uv run pytest -m 'not enterprise_only' ./tests/e2e
else
uv run pytest ./tests/e2e
fi
- name: Prune uv cache
if: always()
run: uv cache prune --ci