Skip to content

Commit 1347f5c

Browse files
[0.8] fix flow tests (#501)
fix flow tests (#494) * fix flow tests use ml_dtypes for bfloat update numpy to latest bindings/cmake: * add min version * make VecSim library PRIVATE add verbose option to make flow_test * add verbose to pull request event * update cmake version * enable temp flow * run flow tests * try using poetry action * install poetry script * don't install curl on rocky * minimum cmake version cmake 25 (cherry picked from commit 8d5bd88) Co-authored-by: meiravgri <109056284+meiravgri@users.noreply.github.com>
1 parent 028139c commit 1347f5c

File tree

6 files changed

+44
-14
lines changed

6 files changed

+44
-14
lines changed

.github/workflows/event-pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: unit tests
3333
run: make unit_test
3434
- name: flow tests
35-
run: make flow_test
35+
run: make flow_test VERBOSE=1
3636

3737
coverage:
3838
needs: [basic-tests, check-if-docs-only]

.github/workflows/flow-temp.yml

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,46 @@ on:
1111
push:
1212
branches-ignore: ['**'] # ignore all branches. Comment this line to run your workflow below on every push.
1313
jobs:
14-
rocky8:
14+
jammy:
1515
uses: ./.github/workflows/task-unit-test.yml
1616
with:
17-
container: rockylinux:8
17+
container: ubuntu:jammy
1818
run-valgrind: false
19-
run-codecov: false
20-
rocky9:
19+
focal:
2120
uses: ./.github/workflows/task-unit-test.yml
2221
with:
23-
container: rockylinux:9
22+
container: ubuntu:focal
2423
run-valgrind: false
25-
run-codecov: false
26-
focal:
24+
bionic:
2725
uses: ./.github/workflows/task-unit-test.yml
2826
with:
2927
container: ubuntu:focal
3028
run-valgrind: false
31-
run-codecov: true
29+
bullseye:
30+
uses: ./.github/workflows/task-unit-test.yml
31+
with:
32+
container: debian:bullseye
33+
run-valgrind: false
34+
amazonlinux2:
35+
uses: ./.github/workflows/task-unit-test.yml
36+
with:
37+
container: amazonlinux:2
38+
pre-checkout-script: yum install -y tar gzip
39+
run-valgrind: false
40+
mariner2:
41+
uses: ./.github/workflows/mariner2.yml
42+
rocky8:
43+
uses: ./.github/workflows/task-unit-test.yml
44+
with:
45+
container: rockylinux:8
46+
run-valgrind: false
47+
rocky9:
48+
uses: ./.github/workflows/task-unit-test.yml
49+
with:
50+
container: rockylinux:9
51+
run-valgrind: false
52+
macos:
53+
uses: ./.github/workflows/macos.yml
54+
arm:
55+
uses: ./.github/workflows/arm.yml
56+
secrets: inherit

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ make unit_test # run unit tests
7575
make valgrind # build for Valgrind and run tests
7676
make flow_test # run flow tests (with pytest)
7777
TEST=file::name # run specific test
78+
VERBOSE=1 # print detailed bindings build info
7879
make mod_test # run Redis module intergration tests (with RLTest)
7980
TEST=file:name # run specific test
8081
VERBOSE=1 # show more test detail
@@ -190,9 +191,12 @@ valgrind:
190191
.PHONY: unit_test valgrind
191192

192193
#----------------------------------------------------------------------------------------------
194+
ifeq ($(VERBOSE),1)
195+
POETRY_ARGS += -vv
196+
endif
193197

194198
flow_test:
195-
$(SHOW)poetry install
199+
$(SHOW)poetry install $(POETRY_ARGS)
196200
$(SHOW)poetry run pytest tests/flow/$(TEST) -v -s
197201

198202
.PHONY: flow_test

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ classifiers = [
2626
python = "^3.10"
2727

2828
[tool.poetry.dev-dependencies]
29-
numpy = "^1.26"
29+
numpy = "*"
3030
hnswlib = "^0.6.2"
3131
pytest = "^6.2.4"
3232
scipy = "^1.10.1"
3333
h5py = "^3.7.0"
34-
bfloat16 = "^1.1"
34+
ml_dtypes = "*"
3535

3636

3737
[build-system]

src/python_bindings/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
cmake_minimum_required(VERSION 3.25)
12
project(VecSim LANGUAGES CXX)
23
set(CMAKE_CXX_STANDARD 20)
34

@@ -25,6 +26,6 @@ include_directories(${root}/src ${root}/tests/utils)
2526

2627
pybind11_add_module(VecSim ../../tests/utils/mock_thread_pool.cpp bindings.cpp)
2728

28-
target_link_libraries(VecSim VectorSimilarity)
29+
target_link_libraries(VecSim PRIVATE VectorSimilarity)
2930

3031
add_dependencies(VecSim VectorSimilarity)

tests/flow/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from numpy.testing import assert_allclose, assert_equal
99
import time
1010
import math
11-
from bfloat16 import bfloat16
11+
from ml_dtypes import bfloat16
1212

1313
def create_hnsw_params(dim, num_elements, metric, data_type, ef_construction=200, m=16, ef_runtime=10, epsilon=0.01,
1414
is_multi=False):

0 commit comments

Comments
 (0)