mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Remove deprecated FolderID from api tests (#79466)
* Remove deprecated FolderID from api tests * Removed unused const
This commit is contained in:
@@ -325,20 +325,20 @@ func setupDB(b testing.TB) benchScenario {
|
||||
str := fmt.Sprintf("dashboard_%d_%d", i, j)
|
||||
dashID := generateID(IDs)
|
||||
dashs = append(dashs, &dashboards.Dashboard{
|
||||
ID: dashID,
|
||||
OrgID: signedInUser.OrgID,
|
||||
IsFolder: false,
|
||||
UID: str,
|
||||
FolderID: f0.ID, // nolint:staticcheck
|
||||
Slug: str,
|
||||
Title: str,
|
||||
Data: simplejson.New(),
|
||||
Created: now,
|
||||
Updated: now,
|
||||
ID: dashID,
|
||||
OrgID: signedInUser.OrgID,
|
||||
IsFolder: false,
|
||||
UID: str,
|
||||
FolderUID: f0.UID,
|
||||
Slug: str,
|
||||
Title: str,
|
||||
Data: simplejson.New(),
|
||||
Created: now,
|
||||
Updated: now,
|
||||
})
|
||||
|
||||
dashTags = append(dashTags, &dashboardTag{
|
||||
DashboardId: dashID,
|
||||
DashboardID: dashID,
|
||||
Term: fmt.Sprintf("tag%d", j),
|
||||
})
|
||||
}
|
||||
@@ -352,20 +352,20 @@ func setupDB(b testing.TB) benchScenario {
|
||||
str := fmt.Sprintf("dashboard_%d_%d_%d", i, j, k)
|
||||
dashID := generateID(IDs)
|
||||
dashs = append(dashs, &dashboards.Dashboard{
|
||||
ID: dashID,
|
||||
OrgID: signedInUser.OrgID,
|
||||
IsFolder: false,
|
||||
UID: str,
|
||||
FolderID: f1.ID, // nolint:staticcheck
|
||||
Slug: str,
|
||||
Title: str,
|
||||
Data: simplejson.New(),
|
||||
Created: now,
|
||||
Updated: now,
|
||||
ID: dashID,
|
||||
OrgID: signedInUser.OrgID,
|
||||
IsFolder: false,
|
||||
UID: str,
|
||||
FolderUID: f1.UID,
|
||||
Slug: str,
|
||||
Title: str,
|
||||
Data: simplejson.New(),
|
||||
Created: now,
|
||||
Updated: now,
|
||||
})
|
||||
|
||||
dashTags = append(dashTags, &dashboardTag{
|
||||
DashboardId: dashID,
|
||||
DashboardID: dashID,
|
||||
Term: fmt.Sprintf("tag%d", k),
|
||||
})
|
||||
}
|
||||
@@ -379,20 +379,20 @@ func setupDB(b testing.TB) benchScenario {
|
||||
str := fmt.Sprintf("dashboard_%d_%d_%d_%d", i, j, k, l)
|
||||
dashID := generateID(IDs)
|
||||
dashs = append(dashs, &dashboards.Dashboard{
|
||||
ID: dashID,
|
||||
OrgID: signedInUser.OrgID,
|
||||
IsFolder: false,
|
||||
UID: str,
|
||||
FolderID: f2.ID, // nolint:staticcheck
|
||||
Slug: str,
|
||||
Title: str,
|
||||
Data: simplejson.New(),
|
||||
Created: now,
|
||||
Updated: now,
|
||||
ID: dashID,
|
||||
OrgID: signedInUser.OrgID,
|
||||
IsFolder: false,
|
||||
UID: str,
|
||||
FolderUID: f2.UID,
|
||||
Slug: str,
|
||||
Title: str,
|
||||
Data: simplejson.New(),
|
||||
Created: now,
|
||||
Updated: now,
|
||||
})
|
||||
|
||||
dashTags = append(dashTags, &dashboardTag{
|
||||
DashboardId: dashID,
|
||||
DashboardID: dashID,
|
||||
Term: fmt.Sprintf("tag%d", l),
|
||||
})
|
||||
}
|
||||
@@ -489,7 +489,7 @@ func setupServer(b testing.TB, sc benchScenario, features *featuremgmt.FeatureMa
|
||||
}
|
||||
|
||||
type f struct {
|
||||
ID int64 `xorm:"pk autoincr 'id'"`
|
||||
// ID int64 `xorm:"pk autoincr 'id'"`
|
||||
OrgID int64 `xorm:"org_id"`
|
||||
UID string `xorm:"uid"`
|
||||
ParentUID *string `xorm:"parent_uid"`
|
||||
@@ -506,8 +506,8 @@ func (f *f) TableName() string {
|
||||
|
||||
// SQL bean helper to save tags
|
||||
type dashboardTag struct {
|
||||
Id int64
|
||||
DashboardId int64
|
||||
ID int64
|
||||
DashboardID int64
|
||||
Term string
|
||||
}
|
||||
|
||||
@@ -515,10 +515,10 @@ func addFolder(orgID int64, id int64, uid string, parentUID *string) (*f, *dashb
|
||||
now := time.Now()
|
||||
title := uid
|
||||
f := &f{
|
||||
OrgID: orgID,
|
||||
UID: uid,
|
||||
Title: title,
|
||||
ID: id,
|
||||
OrgID: orgID,
|
||||
UID: uid,
|
||||
Title: title,
|
||||
// ID: id,
|
||||
Created: now,
|
||||
Updated: now,
|
||||
ParentUID: parentUID,
|
||||
|
||||
Reference in New Issue
Block a user