test: verify graph surfaces end to end

This commit is contained in:
Yahya Alhinai
2026-06-28 01:59:58 +00:00
parent b092a24941
commit 1088196ba6
2 changed files with 48 additions and 1 deletions
+41 -1
View File
@@ -159,6 +159,37 @@ async function verifyMemoryRecall() {
if (!recalled) fail('memory recall did not find seeded collision'); if (!recalled) fail('memory recall did not find seeded collision');
} }
async function verifyGraph() {
process.env.LIVEKIT_URL = env.LIVEKIT_URL;
process.env.LIVEKIT_API_KEY = env.LIVEKIT_API_KEY;
process.env.LIVEKIT_API_SECRET = env.LIVEKIT_API_SECRET;
process.env.GEMINI_API_KEY = env.GEMINI_API_KEY;
process.env.GITHUB_TOKEN = env.GITHUB_TOKEN;
process.env.GITHUB_REPO = env.GITHUB_REPO;
process.env.MONGODB_URI = env.MONGODB_URI;
const podId = `verify-graph-${Date.now()}`;
const { seedGraph } = await import('../backend/dist/graph/store.js');
await seedGraph(podId);
const graph = await json(await doFetch(`${baseUrl}/api/pods/${encodeURIComponent(podId)}/graph`));
if (!Array.isArray(graph.nodes) || graph.nodes.length < 1)
fail('graph endpoint returned no nodes');
if (!Array.isArray(graph.edges) || graph.edges.length < 1)
fail('graph endpoint returned no edges');
const reach = await json(
await doFetch(
`${baseUrl}/api/pods/${encodeURIComponent(podId)}/graph/reach/${encodeURIComponent(
'engineer:karti',
)}`,
),
);
if (!Array.isArray(reach.reaches) || reach.reaches.length < 1) {
fail('graph reachability endpoint returned no reachable edges');
}
}
async function verifyGitWatcher() { async function verifyGitWatcher() {
const child = spawn( const child = spawn(
process.execPath, process.execPath,
@@ -206,6 +237,7 @@ try {
await verifyApi(); await verifyApi();
await verifyCollisionAndMessages(); await verifyCollisionAndMessages();
await verifyMemoryRecall(); await verifyMemoryRecall();
await verifyGraph();
await verifyGitWatcher(); await verifyGitWatcher();
console.log( console.log(
JSON.stringify( JSON.stringify(
@@ -213,7 +245,15 @@ try {
ok: true, ok: true,
baseUrl, baseUrl,
mongoUri, mongoUri,
checks: ['health', 'token', 'pod-crud', 'collision', 'memory-recall', 'git-watcher'], checks: [
'health',
'token',
'pod-crud',
'collision',
'memory-recall',
'graph',
'git-watcher',
],
}, },
null, null,
2, 2,
+7
View File
@@ -153,6 +153,12 @@ try {
if (!hasPodCards) throw new Error('pod cards did not render'); if (!hasPodCards) throw new Error('pod cards did not render');
if (hasOverlay) throw new Error('Vite error overlay is visible'); if (hasOverlay) throw new Error('Vite error overlay is visible');
await page.getByRole('button', { name: 'Team memory' }).click();
await page.getByText('Workflow metrics').waitFor({ timeout: 15_000 });
await page.getByText('Learning edges').waitFor({ timeout: 15_000 });
await page.getByRole('button', { name: /Pods/i }).click();
await page.getByPlaceholder('Your name').first().waitFor({ timeout: 15_000 });
await page.getByPlaceholder('Your name').first().fill(verifyMember); await page.getByPlaceholder('Your name').first().fill(verifyMember);
await page.getByRole('button', { name: 'Add and join' }).first().click(); await page.getByRole('button', { name: 'Add and join' }).first().click();
await page.getByRole('button', { name: 'Share screen' }).waitFor({ timeout: 15_000 }); await page.getByRole('button', { name: 'Share screen' }).waitFor({ timeout: 15_000 });
@@ -191,6 +197,7 @@ try {
ok: true, ok: true,
frontendUrl, frontendUrl,
bodyLength: bodyText.length, bodyLength: bodyText.length,
graph: true,
joined: true, joined: true,
intervention: true, intervention: true,
member: verifyMember, member: verifyMember,