Stats: Correct the number of arguments for SQL call (#27182)

* Stats: Correct the number of arguments for SQL call

* Stats: Run admin stats call as integration test
pull/27124/head^2
Emil Tullstedt 5 years ago committed by GitHub
parent 84eb03e7e5
commit d5687cce11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      pkg/services/sqlstore/stats.go
  2. 8
      pkg/services/sqlstore/stats_integration_test.go

@ -158,7 +158,7 @@ func GetAdminStats(query *models.GetAdminStatsQuery) error {
) AS active_sessions`
var stats models.AdminStats
_, err := x.SQL(rawSql, activeEndDate, activeEndDate, activeEndDate, activeEndDate, activeEndDate.Unix()).Get(&stats)
_, err := x.SQL(rawSql, activeEndDate, activeEndDate.Unix()).Get(&stats)
if err != nil {
return err
}

@ -13,6 +13,14 @@ import (
"github.com/stretchr/testify/require"
)
func TestIntegration_GetAdminStats(t *testing.T) {
InitTestDB(t)
query := models.GetAdminStatsQuery{}
err := GetAdminStats(&query)
require.NoError(t, err)
}
func TestIntegration_GetUserStats(t *testing.T) {
InitTestDB(t)

Loading…
Cancel
Save