Chore: Add context to star and stats (#39591)
* Add context to star and stats * Use WithTransactionalDbSession * Add additional ctx * Remove convey * Fix star handler name * Use WithDbSession, use DispatchCtx * Remove xorm from star
This commit is contained in:
@@ -19,7 +19,7 @@ func TestStatsDataAccess(t *testing.T) {
|
||||
|
||||
t.Run("Get system stats should not results in error", func(t *testing.T) {
|
||||
query := models.GetSystemStatsQuery{}
|
||||
err := GetSystemStats(&query)
|
||||
err := GetSystemStats(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, int64(3), query.Result.Users)
|
||||
assert.Equal(t, int64(0), query.Result.Editors)
|
||||
@@ -37,13 +37,13 @@ func TestStatsDataAccess(t *testing.T) {
|
||||
|
||||
t.Run("Get datasource stats should not results in error", func(t *testing.T) {
|
||||
query := models.GetDataSourceStatsQuery{}
|
||||
err := GetDataSourceStats(&query)
|
||||
err := GetDataSourceStats(context.Background(), &query)
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
|
||||
t.Run("Get datasource access stats should not results in error", func(t *testing.T) {
|
||||
query := models.GetDataSourceAccessStatsQuery{}
|
||||
err := GetDataSourceAccessStats(&query)
|
||||
err := GetDataSourceAccessStats(context.Background(), &query)
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
|
||||
@@ -55,7 +55,7 @@ func TestStatsDataAccess(t *testing.T) {
|
||||
|
||||
t.Run("Get admin stats should not result in error", func(t *testing.T) {
|
||||
query := models.GetAdminStatsQuery{}
|
||||
err := GetAdminStats(&query)
|
||||
err := GetAdminStats(context.Background(), &query)
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user