Skip to content

Commit 8ed0eab

Browse files
authored
Fix e2e tests CI (#452)
* Test another version of the workflow * Wait for neo4j to be ready * Wait for indexes to be online * Ruff * Use text property in fulltext index tests * Another try without waiting for online index * Drop online index function not needed * Drop online index function not needed
1 parent c7653df commit 8ed0eab

File tree

4 files changed

+106
-75
lines changed

4 files changed

+106
-75
lines changed

.github/workflows/pr-e2e-tests.yaml

Lines changed: 50 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,6 @@ jobs:
1818
python-version: ['3.9', '3.13']
1919
neo4j-tag:
2020
- 'latest'
21-
services:
22-
t2v-transformers:
23-
image: cr.weaviate.io/semitechnologies/transformers-inference:sentence-transformers-all-MiniLM-L6-v2
24-
env:
25-
ENABLE_CUDA: '0'
26-
weaviate:
27-
image: cr.weaviate.io/semitechnologies/weaviate:1.25.1
28-
env:
29-
TRANSFORMERS_INFERENCE_API: 'http://t2v-transformers:8080'
30-
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
31-
DEFAULT_VECTORIZER_MODULE: 'text2vec-transformers'
32-
ENABLE_MODULES: 'text2vec-transformers'
33-
CLUSTER_HOSTNAME: 'node1'
34-
ports:
35-
- 8080:8080
36-
- 50051:50051
37-
neo4j:
38-
image: neo4j:${{ matrix.neo4j-tag }}
39-
env:
40-
NEO4J_AUTH: neo4j/password
41-
NEO4J_ACCEPT_LICENSE_AGREEMENT: 'eval'
42-
NEO4J_PLUGINS: '["apoc"]'
43-
ports:
44-
- 7687:7687
45-
- 7474:7474
46-
qdrant:
47-
image: qdrant/qdrant
48-
ports:
49-
- 6333:6333
50-
5121
steps:
5222
- name: Check out repository code
5323
uses: actions/checkout@v4
@@ -62,6 +32,40 @@ jobs:
6232
docker builder prune -af || true
6333
sudo apt-get clean || true
6434
df -h
35+
- name: Create Docker network
36+
run: docker network create test-network
37+
- name: Start t2v-transformers
38+
run: |
39+
docker run -d --name t2v-transformers \
40+
--network test-network \
41+
-e ENABLE_CUDA=0 \
42+
cr.weaviate.io/semitechnologies/transformers-inference:sentence-transformers-all-MiniLM-L6-v2
43+
- name: Start Weaviate
44+
run: |
45+
docker run -d --name weaviate \
46+
--network test-network \
47+
-p 8080:8080 -p 50051:50051 \
48+
-e TRANSFORMERS_INFERENCE_API='http://t2v-transformers:8080' \
49+
-e AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED='true' \
50+
-e DEFAULT_VECTORIZER_MODULE='text2vec-transformers' \
51+
-e ENABLE_MODULES='text2vec-transformers' \
52+
-e CLUSTER_HOSTNAME='node1' \
53+
cr.weaviate.io/semitechnologies/weaviate:1.25.1
54+
- name: Start Neo4j
55+
run: |
56+
docker run -d --name neo4j \
57+
--network test-network \
58+
-p 7687:7687 -p 7474:7474 \
59+
-e NEO4J_AUTH=neo4j/password \
60+
-e NEO4J_ACCEPT_LICENSE_AGREEMENT=eval \
61+
-e NEO4J_PLUGINS='["apoc"]' \
62+
neo4j:${{ matrix.neo4j-tag }}
63+
- name: Start Qdrant
64+
run: |
65+
docker run -d --name qdrant \
66+
--network test-network \
67+
-p 6333:6333 \
68+
qdrant/qdrant
6569
- name: Set up Python ${{ matrix.python-version }}
6670
uses: actions/setup-python@v5
6771
with:
@@ -93,6 +97,22 @@ jobs:
9397
run: |
9498
set +e
9599
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
100+
- name: Wait for Neo4j to be ready
101+
shell: bash
102+
run: |
103+
echo "Waiting for Neo4j to be ready..."
104+
count=0
105+
until curl -s --fail http://localhost:7474 > /dev/null 2>&1; do
106+
((count++))
107+
if [ $count -ge 30 ]; then
108+
echo "Neo4j failed to start within timeout"
109+
docker logs neo4j
110+
exit 1
111+
fi
112+
echo "Waiting for Neo4j... (attempt $count/30)"
113+
sleep 5
114+
done
115+
echo "Neo4j is ready!"
96116
- name: Run tests
97117
shell: bash
98118
run: |

.github/workflows/scheduled-e2e-tests.yaml

Lines changed: 51 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
push:
88
branches:
99
- main
10-
10+
1111
concurrency:
1212
group: ${{ github.workflow }}-${{ github.ref_name }}
1313
cancel-in-progress: true
@@ -22,45 +22,6 @@ jobs:
2222
- '5-community'
2323
- '5-enterprise'
2424
- 'latest'
25-
services:
26-
t2v-transformers:
27-
image: cr.weaviate.io/semitechnologies/transformers-inference:sentence-transformers-all-MiniLM-L6-v2
28-
env:
29-
ENABLE_CUDA: '0'
30-
credentials:
31-
username: ${{ secrets.DOCKERHUB_USERNAME }}
32-
password: ${{ secrets.DOCKERHUB_TOKEN }}
33-
weaviate:
34-
image: cr.weaviate.io/semitechnologies/weaviate:1.25.1
35-
env:
36-
TRANSFORMERS_INFERENCE_API: 'http://t2v-transformers:8080'
37-
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
38-
DEFAULT_VECTORIZER_MODULE: 'text2vec-transformers'
39-
ENABLE_MODULES: 'text2vec-transformers'
40-
CLUSTER_HOSTNAME: 'node1'
41-
ports:
42-
- 8080:8080
43-
- 50051:50051
44-
credentials:
45-
username: ${{ secrets.DOCKERHUB_USERNAME }}
46-
password: ${{ secrets.DOCKERHUB_TOKEN }}
47-
neo4j:
48-
image: neo4j:${{ matrix.neo4j-tag }}
49-
env:
50-
NEO4J_AUTH: neo4j/password
51-
NEO4J_ACCEPT_LICENSE_AGREEMENT: 'eval'
52-
NEO4J_PLUGINS: '["apoc"]'
53-
ports:
54-
- 7687:7687
55-
- 7474:7474
56-
credentials:
57-
username: ${{ secrets.DOCKERHUB_USERNAME }}
58-
password: ${{ secrets.DOCKERHUB_TOKEN }}
59-
qdrant:
60-
image: qdrant/qdrant
61-
ports:
62-
- 6333:6333
63-
6425
steps:
6526
- name: Check out repository code
6627
uses: actions/checkout@v4
@@ -75,6 +36,40 @@ jobs:
7536
docker builder prune -af || true
7637
sudo apt-get clean || true
7738
df -h
39+
- name: Create Docker network
40+
run: docker network create test-network
41+
- name: Start t2v-transformers
42+
run: |
43+
docker run -d --name t2v-transformers \
44+
--network test-network \
45+
-e ENABLE_CUDA=0 \
46+
cr.weaviate.io/semitechnologies/transformers-inference:sentence-transformers-all-MiniLM-L6-v2
47+
- name: Start Weaviate
48+
run: |
49+
docker run -d --name weaviate \
50+
--network test-network \
51+
-p 8080:8080 -p 50051:50051 \
52+
-e TRANSFORMERS_INFERENCE_API='http://t2v-transformers:8080' \
53+
-e AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED='true' \
54+
-e DEFAULT_VECTORIZER_MODULE='text2vec-transformers' \
55+
-e ENABLE_MODULES='text2vec-transformers' \
56+
-e CLUSTER_HOSTNAME='node1' \
57+
cr.weaviate.io/semitechnologies/weaviate:1.25.1
58+
- name: Start Neo4j
59+
run: |
60+
docker run -d --name neo4j \
61+
--network test-network \
62+
-p 7687:7687 -p 7474:7474 \
63+
-e NEO4J_AUTH=neo4j/password \
64+
-e NEO4J_ACCEPT_LICENSE_AGREEMENT=eval \
65+
-e NEO4J_PLUGINS='["apoc"]' \
66+
neo4j:${{ matrix.neo4j-tag }}
67+
- name: Start Qdrant
68+
run: |
69+
docker run -d --name qdrant \
70+
--network test-network \
71+
-p 6333:6333 \
72+
qdrant/qdrant
7873
- name: Set up Python ${{ matrix.python-version }}
7974
uses: actions/setup-python@v5
8075
with:
@@ -106,6 +101,22 @@ jobs:
106101
run: |
107102
set +e
108103
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
104+
- name: Wait for Neo4j to be ready
105+
shell: bash
106+
run: |
107+
echo "Waiting for Neo4j to be ready..."
108+
count=0
109+
until curl -s --fail http://localhost:7474 > /dev/null 2>&1; do
110+
((count++))
111+
if [ $count -ge 30 ]; then
112+
echo "Neo4j failed to start within timeout"
113+
docker logs neo4j
114+
exit 1
115+
fi
116+
echo "Waiting for Neo4j... (attempt $count/30)"
117+
sleep 5
118+
done
119+
echo "Neo4j is ready!"
109120
- name: Run tests
110121
shell: bash
111122
run: |

tests/e2e/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def setup_neo4j_for_retrieval(driver: Driver) -> None:
134134
driver,
135135
fulltext_index_name,
136136
label="Document",
137-
node_properties=["vectorProperty"],
137+
node_properties=["short_text_property"],
138138
)
139139

