Skip to content

Commit 41f4776

Browse files
authored
Merge pull request #171 from erizocosmico/it/commits-committer-month-year
it: commits per committer, per month and repo on a year
2 parents d7bcd70 + b5ac9ad commit 41f4776

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
@@ -91,6 +91,25 @@ func TestIntegration(t *testing.T) {
9191
GROUP BY first_commit_year`,
9292
[]sql.Row{{int32(1), int32(2015)}},
9393
},
94+
{
95+
`SELECT COUNT(*) as num_commits, month, repo_id, committer_email
96+
FROM (
97+
SELECT
98+
MONTH(committer_when) as month,
99+
r.id as repo_id,
100+
committer_email
101+
FROM repositories r
102+
INNER JOIN refs ON refs.repository_id = r.id AND refs.name = 'refs/heads/master'
103+
INNER JOIN commits c ON history_idx(refs.hash, c.hash) >= 0
104+
WHERE YEAR(committer_when) = 2015
105+
) as t
106+
GROUP BY committer_email, month, repo_id`,
107+
[]sql.Row{
108+
{int32(6), int32(3), path, "[email protected]"},
109+
{int32(1), int32(4), path, "[email protected]"},
110+
{int32(1), int32(3), path, "[email protected]"},
111+
},
112+
},
94113
}
95114

96115
for _, tt := range testCases {

0 commit comments

Comments
 (0)