Dashboards: Fix lint issue (#104497)
This commit is contained in:
@@ -28,7 +28,6 @@ import (
|
|||||||
dashboardv2alpha1 "github.com/grafana/grafana/pkg/apis/dashboard/v2alpha1"
|
dashboardv2alpha1 "github.com/grafana/grafana/pkg/apis/dashboard/v2alpha1"
|
||||||
grafanaregistry "github.com/grafana/grafana/pkg/apiserver/registry/generic"
|
grafanaregistry "github.com/grafana/grafana/pkg/apiserver/registry/generic"
|
||||||
"github.com/grafana/grafana/pkg/infra/db"
|
"github.com/grafana/grafana/pkg/infra/db"
|
||||||
"github.com/grafana/grafana/pkg/infra/log"
|
|
||||||
"github.com/grafana/grafana/pkg/infra/tracing"
|
"github.com/grafana/grafana/pkg/infra/tracing"
|
||||||
"github.com/grafana/grafana/pkg/services/accesscontrol"
|
"github.com/grafana/grafana/pkg/services/accesscontrol"
|
||||||
"github.com/grafana/grafana/pkg/services/apiserver/builder"
|
"github.com/grafana/grafana/pkg/services/apiserver/builder"
|
||||||
@@ -51,8 +50,7 @@ var (
|
|||||||
|
|
||||||
// This is used just so wire has something unique to return
|
// This is used just so wire has something unique to return
|
||||||
type DashboardsAPIBuilder struct {
|
type DashboardsAPIBuilder struct {
|
||||||
dashboardService dashboards.DashboardService
|
features featuremgmt.FeatureToggles
|
||||||
features featuremgmt.FeatureToggles
|
|
||||||
|
|
||||||
accessControl accesscontrol.AccessControl
|
accessControl accesscontrol.AccessControl
|
||||||
legacy *DashboardStorage
|
legacy *DashboardStorage
|
||||||
@@ -61,7 +59,6 @@ type DashboardsAPIBuilder struct {
|
|||||||
scheme *runtime.Scheme
|
scheme *runtime.Scheme
|
||||||
search *SearchHandler
|
search *SearchHandler
|
||||||
|
|
||||||
log log.Logger
|
|
||||||
reg prometheus.Registerer
|
reg prometheus.Registerer
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +66,6 @@ func RegisterAPIService(
|
|||||||
cfg *setting.Cfg,
|
cfg *setting.Cfg,
|
||||||
features featuremgmt.FeatureToggles,
|
features featuremgmt.FeatureToggles,
|
||||||
apiregistration builder.APIRegistrar,
|
apiregistration builder.APIRegistrar,
|
||||||
dashboardService dashboards.DashboardService,
|
|
||||||
provisioningDashboardService dashboards.DashboardProvisioningService,
|
provisioningDashboardService dashboards.DashboardProvisioningService,
|
||||||
accessControl accesscontrol.AccessControl,
|
accessControl accesscontrol.AccessControl,
|
||||||
provisioning provisioning.ProvisioningService,
|
provisioning provisioning.ProvisioningService,
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ func TestMain(m *testing.M) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runDashboardTest(t *testing.T, helper *apis.K8sTestHelper, gvr schema.GroupVersionResource) {
|
func runDashboardTest(t *testing.T, helper *apis.K8sTestHelper, gvr schema.GroupVersionResource) {
|
||||||
|
t.Skip("dashboard apis are currently disabled")
|
||||||
t.Run("simple crud+list", func(t *testing.T) {
|
t.Run("simple crud+list", func(t *testing.T) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
client := helper.GetResourceClient(apis.ResourceClientArgs{
|
client := helper.GetResourceClient(apis.ResourceClientArgs{
|
||||||
@@ -109,6 +110,7 @@ func runDashboardTest(t *testing.T, helper *apis.K8sTestHelper, gvr schema.Group
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestIntegrationDashboardsAppV0Alpha1(t *testing.T) {
|
func TestIntegrationDashboardsAppV0Alpha1(t *testing.T) {
|
||||||
|
t.Skip("dashboard apis are currently disabled")
|
||||||
gvr := schema.GroupVersionResource{
|
gvr := schema.GroupVersionResource{
|
||||||
Group: "dashboard.grafana.app",
|
Group: "dashboard.grafana.app",
|
||||||
Version: "v0alpha1",
|
Version: "v0alpha1",
|
||||||
@@ -253,6 +255,7 @@ func TestIntegrationDashboardsAppV1Alpha1(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestIntegrationLegacySupport(t *testing.T) {
|
func TestIntegrationLegacySupport(t *testing.T) {
|
||||||
|
t.Skip("dashboard apis are currently disabled")
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
helper := apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
|
helper := apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
|
||||||
EnableFeatureToggles: []string{
|
EnableFeatureToggles: []string{
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ func TestIntegrationFoldersApp(t *testing.T) {
|
|||||||
if testing.Short() {
|
if testing.Short() {
|
||||||
t.Skip("skipping integration test")
|
t.Skip("skipping integration test")
|
||||||
}
|
}
|
||||||
|
t.Skip("api is currently disabled")
|
||||||
helper := apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
|
helper := apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
|
||||||
AppModeProduction: true,
|
AppModeProduction: true,
|
||||||
EnableFeatureToggles: []string{
|
EnableFeatureToggles: []string{
|
||||||
@@ -492,6 +493,7 @@ func TestIntegrationFolderCreatePermissions(t *testing.T) {
|
|||||||
if testing.Short() {
|
if testing.Short() {
|
||||||
t.Skip("skipping integration test")
|
t.Skip("skipping integration test")
|
||||||
}
|
}
|
||||||
|
t.Skip("api is currently disabled")
|
||||||
t.Skip("not working yet")
|
t.Skip("not working yet")
|
||||||
|
|
||||||
folderWithoutParentInput := "{ \"uid\": \"uid\", \"title\": \"Folder\"}"
|
folderWithoutParentInput := "{ \"uid\": \"uid\", \"title\": \"Folder\"}"
|
||||||
@@ -617,6 +619,7 @@ func TestIntegrationFolderGetPermissions(t *testing.T) {
|
|||||||
if testing.Short() {
|
if testing.Short() {
|
||||||
t.Skip("skipping integration test")
|
t.Skip("skipping integration test")
|
||||||
}
|
}
|
||||||
|
t.Skip("api is currently disabled")
|
||||||
t.Skip("not yet working")
|
t.Skip("not yet working")
|
||||||
|
|
||||||
type testCase struct {
|
type testCase struct {
|
||||||
@@ -768,6 +771,7 @@ func TestFoldersCreateAPIEndpointK8S(t *testing.T) {
|
|||||||
if testing.Short() {
|
if testing.Short() {
|
||||||
t.Skip("skipping integration test")
|
t.Skip("skipping integration test")
|
||||||
}
|
}
|
||||||
|
t.Skip("api is currently disabled")
|
||||||
|
|
||||||
folderWithoutParentInput := "{ \"uid\": \"uid\", \"title\": \"Folder\"}"
|
folderWithoutParentInput := "{ \"uid\": \"uid\", \"title\": \"Folder\"}"
|
||||||
folderWithTitleEmpty := "{ \"title\": \"\"}"
|
folderWithTitleEmpty := "{ \"title\": \"\"}"
|
||||||
@@ -929,6 +933,7 @@ func TestFoldersGetAPIEndpointK8S(t *testing.T) {
|
|||||||
if testing.Short() {
|
if testing.Short() {
|
||||||
t.Skip("skipping integration test")
|
t.Skip("skipping integration test")
|
||||||
}
|
}
|
||||||
|
t.Skip("api is currently disabled")
|
||||||
|
|
||||||
type testCase struct {
|
type testCase struct {
|
||||||
description string
|
description string
|
||||||
|
|||||||
@@ -28,8 +28,7 @@ func TestIntegrationOpenAPIs(t *testing.T) {
|
|||||||
h := NewK8sTestHelper(t, testinfra.GrafanaOpts{
|
h := NewK8sTestHelper(t, testinfra.GrafanaOpts{
|
||||||
AppModeProduction: true,
|
AppModeProduction: true,
|
||||||
EnableFeatureToggles: []string{
|
EnableFeatureToggles: []string{
|
||||||
featuremgmt.FlagKubernetesClientDashboardsFolders, // Will be default on by G12
|
featuremgmt.FlagQueryService, // Query Library
|
||||||
featuremgmt.FlagQueryService, // Query Library
|
|
||||||
featuremgmt.FlagProvisioning,
|
featuremgmt.FlagProvisioning,
|
||||||
featuremgmt.FlagInvestigationsBackend,
|
featuremgmt.FlagInvestigationsBackend,
|
||||||
},
|
},
|
||||||
@@ -60,12 +59,6 @@ func TestIntegrationOpenAPIs(t *testing.T) {
|
|||||||
dir := "openapi_snapshots"
|
dir := "openapi_snapshots"
|
||||||
|
|
||||||
var groups = []schema.GroupVersion{{
|
var groups = []schema.GroupVersion{{
|
||||||
Group: "dashboard.grafana.app",
|
|
||||||
Version: "v0alpha1",
|
|
||||||
}, {
|
|
||||||
Group: "folder.grafana.app",
|
|
||||||
Version: "v0alpha1",
|
|
||||||
}, {
|
|
||||||
Group: "iam.grafana.app",
|
Group: "iam.grafana.app",
|
||||||
Version: "v0alpha1",
|
Version: "v0alpha1",
|
||||||
}, {
|
}, {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ func TestMain(m *testing.M) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestIntegrationProvisioning(t *testing.T) {
|
func TestIntegrationProvisioning(t *testing.T) {
|
||||||
|
t.Skip("dashboard and folder apis are currently disabled")
|
||||||
if testing.Short() {
|
if testing.Short() {
|
||||||
t.Skip("skipping integration test")
|
t.Skip("skipping integration test")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user