Skip to content

[FEATURE] Improve test coverage: graph builder Cypher generation and VersionManager lifecycle #425

Description

@mykola-pereyma

Package

lexical-graph

Problem statement

11 graph builder methods generate Cypher via f-strings. Tests verify call counts but never assert on query string content — structurally invalid Cypher (like #408's WHERE () AND ...) passes all tests. source_graph_builder has no test file at all. test_delete_sources.py and test_entity_graph_builder_label_injection.py already assert on query strings — this targets the remaining builders.

test_version_manager.py only tests version numbering (get/set/increment/compare). Query generation, source node lookup, lifecycle orchestration, and vector store updates have zero coverage.

Related: #408, #415

Proposed solution

  • Add at least one query-string assertion per builder method (11 total: source, graph_summary, entity, entity_relation, topic, fact, statement, chunk builders + version_manager._get_existing_source_nodes + delete_sources.accept + neo4j_graph_store.init)
  • Test VersionManager state transitions: first-time indexing, re-indexing with existing/expired source, accept() lifecycle, error propagation

Alternatives considered

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions