Skip to content

Commit 9e7231f

Browse files
committed
tidy docker compose
1 parent 5961017 commit 9e7231f

File tree

6 files changed

+26
-69
lines changed

6 files changed

+26
-69
lines changed

.github/actions/run-tests/action.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,9 @@ runs:
4040
fi
4141
shell: bash
4242
- name: Set up Docker Compose environment with redis ${{ inputs.redis-version }}
43-
run: docker compose --profile all up -d
44-
shell: bash
43+
run: make docker.start
4544
- name: Run tests
4645
env:
4746
RCE_DOCKER: "true"
4847
RE_CLUSTER: "false"
49-
run: |
50-
make test.ci
51-
shell: bash
48+
run: make test.ci

.github/workflows/build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ jobs:
5656
fi
5757
shell: bash
5858
- name: Set up Docker Compose environment with redis ${{ matrix.redis-version }}
59-
run: docker compose --profile all up -d
60-
shell: bash
59+
run: make docker.start
6160
- name: Benchmark Tests
6261
env:
6362
RCE_DOCKER: "true"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort)
22

33
docker.start:
4-
docker compose --profile all up -d
4+
docker compose --profile all up -d --quiet-pull
55

66
docker.stop:
77
docker compose --profile all down

docker-compose.yml

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -80,60 +80,23 @@ services:
8080
- all
8181

8282

83-
84-
redisRing1:
83+
redis-ring-cluster:
8584
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:rs-7.4.0-v2}
86-
container_name: redis-ring-1
85+
container_name: ring-cluster
8786
environment:
8887
- TLS_ENABLED=yes
8988
- REDIS_CLUSTER=no
9089
- PORT=6390
90+
- NODES=3
9191
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --tls-auth-clients optional --save ""}
9292
ports:
9393
- 6390:6390
94-
volumes:
95-
- "./dockers/ring1:/redis/work"
96-
profiles:
97-
- ring
98-
- cluster
99-
- sentinel
100-
- all-stack
101-
- all
102-
103-
redisRing2:
104-
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:rs-7.4.0-v2}
105-
container_name: redis-ring-2
106-
environment:
107-
- TLS_ENABLED=yes
108-
- REDIS_CLUSTER=no
109-
- PORT=6391
110-
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --tls-auth-clients optional --save ""}
111-
ports:
11294
- 6391:6391
113-
volumes:
114-
- "./dockers/ring2:/redis/work"
115-
profiles:
116-
- ring
117-
- cluster
118-
- sentinel
119-
- all-stack
120-
- all
121-
122-
redisRing3:
123-
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:rs-7.4.0-v2}
124-
container_name: redis-ring-3
125-
environment:
126-
- TLS_ENABLED=yes
127-
- REDIS_CLUSTER=no
128-
- PORT=6392
129-
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --tls-auth-clients optional --save ""}
130-
ports:
13195
- 6392:6392
13296
volumes:
133-
- "./dockers/ring3:/redis/work"
97+
- "./dockers/ring:/redis/work"
13498
profiles:
13599
- ring
136100
- cluster
137-
- sentinel
138101
- all-stack
139-
- all
102+
- all

dockers/.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
osscluster/
2-
ring1/
3-
ring2/
4-
ring3/
2+
ring/
53
standalone/
64
sentinel-cluster/
75
sentinel/

sentinel_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ var _ = Describe("Sentinel", func() {
6262
// Wait until slaves are picked up by sentinel.
6363
Eventually(func() string {
6464
return sentinel1.Info(ctx).Val()
65-
}, "15s", "100ms").Should(ContainSubstring("slaves=2"))
65+
}, "20s", "100ms").Should(ContainSubstring("slaves=2"))
6666
Eventually(func() string {
6767
return sentinel2.Info(ctx).Val()
68-
}, "15s", "100ms").Should(ContainSubstring("slaves=2"))
68+
}, "20s", "100ms").Should(ContainSubstring("slaves=2"))
6969
Eventually(func() string {
7070
return sentinel3.Info(ctx).Val()
71-
}, "15s", "100ms").Should(ContainSubstring("slaves=2"))
71+
}, "20s", "100ms").Should(ContainSubstring("slaves=2"))
7272
})
7373

