From 4cf03dbd3981918b66d4d50c64ffa7042d7c1edf Mon Sep 17 00:00:00 2001 From: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> Date: Tue, 2 Jul 2024 16:10:30 +0300 Subject: [PATCH] Change monitor test to run manually (#3041) * Change monitor test to run manually * fix --- monitor_test.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/monitor_test.go b/monitor_test.go index 91a73340..96c33bf1 100644 --- a/monitor_test.go +++ b/monitor_test.go @@ -2,10 +2,10 @@ package redis_test import ( "context" + "os" "strings" - "time" - "testing" + "time" . "github.com/bsm/ginkgo/v2" . "github.com/bsm/gomega" @@ -13,13 +13,18 @@ import ( "github.com/redis/go-redis/v9" ) +// This test is for manual use and is not part of the CI of Go-Redis. var _ = Describe("Monitor command", Label("monitor"), func() { ctx := context.TODO() var client *redis.Client BeforeEach(func() { + if os.Getenv("RUN_MONITOR_TEST") != "true" { + Skip("Skipping Monitor command test. Set RUN_MONITOR_TEST=true to run it.") + } client = redis.NewClient(&redis.Options{Addr: ":6379"}) Expect(client.FlushDB(ctx).Err()).NotTo(HaveOccurred()) + }) AfterEach(func() { @@ -51,6 +56,10 @@ var _ = Describe("Monitor command", Label("monitor"), func() { }) func TestMonitorCommand(t *testing.T) { + if os.Getenv("RUN_MONITOR_TEST") != "true" { + t.Skip("Skipping Monitor command test. Set RUN_MONITOR_TEST=true to run it.") + } + ctx := context.TODO() client := redis.NewClient(&redis.Options{Addr: ":6379"}) if err := client.FlushDB(ctx).Err(); err != nil {