Chore: Omit integration tests if short test flag is passed (#108777)
* omit integration tests if short test flag is passed * Update pkg/services/ngalert/models/receivers_test.go Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com> * Update pkg/tests/api/alerting/api_ruler_test.go Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com> * Update pkg/tests/api/alerting/api_ruler_test.go Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com> * Update pkg/tests/api/alerting/api_ruler_test.go Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com> * Update pkg/tests/api/alerting/api_ruler_test.go Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com> * Update pkg/tests/api/alerting/api_ruler_test.go Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com> * Update pkg/services/ngalert/models/receivers_test.go Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com> * Update pkg/cmd/grafana-cli/commands/datamigrations/to_unified_storage_test.go Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com> * Update pkg/services/ngalert/models/receivers_test.go Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com> * fix the rest * false positive --------- Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
This commit is contained in:
co-authored by
Matheus Macabu
parent
1a7a7f1d99
commit
a95fb3a37c
@@ -12,6 +12,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegration_CreateLibraryElement(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
scenarioWithPanel(t, "When an admin tries to create a library panel that already exists, it should fail",
|
||||
func(t *testing.T, sc scenarioContext) {
|
||||
// nolint:staticcheck
|
||||
|
||||
@@ -14,6 +14,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegration_DeleteLibraryElement(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
scenarioWithPanel(t, "When an admin tries to delete a library panel that does not exist, it should fail",
|
||||
func(t *testing.T, sc scenarioContext) {
|
||||
resp := sc.service.deleteHandler(sc.reqContext)
|
||||
|
||||
@@ -14,6 +14,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegration_GetAllLibraryElements(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
testScenario(t, "When an admin tries to get all library panels and none exists, it should return none",
|
||||
func(t *testing.T, sc scenarioContext) {
|
||||
resp := sc.service.getAllHandler(sc.reqContext)
|
||||
|
||||
@@ -18,6 +18,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegration_GetLibraryElement(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
scenarioWithPanel(t, "When an admin tries to get a library panel that does not exist, it should fail",
|
||||
func(t *testing.T, sc scenarioContext) {
|
||||
// by uid
|
||||
|
||||
@@ -14,6 +14,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegration_PatchLibraryElement(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
scenarioWithPanel(t, "When an admin tries to patch a library panel that does not exist, it should fail",
|
||||
func(t *testing.T, sc scenarioContext) {
|
||||
cmd := model.PatchLibraryElementCommand{Kind: int64(model.PanelElement), Version: 1}
|
||||
|
||||
@@ -62,6 +62,9 @@ func TestMain(m *testing.M) {
|
||||
}
|
||||
|
||||
func TestIntegration_DeleteLibraryPanelsInFolder(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
scenarioWithPanel(t, "When an admin tries to delete a folder that contains connected library elements, it should fail",
|
||||
func(t *testing.T, sc scenarioContext) {
|
||||
dashJSON := map[string]any{
|
||||
@@ -140,6 +143,9 @@ func TestIntegration_DeleteLibraryPanelsInFolder(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegration_GetLibraryPanelConnections(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
scenarioWithPanel(t, "When an admin tries to get connections of library panel, it should succeed and return correct result",
|
||||
func(t *testing.T, sc scenarioContext) {
|
||||
dashJSON := map[string]any{
|
||||
|
||||
Reference in New Issue
Block a user