notanumber / xapian-haystack

A Xapian backend for Haystack
GNU General Public License v2.0
154 stars 93 forks source link

3.0.1 test_highlight fails #215

Closed dvzrv closed 2 years ago

dvzrv commented 3 years ago

Hi! When trying to package 3.0.1 for Arch Linux I ran into issues with test_highlight which seems to generate one newline character too many:

======================================================================
FAIL: test_highlight (test_haystack.xapian_tests.tests.test_backend.BackendFeaturesTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-xapian-haystack/src/django-haystack-3.1.1/test_haystack/xapian_tests/tests/test_backend.py", line 478, in test_highlight
    self.assertEqual([result.highlighted['text'] for result in results],
AssertionError: Lists differ: ['<em>indexed</em>!\n1', '<em>indexed</em>!\n2', '<em>indexed</em>!\n3'] != ['<em>indexed</em>!\n1\n', '<em>indexed</em>!\n2\n', '<em>indexed</em>!\n3\n']

First differing element 0:
'<em>indexed</em>!\n1'
'<em>indexed</em>!\n1\n'

- ['<em>indexed</em>!\n1', '<em>indexed</em>!\n2', '<em>indexed</em>!\n3']
+ ['<em>indexed</em>!\n1\n', '<em>indexed</em>!\n2\n', '<em>indexed</em>!\n3\n']
?                       ++                        ++                        ++

----------------------------------------------------------------------
Ran 110 tests in 0.545s

FAILED (failures=1)
Destroying test database for alias 'default'...

This is using xapian-haystack 3.0.1 and django-haystack 3.1.1.

asedeno commented 2 years ago

xapian-haystack's tests run against django-haystack's master branch, not a particular released version. Since django-haystack v3.1.1 was released, this was committed: https://github.com/django-haystack/django-haystack/commit/2782c063d75e02eef5e82be95b18fe5196139f36 While switching to run the test suite using GitHub Actions, I adjusted our tests to match so they would also pass.

You may want to locally revert that one line change in tests/xapian_tests/tests/test_backend.py for your package for now.

claudep commented 2 years ago

@asedeno, can we now close this issue or is anything else expected?

asedeno commented 2 years ago

@claudep I don't know that anything else is expected. I can't close issues myself though.

claudep commented 2 years ago

@notanumber, @jorgecarleitao, would it be possible to grant some more permissions to @asedeno, please?

notanumber commented 2 years ago

@claudep do you have access to settings and collaborators? It looks like you're setup as a collaborator on this so I think you can add others. If not, I can add @asedeno as a collaborator as well if that works.

claudep commented 2 years ago

No, I don't have access to settings at all.

notanumber commented 2 years ago

No worries. I've sent them an invite to become a collaborator

claudep commented 2 years ago

Awesome, thanks a lot!

notanumber commented 2 years ago

It's all good. I'm just happy to see someone take up the reigns on the project. Don't want to see it whither away and die!

On Fri, Feb 25, 2022, at 9:06 AM, Claude Paroz wrote:

Awesome, thanks a lot!

— Reply to this email directly, view it on GitHub https://github.com/notanumber/xapian-haystack/issues/215#issuecomment-1051031857, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAAKWT56B62XO5J7FB3GQ3U46ZIJANCNFSM5IXZACXA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.***>