140140
# Insert 10 vectors and authors

tests/e2e/test_indexes_e2e.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def test_retrieve_fulltext_index_info_happy_path(driver: neo4j.Driver) -> None:
133133
labels_or_types = index_info.get("labelsOrTypes")
134134
assert labels_or_types == ["Document"]
135135
properties = index_info.get("properties")
136-
assert properties == ["vectorProperty"]
136+
assert properties == ["short_text_property"]
137137
entity_type = index_info.get("entityType")
138138
assert entity_type == "NODE"
139139

@@ -144,7 +144,7 @@ def test_retrieve_fulltext_index_info_no_index_name(driver: neo4j.Driver) -> Non
144144
driver=driver,
145145
index_name="",
146146
label_or_type="Document",
147-
text_properties=["vectorProperty"],
147+
text_properties=["short_text_property"],
148148
)
149149
assert index_info is not None
150150
index_name = index_info.get("name")
@@ -154,7 +154,7 @@ def test_retrieve_fulltext_index_info_no_index_name(driver: neo4j.Driver) -> Non
154154
labels_or_types = index_info.get("labelsOrTypes")
155155
assert labels_or_types == ["Document"]
156156
properties = index_info.get("properties")
157-
assert properties == ["vectorProperty"]
157+
assert properties == ["short_text_property"]
158158
entity_type = index_info.get("entityType")
159159
assert entity_type == "NODE"
160160

@@ -177,7 +177,7 @@ def test_retrieve_fulltext_index_info_no_label_or_properties(
177177
labels_or_types = index_info.get("labelsOrTypes")
178178
assert labels_or_types == ["Document"]
179179
properties = index_info.get("properties")
180-
assert properties == ["vectorProperty"]
180+
assert properties == ["short_text_property"]
181181
entity_type = index_info.get("entityType")
182182
assert entity_type == "NODE"
183183

0 commit comments

Comments
 (0)