Replace check for integration tests. (#110707)
* Replace check for integration tests. * Revert changes in pkg/tsdb/mysql packages. * Fix formatting of few tests.
This commit is contained in:
@@ -25,6 +25,7 @@ import (
|
||||
dashboardV1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1"
|
||||
dashboardV2alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1"
|
||||
dashboardV2beta1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2beta1"
|
||||
"github.com/grafana/grafana/pkg/util/testutil"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
@@ -119,9 +120,7 @@ func TestIntegrationDashboardsAppV0Alpha1(t *testing.T) {
|
||||
Version: dashboardV0.VERSION,
|
||||
Resource: "dashboards",
|
||||
}
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
|
||||
modes := []rest.DualWriterMode{rest.Mode0, rest.Mode1, rest.Mode2, rest.Mode3, rest.Mode4, rest.Mode5}
|
||||
for _, mode := range modes {
|
||||
@@ -145,9 +144,7 @@ func TestIntegrationDashboardsAppV1(t *testing.T) {
|
||||
Version: dashboardV1.VERSION,
|
||||
Resource: "dashboards",
|
||||
}
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
|
||||
modes := []rest.DualWriterMode{rest.Mode0, rest.Mode1, rest.Mode2, rest.Mode3, rest.Mode4, rest.Mode5}
|
||||
for _, mode := range modes {
|
||||
@@ -171,9 +168,7 @@ func TestIntegrationDashboardsAppV2alpha1(t *testing.T) {
|
||||
Version: dashboardV2alpha1.VERSION,
|
||||
Resource: "dashboards",
|
||||
}
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
|
||||
modes := []rest.DualWriterMode{rest.Mode0, rest.Mode1, rest.Mode2, rest.Mode3, rest.Mode4, rest.Mode5}
|
||||
for _, mode := range modes {
|
||||
@@ -197,9 +192,7 @@ func TestIntegrationDashboardsAppV2beta1(t *testing.T) {
|
||||
Version: dashboardV2beta1.VERSION,
|
||||
Resource: "dashboards",
|
||||
}
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
|
||||
modes := []rest.DualWriterMode{rest.Mode0, rest.Mode1, rest.Mode2, rest.Mode3, rest.Mode4, rest.Mode5}
|
||||
for _, mode := range modes {
|
||||
@@ -218,9 +211,8 @@ func TestIntegrationDashboardsAppV2beta1(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationLegacySupport(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
|
||||
ctx := context.Background()
|
||||
helper := apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{})
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/dashboards" // TODO: Check if we can remove this import
|
||||
"github.com/grafana/grafana/pkg/services/quota"
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
"github.com/grafana/grafana/pkg/util/testutil"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
@@ -58,9 +59,7 @@ type TestContext struct {
|
||||
|
||||
// TestIntegrationDashboardAPIValidation tests the dashboard K8s API with validation checks
|
||||
func TestIntegrationDashboardAPIValidation(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
|
||||
dualWriterModes := []rest.DualWriterMode{rest.Mode0, rest.Mode1, rest.Mode2, rest.Mode3, rest.Mode4, rest.Mode5}
|
||||
for _, dualWriterMode := range dualWriterModes {
|
||||
@@ -126,9 +125,7 @@ func TestIntegrationDashboardAPIValidation(t *testing.T) {
|
||||
|
||||
// TestIntegrationDashboardAPIAuthorization tests the dashboard K8s API with authorization checks
|
||||
func TestIntegrationDashboardAPIAuthorization(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
|
||||
dualWriterModes := []rest.DualWriterMode{rest.Mode0, rest.Mode1, rest.Mode2, rest.Mode3, rest.Mode4, rest.Mode5}
|
||||
for _, dualWriterMode := range dualWriterModes {
|
||||
@@ -175,9 +172,7 @@ func TestIntegrationDashboardAPIAuthorization(t *testing.T) {
|
||||
|
||||
// TestIntegrationDashboardAPI tests the dashboard K8s API
|
||||
func TestIntegrationDashboardAPI(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
|
||||
dualWriterModes := []rest.DualWriterMode{rest.Mode0, rest.Mode1, rest.Mode2, rest.Mode3, rest.Mode4, rest.Mode5}
|
||||
for _, dualWriterMode := range dualWriterModes {
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/org"
|
||||
"github.com/grafana/grafana/pkg/tests/apis"
|
||||
"github.com/grafana/grafana/pkg/tests/testinfra"
|
||||
"github.com/grafana/grafana/pkg/util/testutil"
|
||||
)
|
||||
|
||||
// this tests the /api path still, but behind the scenes is using search to get the library connections
|
||||
@@ -22,9 +23,8 @@ import (
|
||||
//
|
||||
// it also ensures we create the connection in modes 0-2 if a dashboard v1 is created with a reference
|
||||
func TestIntegrationLibraryPanelConnections(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
|
||||
dualWriterModes := []rest.DualWriterMode{rest.Mode0, rest.Mode1, rest.Mode2, rest.Mode3, rest.Mode4, rest.Mode5}
|
||||
for _, dualWriterMode := range dualWriterModes {
|
||||
t.Run(fmt.Sprintf("DualWriterMode %d", dualWriterMode), func(t *testing.T) {
|
||||
@@ -87,9 +87,8 @@ func TestIntegrationLibraryPanelConnections(t *testing.T) {
|
||||
// this tests the /apis path to ensure authorization is being enforced. /api integration tests are within the service package
|
||||
// only works in modes 0-2 because the library element is created through the /api path
|
||||
func TestIntegrationLibraryElementPermissions(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
|
||||
dualWriterModes := []rest.DualWriterMode{rest.Mode0, rest.Mode1, rest.Mode2}
|
||||
for _, dualWriterMode := range dualWriterModes {
|
||||
t.Run(fmt.Sprintf("DualWriterMode %d", dualWriterMode), func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user