GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_indexing_item_not_front test is failing · Issue #258 · openzim/python-scraperlib

test_indexing_item_not_front test is failing #258

New issue
Copy link
New issue
Copy link
Open
#400
Open
test_indexing_item_not_front test is failing#258
#400
Copy link
Assignees
mcwanza
Labels
regressionSomething that used to work is brokenSomething that used to work is broken
Milestone
5.6.0

Description

@benoit74
benoit74
opened on Apr 29, 2025
Issue body actions

I had to skip this test which is failing for now with most recent libzim:

python-scraperlib/tests/zim/test_indexing.py

Lines 114 to 144 in fef63f8

def test_indexing_item_not_front(tmp_path: pathlib.Path, png_image: pathlib.Path):
fpath = tmp_path / "test.zim"
main_path = "welcome"
with Creator(fpath, main_path).config_dev_metadata() as creator:
creator.add_item(
StaticItem(
filepath=png_image,
path="welcome",
title="brain food", # title used for suggestions
index_data=IndexData(
title="screen", content="car" # title and content used for search
),
hints={libzim.writer.Hint.FRONT_ARTICLE: False}, # mark as not front
)
)
assert fpath.exists()
reader = Archive(fpath)
# "brain" works as a suggestion but "food" doesn't work because since no front
# article is present in the zim file, libzim doesn't create a title xapian index.
# so, when searching suggestion, libzim is fallback to a binary search on the title
# and return only article starting by the query.
# see https://github.com/openzim/libzim/issues/902#issuecomment-2223050129
assert "welcome" in list(reader.get_suggestions("brain"))
assert "welcome" not in list(reader.get_suggestions("food"))
assert "welcome" not in list(reader.get_suggestions("screen"))
assert "welcome" not in list(reader.get_suggestions("car"))
assert reader.get_search_results_count("screen") >= 1
assert reader.get_search_results_count("car") >= 1
assert reader.get_search_results_count("brain") == 0
assert reader.get_search_results_count("food") == 0

This looks like an upstream issue, hopefully only at read time: openzim/libzim#981

Activity

  1. benoit74
    added this to the 5.2.0 milestone on Apr 29, 2025
  2. benoit74
    self-assigned this
    on Apr 29, 2025
  3. benoit74
    added
    upstreamSomething needs to be fixed in another project firstSomething needs to be fixed in another project first
    regressionSomething that used to work is brokenSomething that used to work is broken
    on Apr 29, 2025
  4. benoit74 commented on May 13, 2025

    @benoit74
    benoit74
    on May 13, 2025
    CollaboratorAuthor
    More actions

    We've agreed upstream that this was more a kind of bug / unwanted behavior. I will hence fix the test on scraperlib side.

    Reacted by Kelson
  5. benoit74 commented on May 13, 2025

    @benoit74
    benoit74
    on May 13, 2025
    CollaboratorAuthor
    More actions

    I will move this out of scraperlib 5.2.0:

    • it is not requiring any code change on the lib itself, only on tests
    • we need to test / document / align on more things around all these searches, and this is going to take time ; I would like to be sure about the full-text search behavior when non-front text/html article is passed for instance
  6. benoit74
    modified the milestones: 5.2.0, 5.3.0 on May 13, 2025
  7. benoit74
    modified the milestones: 5.3.0, 5.4.0 on Nov 14, 2025
  8. benoit74
    modified the milestones: 5.4.0, 5.5.0 on Mar 16, 2026
  9. benoit74
    removed
    upstreamSomething needs to be fixed in another project firstSomething needs to be fixed in another project first
    on Oct 20, 2026
  10. benoit74
    removed their assignment
    on Oct 20, 2026
  11. benoit74
    added
    pending clarificationWaiting for a clarification and/or a way to reproduce the problemWaiting for a clarification and/or a way to reproduce the problem
    on Oct 20, 2026
  12. benoit74 commented on Oct 20, 2026

    @benoit74
    benoit74
    on Oct 20, 2026
    CollaboratorAuthor
    More actions

    If someone wants to clarify this issue around full-text search behavior by fixing the failing test and adding more e.g. when non-front text/html article is passed, you're welcomed.

  13. benoit74
    removed
    pending clarificationWaiting for a clarification and/or a way to reproduce the problemWaiting for a clarification and/or a way to reproduce the problem
    on Oct 20, 2026
  14. benoit74 commented on Oct 20, 2026

    @benoit74
    benoit74
    on Oct 20, 2026
    CollaboratorAuthor
    More actions

    nota: I feel like sufficient unit tests can cover current libzim behavior and we can consider again that this is the spec for the time being ; if libzim behavior changes, then we can report it upstream and decides where the bug is.

  15. benoit74
    modified the milestones: 5.5.0, 5.6.0 on Oct 20, 2026
  16. rgaudin commented on Oct 21, 2026

    @rgaudin
    rgaudin
    on Oct 21, 2026
    Member
    More actions

    Yes, I think the reasonning was that we are exposing our own API shadowing part of the libzim but I agree we should consider libzim as a dependency and only test our code.

  17. mcwanza commented on Nov 7, 2026

    @mcwanza
    mcwanza
    on Nov 7, 2026
    More actions

    I'd like to take this one, following the last comments: treat libzim's current behavior as the spec. Plan: un-skip test_indexing_item_not_front and assert what libzim 3.13 does today (no suggestions for a non-front item, full-text search still matches), plus two tests for a non-front text/html item, one with custom IndexData and one with libzim's own indexing. Tests only, no library change. Could you assign it to me?

  18. benoit74
    assigned
    mcwanza
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @mcwanza
    mcwanza

Labels

regressionSomething that used to work is brokenSomething that used to work is broken

Type

No type

Projects

No projects

    Milestone

    • 5.6.0No due date

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.