Skip to content

Commit 24eb2fc

Browse files
committed
fix(tests): change redis port and add redis instance for example tests
1 parent b7ce3cd commit 24eb2fc

8 files changed

+29
-9
lines changed

.github/workflows/test-redis-enterprise.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
RE_PASS: 12345
4242
RE_CLUSTER_NAME: re-test
4343
RE_USE_OSS_CLUSTER: false
44-
RE_DB_PORT: 6379
44+
RE_DB_PORT: 6979
4545
run: ./build.sh
4646

4747
- name: Test

bench_decode_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func NewClusterClientStub(resp []byte) *ClientStub {
4242

4343
client := NewClusterClient(&ClusterOptions{
4444
PoolSize: 128,
45-
Addrs: []string{":6379"},
45+
Addrs: []string{":6979"},
4646
Dialer: func(ctx context.Context, network, addr string) (net.Conn, error) {
4747
return stub.stubConn(initHello), nil
4848
},
@@ -53,7 +53,7 @@ func NewClusterClientStub(resp []byte) *ClientStub {
5353
{
5454
Start: 0,
5555
End: 16383,
56-
Nodes: []ClusterNode{{Addr: "127.0.0.1:6379"}},
56+
Nodes: []ClusterNode{{Addr: "127.0.0.1:6979"}},
5757
},
5858
}, nil
5959
},

bench_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
func benchmarkRedisClient(ctx context.Context, poolSize int) *redis.Client {
1717
client := redis.NewClient(&redis.Options{
18-
Addr: ":6379",
18+
Addr: ":6979",
1919
DialTimeout: time.Second,
2020
ReadTimeout: time.Second,
2121
WriteTimeout: time.Second,

docker-compose.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
---
22

33
services:
4+
redis-examples:
5+
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:rs-7.4.0-v2}
6+
platform: linux/amd64
7+
container_name: redis-standalone-examples
8+
environment:
9+
- TLS_ENABLED=yes
10+
- REDIS_CLUSTER=no
11+
- PORT=6979
12+
- TLS_PORT=6969
13+
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --tls-auth-clients optional --save ""}
14+
ports:
15+
- 6979:6979
16+
- 6969:6969 # TLS port
17+
volumes:
18+
- "./dockers/standalone-examples:/redis/work"
19+
profiles:
20+
- standalone
21+
- sentinel
22+
- all-stack
23+
- all
424
redis:
525
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:rs-7.4.0-v2}
626
platform: linux/amd64

json_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var _ = Describe("JSON Commands", Label("json"), func() {
2121

2222
setupRedisClient := func(protocolVersion int) *redis.Client {
2323
return redis.NewClient(&redis.Options{
24-
Addr: "localhost:6379",
24+
Addr: "localhost:6979",
2525
DB: 0,
2626
Protocol: protocolVersion,
2727
UnstableResp3: true,
@@ -682,7 +682,7 @@ var _ = Describe("Go-Redis Advanced JSON and RediSearch Tests", func() {
682682

683683
setupRedisClient := func(protocolVersion int) *redis.Client {
684684
return redis.NewClient(&redis.Options{
685-
Addr: "localhost:6379",
685+
Addr: "localhost:6979",
686686
DB: 0,
687687
Protocol: protocolVersion, // Setting RESP2 or RESP3 protocol
688688
UnstableResp3: true, // Enable RESP3 features

main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var (
4141
)
4242

4343
var (
44-
redisStackPort = "6379"
44+
redisStackPort = "6979"
4545
redisStackAddr = ":" + redisStackPort
4646
)
4747

probabilistic_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var _ = Describe("Probabilistic commands", Label("probabilistic"), func() {
1616

1717
setupRedisClient := func(protocolVersion int) *redis.Client {
1818
return redis.NewClient(&redis.Options{
19-
Addr: "localhost:6379",
19+
Addr: "localhost:6979",
2020
DB: 0,
2121
Protocol: protocolVersion,
2222
})

timeseries_commands_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var _ = Describe("RedisTimeseries commands", Label("timeseries"), func() {
1616

1717
setupRedisClient := func(protocolVersion int) *redis.Client {
1818
return redis.NewClient(&redis.Options{
19-
Addr: "localhost:6379",
19+
Addr: "localhost:6979",
2020
DB: 0,
2121
Protocol: protocolVersion,
2222
UnstableResp3: true,

0 commit comments

Comments
 (0)