stats_test.go 1009 B

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