Skip to content

Commit 191749b

Browse files
committed
gitbase: add integration test for #400
Signed-off-by: Miguel Molina <[email protected]>
1 parent 0e7e98a commit 191749b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

integration_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,25 @@ func TestSquashCorrectness(t *testing.T) {
351351
ON r.commit_hash = c.commit_hash
352352
AND r.ref_name = c.ref_name
353353
AND c.repository_id = r.repository_id`,
354+
355+
`SELECT COUNT(r.*) as repos FROM repositories r`,
356+
357+
`SELECT repository_id, num_files FROM (
358+
SELECT COUNT(f.*) num_files, f.repository_id
359+
FROM ref_commits r
360+
INNER JOIN commit_files cf
361+
ON r.commit_hash = cf.commit_hash
362+
AND r.repository_id = cf.repository_id
363+
INNER JOIN files f
364+
ON cf.repository_id = f.repository_id
365+
AND cf.blob_hash = f.blob_hash
366+
AND cf.tree_hash = f.tree_hash
367+
AND cf.file_path = f.file_path
368+
WHERE r.ref_name = 'HEAD'
369+
GROUP BY f.repository_id
370+
) t
371+
ORDER BY num_files DESC
372+
LIMIT 10`,
354373
}
355374

356375
for _, q := range queries {

0 commit comments

Comments
 (0)