Skip to content

Commit 338e31f

Browse files
committed
test: refactor test functions to use WithAddr instead of WithConnectionString
- Replace `WithConnectionString` with `WithAddr` in multiple test functions Signed-off-by: appleboy <[email protected]>
1 parent a32f1fb commit 338e31f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

redis_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func TestRedisShutdown(t *testing.T) {
9595
defer testcontainers.CleanupContainer(t, redisC)
9696

9797
w := NewWorker(
98-
WithConnectionString(endpoint),
98+
WithAddr(endpoint),
9999
WithChannel("test2"),
100100
)
101101
q, err := queue.NewQueue(
@@ -120,7 +120,7 @@ func TestCustomFuncAndWait(t *testing.T) {
120120
Message: "foo",
121121
}
122122
w := NewWorker(
123-
WithConnectionString(endpoint),
123+
WithAddr(endpoint),
124124
WithChannel("test3"),
125125
WithRunFunc(func(ctx context.Context, m core.QueuedMessage) error {
126126
time.Sleep(500 * time.Millisecond)
@@ -211,7 +211,7 @@ func TestEnqueueJobAfterShutdown(t *testing.T) {
211211
Message: "foo",
212212
}
213213
w := NewWorker(
214-
WithConnectionString(endpoint),
214+
WithAddr(endpoint),
215215
)
216216
q, err := queue.NewQueue(
217217
queue.WithWorker(w),
@@ -236,7 +236,7 @@ func TestJobReachTimeout(t *testing.T) {
236236
Message: "foo",
237237
}
238238
w := NewWorker(
239-
WithConnectionString(endpoint),
239+
WithAddr(endpoint),
240240
WithChannel("timeout"),
241241
WithRunFunc(func(ctx context.Context, m core.QueuedMessage) error {
242242
for {
@@ -276,7 +276,7 @@ func TestCancelJobAfterShutdown(t *testing.T) {
276276
Message: "test",
277277
}
278278
w := NewWorker(
279-
WithConnectionString(endpoint),
279+
WithAddr(endpoint),
280280
WithChannel("cancel"),
281281
WithLogger(queue.NewLogger()),
282282
WithRunFunc(func(ctx context.Context, m core.QueuedMessage) error {
@@ -317,7 +317,7 @@ func TestGoroutineLeak(t *testing.T) {
317317
Message: "foo",
318318
}
319319
w := NewWorker(
320-
WithConnectionString(endpoint),
320+
WithAddr(endpoint),
321321
WithChannel("GoroutineLeak"),
322322
WithLogger(queue.NewEmptyLogger()),
323323
WithRunFunc(func(ctx context.Context, m core.QueuedMessage) error {
@@ -365,7 +365,7 @@ func TestGoroutinePanic(t *testing.T) {
365365
Message: "foo",
366366
}
367367
w := NewWorker(
368-
WithConnectionString(endpoint),
368+
WithAddr(endpoint),
369369
WithChannel("GoroutinePanic"),
370370
WithRunFunc(func(ctx context.Context, m core.QueuedMessage) error {
371371
panic("missing something")

0 commit comments

Comments
 (0)