stats_test.go 976 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package sqlstore
  2. import (
  3. "testing"
  4. m "github.com/grafana/grafana/pkg/models"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestStatsDataAccess(t *testing.T) {
  8. Convey("Testing Stats Data Access", t, func() {
  9. InitTestDB(t)
  10. Convey("Get system stats should not results in error", func() {
  11. query := m.GetSystemStatsQuery{}
  12. err := GetSystemStats(&query)
  13. So(err, ShouldBeNil)
  14. })
  15. Convey("Get system user count stats should not results in error", func() {
  16. query := m.GetSystemUserCountStatsQuery{}
  17. err := GetSystemUserCountStats(&query)
  18. So(err, ShouldBeNil)
  19. })
  20. Convey("Get datasource stats should not results in error", func() {
  21. query := m.GetDataSourceStatsQuery{}
  22. err := GetDataSourceStats(&query)
  23. So(err, ShouldBeNil)
  24. })
  25. Convey("Get datasource access stats should not results in error", func() {
  26. query := m.GetDataSourceAccessStatsQuery{}
  27. err := GetDataSourceAccessStats(&query)
  28. So(err, ShouldBeNil)
  29. })
  30. })
  31. }