Skip to content

Commit bac7d17

Browse files
authored
Merge pull request #170 from erizocosmico/it/repos-per-year
it: repositories per year
2 parents 0395b9d + a415b19 commit bac7d17

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

integration_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,21 @@ func TestIntegration(t *testing.T) {
7676
{"b029517f6300c2da0f4b651b8642506cd6aaf45d"},
7777
},
7878
},
79+
{
80+
`SELECT COUNT(first_commit_year), first_commit_year
81+
FROM (
82+
SELECT YEAR(c.author_when) AS first_commit_year
83+
FROM repositories r
84+
INNER JOIN refs
85+
ON r.id = refs.repository_id
86+
INNER JOIN commits c
87+
ON history_idx(refs.hash, c.hash) >= 0
88+
ORDER BY c.author_when
89+
LIMIT 1
90+
) repo_years
91+
GROUP BY first_commit_year`,
92+
[]sql.Row{{int32(1), int32(2015)}},
93+
},
7994
}
8095

8196
for _, tt := range testCases {

0 commit comments

Comments
 (0)