Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change monitor test to run manually #3041

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading