singnet / das

1 stars 0 forks source link

failed unit test #60

Closed mjsduncan closed 1 month ago

mjsduncan commented 1 month ago

after poetry install on ubuntu 22.04, i get this unit test fail:

~/hyperon/das-query-engine$ make unit-tests
==================================== test session starts =====================================
platform linux -- Python 3.10.12, pytest-7.3.1, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /media/mozi/7361de95-66da-41ce-8d3d-d05196c633a1/hyperon/das-query-engine
configfile: pytest.ini
plugins: cov-4.0.0, requests-mock-1.11.0
collected 110 items                                                                          
...
...
tests/unit/test_das.py::TestDistributedAtomSpace::test_create_das PASSED
tests/unit/test_das.py::TestDistributedAtomSpace::test_get_incoming_links FAILED

========================================== FAILURES ==========================================
______________________ TestDistributedAtomSpace.test_get_incoming_links ______________________

self = <tests.unit.test_das.TestDistributedAtomSpace object at 0x7230529db340>

    def test_get_incoming_links(self):
>       das = DistributedAtomSpaceMock()

tests/unit/test_das.py:35: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.unit.mock.DistributedAtomSpaceMock object at 0x7230525d1cc0>
query_engine = 'local', kwargs = {}

    def __init__(self, query_engine: Optional[str] = 'local', **kwargs) -> None:
>       self.backend = DatabaseAnimals()
E       TypeError: Can't instantiate abstract class DatabaseAnimals with abstract method get_matched_node_name

tests/unit/mock.py:27: TypeError
================================== short test summary info ===================================
FAILED tests/unit/test_das.py::TestDistributedAtomSpace::test_get_incoming_links - TypeError: Can't instantiate abstract class DatabaseAnimals with abstract method get_matc...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================ 1 failed, 59 passed in 0.36s ================================
make: *** [Makefile:13: unit-tests] Error 1
levisingularity commented 1 month ago

@mjsduncan can you give me a few more informations, such as hash commit you ran the tests against and the hyperon-das (pip show hyperon-das) version after you ran the poetry install command?

mjsduncan commented 1 month ago

hi levi! this happened in hyperon-query-engine repo. this is current hash but i might have updated since original issue:

/das-query-engine$ git branch -vv
* master c108236 [origin/master] Merge pull request #293 from singnet/angelo/bug/#62/better-msg-about-unsupported-python-version

/das-query-engine$ pip show hyperon-das
Name: hyperon-das
Version: 0.5.3
Summary: Query Engine API for Distributed AtomSpace
Home-page: 
Author: marcocapozzoli
Author-email: marcocapozzoli90@gmail.com
License: 
Location: /home/mozi/.local/lib/python3.10/site-packages
Requires: hyperon-das-atomdb, requests
Required-by: #N/A
levisingularity commented 1 month ago

@mjsduncan Based on the information you provided, I was able to reproduce the issue. This problem has been fixed in versions after 0.5.3. If you follow the steps in the README again, your hyperon-das will be updated to the latest version (0.8.0), and you should be good to go.

Image

Image

mjsduncan commented 1 month ago

it works now, thanks!