Merge branch 'master' into os-add-ts-insertion-filters

This commit is contained in:
ofekshenawa 2024-07-02 16:11:05 +03:00 committed by GitHub
commit c78cab73e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 2 deletions

View File

@ -2,10 +2,10 @@ package redis_test
import ( import (
"context" "context"
"os"
"strings" "strings"
"time"
"testing" "testing"
"time"
. "github.com/bsm/ginkgo/v2" . "github.com/bsm/ginkgo/v2"
. "github.com/bsm/gomega" . "github.com/bsm/gomega"
@ -13,13 +13,18 @@ import (
"github.com/redis/go-redis/v9" "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() { var _ = Describe("Monitor command", Label("monitor"), func() {
ctx := context.TODO() ctx := context.TODO()
var client *redis.Client var client *redis.Client
BeforeEach(func() { 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"}) client = redis.NewClient(&redis.Options{Addr: ":6379"})
Expect(client.FlushDB(ctx).Err()).NotTo(HaveOccurred()) Expect(client.FlushDB(ctx).Err()).NotTo(HaveOccurred())
}) })
AfterEach(func() { AfterEach(func() {
@ -51,6 +56,10 @@ var _ = Describe("Monitor command", Label("monitor"), func() {
}) })
func TestMonitorCommand(t *testing.T) { 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() ctx := context.TODO()
client := redis.NewClient(&redis.Options{Addr: ":6379"}) client := redis.NewClient(&redis.Options{Addr: ":6379"})
if err := client.FlushDB(ctx).Err(); err != nil { if err := client.FlushDB(ctx).Err(); err != nil {