Commit 6527a8a
committed
refactor: refactor Redis test setup to use dynamic cluster containers
- Remove hardcoded Redis host addresses
- Add function to set up a Redis cluster container using testcontainers
- Update `TestRedisCluster` to use the new Redis cluster container setup
- Replace individual Redis container setup with cluster container setup in tests
- Dynamically map and assert Redis container ports and host IPs
- Update hosts list in `TestRedisCluster` to use dynamically generated master and slave names
Signed-off-by: appleboy <appleboy.tw@gmail.com>1 parent dc04095 commit 6527a8a
1 file changed
+41
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | 24 | | |
30 | 25 | | |
31 | 26 | | |
| |||
38 | 33 | | |
39 | 34 | | |
40 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
41 | 63 | | |
42 | 64 | | |
43 | 65 | | |
| |||
145 | 167 | | |
146 | 168 | | |
147 | 169 | | |
148 | | - | |
149 | | - | |
| 170 | + | |
| 171 | + | |
150 | 172 | | |
151 | | - | |
152 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
153 | 181 | | |
154 | 182 | | |
155 | 183 | | |
156 | 184 | | |
157 | 185 | | |
158 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
159 | 190 | | |
160 | 191 | | |
161 | 192 | | |
| |||
0 commit comments