weaviate-python-client icon indicating copy to clipboard operation
weaviate-python-client copied to clipboard

Tests embedded different versions

Open saireddythfc opened this issue 1 year ago • 4 comments
trafficstars

Hi,

I attempted to setup the repository on my local machine to begin contributions. On following the guidelines on contributing.md, I see there are multiple tests failing in various modules (integration, mock_tests, test). I did try committing changes and pushing the code resulted in a separate error that I have linked in Issue #933.

Here's the stats at the end of running each test module:

  1. Integration: 155 failed, 589 passed, 29 skipped, 4 errors in 517.43s (0:08:37)
  2. Mock_tests: 52 passed, 1 skipped, 46 warnings in 29.22s
  3. tests: 2 failed, 309 passed, 1 skipped, 23 warnings in 901.25s (0:15:01)

Let me know if you need the entire stack trace. Here's the "tests" error trace for instance: FAILED test/test_embedded.py::test_embedded_different_versions - OSError: [Errno 8] Exec format error: '/private/var/folders/3v/_jgc177x2ln06306pq8qlcqc0000gn/T/pytest-of-hurrikane/pytest-2/bin2/weav... FAILED test/test_embedded.py::test_version - urllib.error.HTTPError: HTTP Error 404: Not Found

Upon further inspection, the version "1.18.2" in tests/test_embedded.py is hard-coded on line 237. Is this something to be looked at potentially?

saireddythfc avatar Mar 25 '24 20:03 saireddythfc

Hi @saireddythfc, the concerning errors there are the integration tests, as 155 of them seem to have failed. Can you post a representative example of how it's failing? It could be that your docker compose environments are not spinning up correctly thereby invalidating the tests since they depend on the presence of a local Weaviate instance to run

As to the test, as you'll see on L242 of the same test, the hard-coding there is part of the test definition. It's a requirement that a passed in version of 1.18.2 should spin up an embedded Weaviate whose running version is also 1.18.2

Let me know about the other errors so I can assist you!

tsmith023 avatar Mar 28 '24 10:03 tsmith023

Hi @tsmith023, thanks for the response!

I looked into the warning for the test and mock_tests run, here it is:

test/test_client.py: 10 warnings test/test_embedded.py: 13 warnings /my_file_path/weaviate-python-client/weaviate/warnings.py:158: DeprecationWarning: Dep016: You are using the Weaviate v3 client, which is deprecated. Consider upgrading to the new and improved v4 client instead! See here for usage: https://weaviate.io/developers/weaviate/client-libraries/python

warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

====================================== short test summary info ==================================== FAILED test/test_embedded.py::test_embedded_different_versions - OSError: [Errno 8] Exec format error: '/private/var/folders/3v/_jgc177x2ln06306pq8qlcqc0000gn/T/pytest-of-hurrikane/pytest-3/bin2/weav... FAILED test/test_embedded.py::test_version - urllib.error.HTTPError: HTTP Error 404: Not Found

That being said, when I run pip show: pip show weaviate-client Name: weaviate-client Version: 4.5.5.dev9+g524710ac Summary: A python native Weaviate client Home-page: https://github.com/weaviate/weaviate-python-client Author: Weaviate Author-email: [email protected], License: BSD 3-clause Location: /usr/local/lib/python3.11/site-packages Editable project location: /my_file_path/weaviate-python-client Requires: authlib, grpcio, grpcio-health-checking, grpcio-tools, httpx, pydantic, requests, validators Required-by: distyll-info

which seems to be the latest version according to the documentation.

As requested, here's a snippet of the integration run: weaviate/collections/base.py:59: in _create
response = self._connection.post(
config = {'class': 'Test_batch_add', 'properties': [{'dataType': [<DataType.TEXT: 'text'>], 'name': 'title'}, {'dataType': [<Da...IndexType': 'hnsw', 'vectorizer': {'text2vec-contextionary': {'properties': ['title'], 'vectorizeClassName': False}}}}}
self = <weaviate.collections.collections._Collections object at 0x1105263d0>
weaviate/connect/v4.py:480: in post
return self.__send(
error_msg = 'Collection may not have been created properly.'
params = None
path = '/schema'
self = <weaviate.connect.v4.ConnectionV4 object at 0x110527c10>
status_codes = _ExpectedStatusCodes(ok_in=200, error='Create collection', ok=[200])
weaviate_object = {'class': 'Test_batch_add', 'properties': [{'dataType': [<DataType.TEXT: 'text'>], 'name': 'title'}, {'dataType': [<Da...IndexType': 'hnsw', 'vectorizer': {'text2vec-contextionary': {'properties': ['title'], 'vectorizeClassName': False}}}}}
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \

I'm attaching all the files containing the entire stack trace for each test run in case you need more context. integrations.docx mock_tests.docx test.docx

saireddythfc avatar Mar 28 '24 19:03 saireddythfc

HI, could you please upload to traces to github gist or something like that?

dirkkul avatar Mar 30 '24 08:03 dirkkul

Here: https://gist.github.com/saireddythfc/e683ec4da4f774bccd7771dda06ecd6c.

saireddythfc avatar Apr 03 '24 22:04 saireddythfc

sorry, I forgot about this

you need to have the text2vec-contextionary module present as mentioned in the error logs

E               weaviate.exceptions.UnexpectedStatusCodeError: Collection may not have been created properly.! Unexpected status code: 422, with response body: \{'error': [\{'message': 'target vector "title": vectorizer: no module with name "text2vec-contextionary" present'\}]\}.\

I'd recommend to start all required containers using docker with ./ci/start_weaviate.sh 1.26.0-rc.0 then everything should be in place

dirkkul avatar Jul 03 '24 11:07 dirkkul