7474
AfterEach(func() {
@@ -92,7 +92,7 @@ var _ = Describe("Sentinel", func() {
9292
Eventually(func() []string {
9393
slavesAddr = redis.GetSlavesAddrByName(ctx, sentinel, sentinelName)
9494
return slavesAddr
95-
}, "15s", "100ms").Should(HaveLen(2))
95+
}, "20s", "100ms").Should(HaveLen(2))
9696
Eventually(func() bool {
9797
sync := true
9898
for _, addr := range slavesAddr {
@@ -104,7 +104,7 @@ var _ = Describe("Sentinel", func() {
104104
_ = slave.Close()
105105
}
106106
return sync
107-
}, "15s", "100ms").Should(BeTrue())
107+
}, "20s", "100ms").Should(BeTrue())
108108

109109
// Create subscription.
110110
pub := client.Subscribe(ctx, "foo")
@@ -115,19 +115,19 @@ var _ = Describe("Sentinel", func() {
115115
Expect(err).NotTo(HaveOccurred())
116116
Eventually(func() error {
117117
return master.Ping(ctx).Err()
118-
}, "15s", "100ms").Should(HaveOccurred())
118+
}, "20s", "100ms").Should(HaveOccurred())
119119

120120
// Check that client picked up new master.
121121
Eventually(func() string {
122122
return client.Get(ctx, "foo").Val()
123-
}, "15s", "100ms").Should(Equal("master"))
123+
}, "20s", "100ms").Should(Equal("master"))
124124

125125
// Check if subscription is renewed.
126126
var msg *redis.Message
127127
Eventually(func() <-chan *redis.Message {
128128
_ = client.Publish(ctx, "foo", "hello").Err()
129129
return ch
130-
}, "15s", "100ms").Should(Receive(&msg))
130+
}, "20s", "100ms").Should(Receive(&msg))
131131
Expect(msg.Channel).To(Equal("foo"))
132132
Expect(msg.Payload).To(Equal("hello"))
133133
Expect(pub.Close()).NotTo(HaveOccurred())
@@ -217,13 +217,13 @@ var _ = Describe("NewFailoverClusterClient", func() {
217217
// Wait until slaves are picked up by sentinel.
218218
Eventually(func() string {
219219
return sentinel1.Info(ctx).Val()
220-
}, "15s", "100ms").Should(ContainSubstring("slaves=2"))
220+
}, "20s", "100ms").Should(ContainSubstring("slaves=2"))
221221
Eventually(func() string {
222222
return sentinel2.Info(ctx).Val()
223-
}, "15s", "100ms").Should(ContainSubstring("slaves=2"))
223+
}, "20s", "100ms").Should(ContainSubstring("slaves=2"))
224224
Eventually(func() string {
225225
return sentinel3.Info(ctx).Val()
226-
}, "15s", "100ms").Should(ContainSubstring("slaves=2"))
226+
}, "20s", "100ms").Should(ContainSubstring("slaves=2"))
227227
})
228228

229229
AfterEach(func() {
@@ -240,7 +240,7 @@ var _ = Describe("NewFailoverClusterClient", func() {
240240
// Verify.
241241
Eventually(func() string {
242242
return client.Get(ctx, "foo").Val()
243-
}, "15s", "1ms").Should(Equal("master"))
243+
}, "20s", "1ms").Should(Equal("master"))
244244
}
245245

246246
// Create subscription.
@@ -252,19 +252,19 @@ var _ = Describe("NewFailoverClusterClient", func() {
252252
Expect(err).NotTo(HaveOccurred())
253253
Eventually(func() error {
254254
return master.Ping(ctx).Err()
255-
}, "15s", "100ms").Should(HaveOccurred())
255+
}, "20s", "100ms").Should(HaveOccurred())
256256

257257
// Check that client picked up new master.
258258
Eventually(func() string {
259259
return client.Get(ctx, "foo").Val()
260-
}, "15s", "100ms").Should(Equal("master"))
260+
}, "20s", "100ms").Should(Equal("master"))
261261

262262
// Check if subscription is renewed.
263263
var msg *redis.Message
264264
Eventually(func() <-chan *redis.Message {
265265
_ = client.Publish(ctx, "foo", "hello").Err()
266266
return ch
267-
}, "15s", "100ms").Should(Receive(&msg))
267+
}, "20s", "100ms").Should(Receive(&msg))
268268
Expect(msg.Channel).To(Equal("foo"))
269269
Expect(msg.Payload).To(Equal("hello"))
270270
Expect(sub.Close()).NotTo(HaveOccurred())
@@ -342,7 +342,7 @@ var _ = Describe("SentinelAclAuth", func() {
342342
for _, process := range sentinels() {
343343
Eventually(func() string {
344344
return process.Info(ctx).Val()
345-
}, "15s", "100ms").Should(ContainSubstring("sentinels=3"))
345+
}, "20s", "100ms").Should(ContainSubstring("sentinels=3"))
346346
}
347347
})
348348

0 commit comments

Comments
 (0)