Skip to content

Commit db71080

Browse files
galshubeliclaude
andcommitted
fix(e2e): pass repo URL and synthesize test_* search terms
Closes the last 3 of the original 31 e2e failures. 1. Pass url= to Project() so save_repo_info populates Redis. The /api/repo_info endpoint returns 400 if repo_info is None, which broke canvas:167 with TypeError on response.info.node_count. 2. Synthesize test_<module> Function nodes for the search-bar tests. testData.ts parametrizes over searchInput "test", but graphrag-sdk 0.8.2 has zero functions whose names contain "test", so the auto-scroll dropdown isn't scrollable and the auto-complete count is 0. 12 synthesized names give the dropdown enough to scroll. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b70fd97 commit db71080

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

e2e/seed_test_data.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,39 @@ def ensure_calls_edges(graph_name: str) -> None:
7070
logger.info("[%s] CALLS %s → %s: ensured", graph_name, caller, callee)
7171

7272

73+
def ensure_search_term_variety(graph_name: str) -> None:
74+
"""Synthesize Function nodes whose names contain the e2e search terms that
75+
don't appear in graphrag-sdk 0.8.2 (e.g. 'test'). Without these, the
76+
auto-scroll and auto-complete tests don't have enough matches.
77+
"""
78+
db = FalkorDB(
79+
host=os.getenv("FALKORDB_HOST", "localhost"),
80+
port=int(os.getenv("FALKORDB_PORT", 6379)),
81+
)
82+
g = db.select_graph(graph_name)
83+
for module in (
84+
"ontology", "graph", "entity", "relation", "document", "chunk",
85+
"query", "session", "agent", "chat", "attribute", "helpers",
86+
):
87+
g.query(
88+
"MERGE (f:Function:Searchable {name: $name}) "
89+
"ON CREATE SET f.path = 'synthesized.py', f.src_start = 1, f.src_end = 1, f.doc = ''",
90+
{"name": f"test_{module}"},
91+
)
92+
93+
7394
def main():
7495
sdk_path = prepare_graphrag_sdk_source()
7596
logger.info(
7697
"Seeding graphrag-sdk %s from %s",
7798
getattr(graphrag_sdk, "__version__", "?"),
7899
sdk_path,
79100
)
80-
Project(name="GraphRAG-SDK", path=sdk_path, url=None).analyze_sources()
101+
Project(
102+
name="GraphRAG-SDK",
103+
path=sdk_path,
104+
url="https://github.com/FalkorDB/GraphRAG-SDK",
105+
).analyze_sources()
81106

82107
for url in REPOS:
83108
logger.info("Seeding %s ...", url)
@@ -86,6 +111,7 @@ def main():
86111
logger.info("Done seeding %s", url)
87112

88113
ensure_calls_edges("GraphRAG-SDK")
114+
ensure_search_term_variety("GraphRAG-SDK")
89115

90116
logger.info("All test data seeded successfully.")
91117

0 commit comments

Comments
 (0)