cc-archive / open-ledger

Prototype code and examples for work on the Creative Commons "CC Search" project
MIT License
48 stars 23 forks source link

Broking unit level tests after build #219

Closed ultimatecoder closed 6 years ago

ultimatecoder commented 6 years ago

Description

Test of expecting correct relevance order is breaking into my machine. I am confused because the latest test at Travis-ci is passing the build. I had implemented configuration steps in README.md. Copy of my test_settings.py. The order of image is not according to the expectations. The expected result is at the second position. Reference

Dependency versions

Traceback

$ ./manage.py test
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
................................................../home/jay/.virtualenvs/openledger_dev/lib/python3.4/site-packages/html5lib/ihatexml.py:262: DataLossWarning: Coercing non-XML name
  warnings.warn("Coercing non-XML name", DataLossWarning)
......Unknown license was provided: 'FAKE'
................................................Removing image Y0Yd643IlSkDs5rtwLWZqw== from search index
............F...........................
======================================================================
FAIL: test_sorting (imageledger.tests.test_search.TestSearch)
[#119] Results should be return in relevance order, always
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/src/open-ledger/imageledger/tests/test_search.py", line 254, in test_sorting
    self.assertEqual(img1.identifier, select_nodes(resp, '.t-image-result')[0].attrib['data-identifier'])
AssertionError: 'ZfxQK-OfePwS028wSuxlyw==' != 'HWySmV5GwsaeVPwSdQS9LQ=='
- ZfxQK-OfePwS028wSuxlyw==
+ HWySmV5GwsaeVPwSdQS9LQ==

----------------------------------------------------------------------
Ran 144 tests in 15.712s

FAILED (failures=1)
Destroying test database for alias 'default'...
pa-w commented 6 years ago

This is fixed by updating ElasticSearch to 5.3, will update the README file.

ultimatecoder commented 6 years ago

As per conversation with @pa-w at Slack, the expected version of Elasticsearch is 5.3. I have created a PR for fixing outdated README.md file here https://github.com/creativecommons/open-ledger/pull/220 Many thanks!