Linting fixes for provisoning (#23600)

This commit is contained in:
Carl Bergquist
2020-04-16 05:46:20 +02:00
committed by GitHub
parent 6e313e7d37
commit 5fc255bd89
11 changed files with 90 additions and 88 deletions
@@ -30,10 +30,10 @@ var (
func TestCreatingNewDashboardFileReader(t *testing.T) {
Convey("creating new dashboard file reader", t, func() {
cfg := &DashboardsAsConfig{
cfg := &config{
Name: "Default",
Type: "file",
OrgId: 1,
OrgID: 1,
Folder: "",
Options: map[string]interface{}{},
}
@@ -88,10 +88,10 @@ func TestDashboardFileReader(t *testing.T) {
Convey("Reading dashboards from disk", func() {
cfg := &DashboardsAsConfig{
cfg := &config{
Name: "Default",
Type: "file",
OrgId: 1,
OrgID: 1,
Folder: "",
Options: map[string]interface{}{},
}
@@ -153,10 +153,10 @@ func TestDashboardFileReader(t *testing.T) {
})
Convey("Invalid configuration should return error", func() {
cfg := &DashboardsAsConfig{
cfg := &config{
Name: "Default",
Type: "file",
OrgId: 1,
OrgID: 1,
Folder: "",
}
@@ -172,8 +172,8 @@ func TestDashboardFileReader(t *testing.T) {
})
Convey("Two dashboard providers should be able to provisioned the same dashboard without uid", func() {
cfg1 := &DashboardsAsConfig{Name: "1", Type: "file", OrgId: 1, Folder: "f1", Options: map[string]interface{}{"path": containingID}}
cfg2 := &DashboardsAsConfig{Name: "2", Type: "file", OrgId: 1, Folder: "f2", Options: map[string]interface{}{"path": containingID}}
cfg1 := &config{Name: "1", Type: "file", OrgID: 1, Folder: "f1", Options: map[string]interface{}{"path": containingID}}
cfg2 := &config{Name: "2", Type: "file", OrgID: 1, Folder: "f2", Options: map[string]interface{}{"path": containingID}}
reader1, err := NewDashboardFileReader(cfg1, logger)
So(err, ShouldBeNil)
@@ -203,10 +203,10 @@ func TestDashboardFileReader(t *testing.T) {
})
Convey("Should not create new folder if folder name is missing", func() {
cfg := &DashboardsAsConfig{
cfg := &config{
Name: "Default",
Type: "file",
OrgId: 1,
OrgID: 1,
Folder: "",
Options: map[string]interface{}{
"folder": defaultDashboards,
@@ -218,10 +218,10 @@ func TestDashboardFileReader(t *testing.T) {
})
Convey("can get or Create dashboard folder", func() {
cfg := &DashboardsAsConfig{
cfg := &config{
Name: "Default",
Type: "file",
OrgId: 1,
OrgID: 1,
Folder: "TEAM A",
Options: map[string]interface{}{
"folder": defaultDashboards,
@@ -255,10 +255,10 @@ func TestDashboardFileReader(t *testing.T) {
})
Convey("Given missing dashboard file", func() {
cfg := &DashboardsAsConfig{
cfg := &config{
Name: "Default",
Type: "file",
OrgId: 1,
OrgID: 1,
Options: map[string]interface{}{
"folder": unprovision,
},
@@ -436,7 +436,7 @@ func (s *fakeDashboardProvisioningService) DeleteProvisionedDashboard(dashboardI
return nil
}
func (s *fakeDashboardProvisioningService) GetProvisionedDashboardDataByDashboardId(dashboardID int64) (*models.DashboardProvisioning, error) {
func (s *fakeDashboardProvisioningService) GetProvisionedDashboardDataByDashboardID(dashboardID int64) (*models.DashboardProvisioning, error) {
return nil, nil
}