mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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
This commit is contained in:
parent
84eb03e7e5
commit
d5687cce11
@ -158,7 +158,7 @@ func GetAdminStats(query *models.GetAdminStatsQuery) error {
|
|||||||
) AS active_sessions`
|
) AS active_sessions`
|
||||||
|
|
||||||
var stats models.AdminStats
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,14 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"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) {
|
func TestIntegration_GetUserStats(t *testing.T) {
|
||||||
InitTestDB(t)
|
InitTestDB(t)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user