blob: b2c7fd5fc8c5a5e0400fddde89195f5bce7ba8a8 [file] [log] [blame]
package e2e
import (
"fmt"
"log"
"testing"
"github.com/stretchr/testify/assert"
)
// This test should only run once main_test is complete and ready
type Commit struct {
Sha string
}
func TestGitLabCommits(t *testing.T) {
var commits []Commit
db, err := InitializeDb()
assert.Nil(t, err)
if err != nil {
log.Fatal(err)
}
sqlCommand := "SELECT sha FROM gitlab_commits where authored_date < '2019-06-25 02:41:42.000'"
rows, err := db.Query(sqlCommand)
if err != nil {
fmt.Println("ERROR: ", err)
}
assert.Nil(t, err)
defer rows.Close()
for rows.Next() {
var commit Commit
if err := rows.Scan(&commit.Sha); err != nil {
panic(err)
}
commits = append(commits, commit)
}
assert.Equal(t, 2817, len(commits))
}