K8s: Enable integration tests on folders and dashboards (#103075)

K8s: Enable e2e tests on folders and dashboards
This commit is contained in:
Stephanie Hingtgen
2025-03-31 04:02:19 -06:00
committed by GitHub
parent 54a51bd3e3
commit dd628903f4
3 changed files with 61 additions and 7 deletions

View File

@ -28,10 +28,21 @@ func TestIntegrationUpdateFolder(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testUpdateFolder(t, []string{})
}
func TestIntegrationUpdateFolderK8s(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testUpdateFolder(t, []string{featuremgmt.FlagKubernetesClientDashboardsFolders})
}
func testUpdateFolder(t *testing.T, featureToggles []string) {
dir, path := testinfra.CreateGrafDir(t, testinfra.GrafanaOpts{
DisableAnonymous: true,
EnableQuota: true,
DisableAnonymous: true,
EnableQuota: true,
EnableFeatureToggles: featureToggles,
})
grafanaListedAddr, env := testinfra.StartGrafanaEnv(t, dir, path)
@ -65,10 +76,21 @@ func TestIntegrationCreateFolder(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testCreateFolder(t, []string{})
}
func TestIntegrationCreateFolderK8s(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testCreateFolder(t, []string{featuremgmt.FlagKubernetesClientDashboardsFolders})
}
func testCreateFolder(t *testing.T, featureToggles []string) {
dir, path := testinfra.CreateGrafDir(t, testinfra.GrafanaOpts{
DisableAnonymous: true,
EnableQuota: true,
DisableAnonymous: true,
EnableQuota: true,
EnableFeatureToggles: featureToggles,
})
grafanaListedAddr, env := testinfra.StartGrafanaEnv(t, dir, path)
@ -103,11 +125,21 @@ func TestIntegrationNestedFoldersOn(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testNestedFoldersOn(t, []string{})
}
func TestIntegrationNestedFoldersOnK8s(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testNestedFoldersOn(t, []string{featuremgmt.FlagKubernetesClientDashboardsFolders})
}
func testNestedFoldersOn(t *testing.T, featureToggles []string) {
dir, path := testinfra.CreateGrafDir(t, testinfra.GrafanaOpts{
DisableAnonymous: true,
EnableQuota: true,
EnableFeatureToggles: []string{featuremgmt.FlagNestedFolders},
EnableFeatureToggles: featureToggles,
})
grafanaListedAddr, env := testinfra.StartGrafanaEnv(t, dir, path)