From a145c7dc275b3ae22001a60dfcd9ec4bd00d56fe Mon Sep 17 00:00:00 2001 From: samsja Date: Thu, 30 Mar 2023 10:28:19 +0200 Subject: [PATCH 1/4] fix: mark es test as index Signed-off-by: samsja --- tests/index/elastic/v7/test_column_config.py | 3 +++ tests/index/elastic/v7/test_find.py | 3 +++ tests/index/elastic/v7/test_index_get_del.py | 2 ++ 3 files changed, 8 insertions(+) diff --git a/tests/index/elastic/v7/test_column_config.py b/tests/index/elastic/v7/test_column_config.py index 80f42c6a347..a0d4aa4dec9 100644 --- a/tests/index/elastic/v7/test_column_config.py +++ b/tests/index/elastic/v7/test_column_config.py @@ -1,9 +1,12 @@ +import pytest from pydantic import Field from docarray import BaseDoc from docarray.index import ElasticV7DocIndex from tests.index.elastic.fixture import start_storage_v7 # noqa: F401 +pytestmark = [pytest.mark.slow, pytest.mark.index] + def test_column_config(): class MyDoc(BaseDoc): diff --git a/tests/index/elastic/v7/test_find.py b/tests/index/elastic/v7/test_find.py index 562b6f68326..6665c8b2b60 100644 --- a/tests/index/elastic/v7/test_find.py +++ b/tests/index/elastic/v7/test_find.py @@ -1,4 +1,5 @@ import numpy as np +import pytest import torch from pydantic import Field @@ -8,6 +9,8 @@ from tests.index.elastic.fixture import start_storage_v7 # noqa: F401 from tests.index.elastic.fixture import FlatDoc, SimpleDoc +pytestmark = [pytest.mark.slow, pytest.mark.index] + def test_find_simple_schema(): class SimpleSchema(BaseDoc): diff --git a/tests/index/elastic/v7/test_index_get_del.py b/tests/index/elastic/v7/test_index_get_del.py index 8389e28ffbb..09722e22cf8 100644 --- a/tests/index/elastic/v7/test_index_get_del.py +++ b/tests/index/elastic/v7/test_index_get_del.py @@ -10,6 +10,8 @@ from tests.index.elastic.fixture import start_storage_v7 # noqa: F401 from tests.index.elastic.fixture import DeepNestedDoc, FlatDoc, NestedDoc, SimpleDoc +pytestmark = [pytest.mark.slow, pytest.mark.index] + @pytest.fixture def ten_simple_docs(): From a78e6c5c3f9bd94a660ef5aa1ebacb2efb5a5500 Mon Sep 17 00:00:00 2001 From: samsja Date: Thu, 30 Mar 2023 10:34:47 +0200 Subject: [PATCH 2/4] fix: mark es test as index Signed-off-by: samsja --- tests/integrations/doc_index/__init__.py | 0 tests/integrations/doc_index/elastic/__init__.py | 0 .../{index => integrations/doc_index}/elastic/fixture.py | 0 tests/integrations/doc_index/elastic/v7/__init__.py | 0 .../doc_index}/elastic/v7/docker-compose.yml | 0 .../doc_index}/elastic/v7/test_column_config.py | 2 +- .../doc_index}/elastic/v7/test_find.py | 4 ++-- .../doc_index}/elastic/v7/test_index_get_del.py | 9 +++++++-- 8 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 tests/integrations/doc_index/__init__.py create mode 100644 tests/integrations/doc_index/elastic/__init__.py rename tests/{index => integrations/doc_index}/elastic/fixture.py (100%) create mode 100644 tests/integrations/doc_index/elastic/v7/__init__.py rename tests/{index => integrations/doc_index}/elastic/v7/docker-compose.yml (100%) rename tests/{index => integrations/doc_index}/elastic/v7/test_column_config.py (97%) rename tests/{index => integrations/doc_index}/elastic/v7/test_find.py (98%) rename tests/{index => integrations/doc_index}/elastic/v7/test_index_get_del.py (97%) diff --git a/tests/integrations/doc_index/__init__.py b/tests/integrations/doc_index/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/integrations/doc_index/elastic/__init__.py b/tests/integrations/doc_index/elastic/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/index/elastic/fixture.py b/tests/integrations/doc_index/elastic/fixture.py similarity index 100% rename from tests/index/elastic/fixture.py rename to tests/integrations/doc_index/elastic/fixture.py diff --git a/tests/integrations/doc_index/elastic/v7/__init__.py b/tests/integrations/doc_index/elastic/v7/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/index/elastic/v7/docker-compose.yml b/tests/integrations/doc_index/elastic/v7/docker-compose.yml similarity index 100% rename from tests/index/elastic/v7/docker-compose.yml rename to tests/integrations/doc_index/elastic/v7/docker-compose.yml diff --git a/tests/index/elastic/v7/test_column_config.py b/tests/integrations/doc_index/elastic/v7/test_column_config.py similarity index 97% rename from tests/index/elastic/v7/test_column_config.py rename to tests/integrations/doc_index/elastic/v7/test_column_config.py index a0d4aa4dec9..df927a2c2de 100644 --- a/tests/index/elastic/v7/test_column_config.py +++ b/tests/integrations/doc_index/elastic/v7/test_column_config.py @@ -3,7 +3,7 @@ from docarray import BaseDoc from docarray.index import ElasticV7DocIndex -from tests.index.elastic.fixture import start_storage_v7 # noqa: F401 +from tests.integrations.doc_index.elastic.fixture import start_storage_v7 # noqa: F401 pytestmark = [pytest.mark.slow, pytest.mark.index] diff --git a/tests/index/elastic/v7/test_find.py b/tests/integrations/doc_index/elastic/v7/test_find.py similarity index 98% rename from tests/index/elastic/v7/test_find.py rename to tests/integrations/doc_index/elastic/v7/test_find.py index 6665c8b2b60..1a0503711a7 100644 --- a/tests/index/elastic/v7/test_find.py +++ b/tests/integrations/doc_index/elastic/v7/test_find.py @@ -6,8 +6,8 @@ from docarray import BaseDoc from docarray.index import ElasticV7DocIndex from docarray.typing import NdArray, TorchTensor -from tests.index.elastic.fixture import start_storage_v7 # noqa: F401 -from tests.index.elastic.fixture import FlatDoc, SimpleDoc +from tests.integrations.doc_index.elastic.fixture import start_storage_v7 # noqa: F401 +from tests.integrations.doc_index.elastic.fixture import FlatDoc, SimpleDoc pytestmark = [pytest.mark.slow, pytest.mark.index] diff --git a/tests/index/elastic/v7/test_index_get_del.py b/tests/integrations/doc_index/elastic/v7/test_index_get_del.py similarity index 97% rename from tests/index/elastic/v7/test_index_get_del.py rename to tests/integrations/doc_index/elastic/v7/test_index_get_del.py index 09722e22cf8..d5394a7925b 100644 --- a/tests/index/elastic/v7/test_index_get_del.py +++ b/tests/integrations/doc_index/elastic/v7/test_index_get_del.py @@ -7,8 +7,13 @@ from docarray.documents import ImageDoc, TextDoc from docarray.index import ElasticV7DocIndex from docarray.typing import NdArray -from tests.index.elastic.fixture import start_storage_v7 # noqa: F401 -from tests.index.elastic.fixture import DeepNestedDoc, FlatDoc, NestedDoc, SimpleDoc +from tests.integrations.doc_index.elastic.fixture import start_storage_v7 # noqa: F401 +from tests.integrations.doc_index.elastic.fixture import ( + DeepNestedDoc, + FlatDoc, + NestedDoc, + SimpleDoc, +) pytestmark = [pytest.mark.slow, pytest.mark.index] From f442c215087cf0ad283ce2733cb362f71680f3e9 Mon Sep 17 00:00:00 2001 From: samsja Date: Thu, 30 Mar 2023 12:15:50 +0200 Subject: [PATCH 3/4] fix: ci Signed-off-by: samsja --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 722e2525322..6d64223902a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -217,13 +217,15 @@ jobs: python -m pip install --upgrade pip python -m pip install poetry poetry install --all-extras + poetry run pip install protobuf==3.19.0 + poetry run pip install tensorflow==2.11.0 sudo apt-get update sudo apt-get install --no-install-recommends ffmpeg - name: Test id: test run: | - poetry run pytest -m 'index and (not tensorflow)' tests + poetry run pytest -m 'index' tests timeout-minutes: 30 docarray-test-tensorflow: From 9659c90e1bd91452db81f034c9ba1f4037d9ab80 Mon Sep 17 00:00:00 2001 From: samsja Date: Thu, 30 Mar 2023 12:47:56 +0200 Subject: [PATCH 4/4] fix: ci Signed-off-by: samsja --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d64223902a..130e72de9dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,7 +164,7 @@ jobs: - name: Test id: test run: | - poetry run pytest -m "not (tensorflow or benchmark)" ${{ matrix.test-path }} + poetry run pytest -m "not (tensorflow or benchmark or index)" ${{ matrix.test-path }} timeout-minutes: 30 env: JINA_AUTH_TOKEN: "${{ secrets.JINA_AUTH_TOKEN }}"