Skip to content

Commit

Permalink
Change monitor test to run manually (#3041)
Browse files Browse the repository at this point in the history
* Change monitor test to run manually

* fix
  • Loading branch information
ofekshenawa authored and vladvildanov committed Jul 17, 2024
1 parent a400f09 commit 649d3b6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,29 @@ package redis_test

import (
"context"
"os"
"strings"
"time"

"testing"
"time"

. "github.com/bsm/ginkgo/v2"
. "github.com/bsm/gomega"

"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() {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 649d3b6

Please sign in to comment.