Skip to content

Commit 9fec123

Browse files
committed
stop tests with build redis from source
1 parent e422646 commit 9fec123

File tree

3 files changed

+17
-70
lines changed

3 files changed

+17
-70
lines changed

.github/workflows/build.yml

+7-27
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,6 @@ permissions:
1010
contents: read
1111

1212
jobs:
13-
build:
14-
name: build
15-
runs-on: ubuntu-latest
16-
strategy:
17-
fail-fast: false
18-
matrix:
19-
go-version: [1.22.x, 1.23.x]
20-
21-
steps:
22-
- name: Set up ${{ matrix.go-version }}
23-
uses: actions/setup-go@v5
24-
with:
25-
go-version: ${{ matrix.go-version }}
26-
27-
- name: Checkout code
28-
uses: actions/checkout@v4
29-
30-
- name: Test
31-
run: make test
32-
33-
- name: Upload to Codecov
34-
uses: codecov/codecov-action@v5
35-
with:
36-
files: coverage.txt
37-
token: ${{ secrets.CODECOV_TOKEN }}
3813

3914
benchmark:
4015
name: benchmark
@@ -71,7 +46,6 @@ jobs:
7146
["8.0-M03"]="8.0-M04-pre"
7247
["7.4.2"]="rs-7.4.0-v2"
7348
)
74-
7549
if [[ -v redis_version_mapping[$REDIS_VERSION] ]]; then
7650
echo "REDIS_VERSION=${redis_version_np}" >> $GITHUB_ENV
7751
echo "REDIS_IMAGE=redis:${{ matrix.redis-version }}" >> $GITHUB_ENV
@@ -113,4 +87,10 @@ jobs:
11387
with:
11488
go-version: ${{matrix.go-version}}
11589
redis-version: ${{ matrix.redis-version }}
116-
90+
91+
- name: Upload to Codecov
92+
uses: codecov/codecov-action@v5
93+
with:
94+
files: coverage.txt
95+
token: ${{ secrets.CODECOV_TOKEN }}
96+

main_test.go

+10-15
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ var (
5151

5252
processes map[string]*redisProcess
5353

54-
redisMain *redisProcess
55-
ringShard1, ringShard2, ringShard3 *redisProcess
54+
ringShard1, ringShard2, ringShard3 *redis.Client
5655
sentinelMaster, sentinelSlave1, sentinelSlave2 *redisProcess
5756
sentinel1, sentinel2, sentinel3 *redisProcess
5857
)
@@ -119,19 +118,6 @@ var _ = BeforeSuite(func() {
119118
}
120119

121120
if !RECluster && !RCEDocker {
122-
123-
redisMain, err = startRedis(redisPort)
124-
Expect(err).NotTo(HaveOccurred())
125-
126-
ringShard1, err = startRedis(ringShard1Port)
127-
Expect(err).NotTo(HaveOccurred())
128-
129-
ringShard2, err = startRedis(ringShard2Port)
130-
Expect(err).NotTo(HaveOccurred())
131-
132-
ringShard3, err = startRedis(ringShard3Port)
133-
Expect(err).NotTo(HaveOccurred())
134-
135121
sentinelMaster, err = startRedis(sentinelMasterPort)
136122
Expect(err).NotTo(HaveOccurred())
137123

@@ -159,6 +145,15 @@ var _ = BeforeSuite(func() {
159145
redisAddr = redisStackAddr
160146

161147
if !RECluster {
148+
ringShard1, err = connectTo(ringShard1Port)
149+
Expect(err).NotTo(HaveOccurred())
150+
151+
ringShard2, err = connectTo(ringShard2Port)
152+
Expect(err).NotTo(HaveOccurred())
153+
154+
ringShard3, err = connectTo(ringShard3Port)
155+
Expect(err).NotTo(HaveOccurred())
156+
162157
// populate cluster node information
163158
Expect(configureClusterTopology(ctx, cluster)).NotTo(HaveOccurred())
164159
}

ring_test.go

-28
Original file line numberDiff line numberDiff line change
@@ -130,34 +130,6 @@ var _ = Describe("Redis Ring", func() {
130130
Expect(ringShard2.Info(ctx, "keyspace").Val()).To(ContainSubstring("keys=44"))
131131
})
132132

133-
It("uses single shard when one of the shards is down", func() {
134-
// Stop ringShard2.
135-
Expect(ringShard2.Close()).NotTo(HaveOccurred())
136-
137-
Eventually(func() int {
138-
return ring.Len()
139-
}, "30s").Should(Equal(1))
140-
141-
setRingKeys()
142-
143-
// RingShard1 should have all keys.
144-
Expect(ringShard1.Info(ctx, "keyspace").Val()).To(ContainSubstring("keys=100"))
145-
146-
// Start ringShard2.
147-
var err error
148-
ringShard2, err = startRedis(ringShard2Port)
149-
Expect(err).NotTo(HaveOccurred())
150-
151-
Eventually(func() int {
152-
return ring.Len()
153-
}, "30s").Should(Equal(2))
154-
155-
setRingKeys()
156-
157-
// RingShard2 should have its keys.
158-
Expect(ringShard2.Info(ctx, "keyspace").Val()).To(ContainSubstring("keys=44"))
159-
})
160-
161133
It("supports hash tags", func() {
162134
for i := 0; i < 100; i++ {
163135
err := ring.Set(ctx, fmt.Sprintf("key%d{tag}", i), "value", 0).Err()

0 commit comments

Comments
 (0)