Skip to content

Commit 4cf03db

Browse files
authored
Change monitor test to run manually (#3041)
* Change monitor test to run manually * fix
1 parent daf84a0 commit 4cf03db

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

monitor_test.go

+11-2
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,29 @@ package redis_test
22

33
import (
44
"context"
5+
"os"
56
"strings"
6-
"time"
7-
87
"testing"
8+
"time"
99

1010
. "github.com/bsm/ginkgo/v2"
1111
. "github.com/bsm/gomega"
1212

1313
"github.com/redis/go-redis/v9"
1414
)
1515

16+
// This test is for manual use and is not part of the CI of Go-Redis.
1617
var _ = Describe("Monitor command", Label("monitor"), func() {
1718
ctx := context.TODO()
1819
var client *redis.Client
1920

2021
BeforeEach(func() {
22+
if os.Getenv("RUN_MONITOR_TEST") != "true" {
23+
Skip("Skipping Monitor command test. Set RUN_MONITOR_TEST=true to run it.")
24+
}
2125
client = redis.NewClient(&redis.Options{Addr: ":6379"})
2226
Expect(client.FlushDB(ctx).Err()).NotTo(HaveOccurred())
27+
2328
})
2429

2530
AfterEach(func() {
@@ -51,6 +56,10 @@ var _ = Describe("Monitor command", Label("monitor"), func() {
5156
})
5257

5358
func TestMonitorCommand(t *testing.T) {
59+
if os.Getenv("RUN_MONITOR_TEST") != "true" {
60+
t.Skip("Skipping Monitor command test. Set RUN_MONITOR_TEST=true to run it.")
61+
}
62+
5463
ctx := context.TODO()
5564
client := redis.NewClient(&redis.Options{Addr: ":6379"})
5665
if err := client.FlushDB(ctx).Err(); err != nil {

0 commit comments

Comments
 (0)