Skip to content

Commit 73284e3

Browse files
Support cluster test
1 parent 90ae83d commit 73284e3

11 files changed

+1837
-253
lines changed

.github/workflows/4.0.yaml

+16-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v3
1414
- name: clone and build redis
1515
run: |
16-
sudo apt-get install git
16+
sudo apt-get install git ruby
1717
git clone https://github.com/redis/redis
1818
cd redis
1919
git checkout 4.0
@@ -23,6 +23,13 @@ jobs:
2323
run: |
2424
./redis/src/redis-server &
2525
26+
- name: start redis cluster
27+
run: |
28+
sudo gem install redis
29+
cd redis/utils/create-cluster
30+
./create-cluster start
31+
echo yes|./create-cluster create
32+
2633
- name: set up python
2734
uses: actions/setup-python@v4
2835
with:
@@ -38,3 +45,11 @@ jobs:
3845
run: |
3946
cat test.result
4047
grep -q "This is failed tests for" test.result && exit -1 || exit 0
48+
49+
- name: run cluster test
50+
run: python redis_compatibility_test.py --testfile cts.json --port 30001 --specific-version 4.0.0 --cluster --show-failed > cluster.result
51+
52+
- name: check cluster fail tests
53+
run: |
54+
cat cluster.result
55+
grep -q "This is failed tests for" cluster.result && exit -1 || exit 0

.github/workflows/5.0.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ jobs:
2323
run: |
2424
./redis/src/redis-server &
2525
26+
- name: start redis cluster
27+
run: |
28+
cd redis/utils/create-cluster
29+
./create-cluster start
30+
echo yes|./create-cluster create
31+
2632
- name: set up python
2733
uses: actions/setup-python@v4
2834
with:
@@ -38,3 +44,11 @@ jobs:
3844
run: |
3945
cat test.result
4046
grep -q "This is failed tests for" test.result && exit -1 || exit 0
47+
48+
- name: run cluster test
49+
run: python redis_compatibility_test.py --testfile cts.json --port 30001 --specific-version 5.0.0 --cluster --show-failed > cluster.result
50+
51+
- name: check cluster fail tests
52+
run: |
53+
cat cluster.result
54+
grep -q "This is failed tests for" cluster.result && exit -1 || exit 0

.github/workflows/6.0.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ jobs:
2323
run: |
2424
./redis/src/redis-server &
2525
26+
- name: start redis cluster
27+
run: |
28+
cd redis/utils/create-cluster
29+
./create-cluster start
30+
echo yes|./create-cluster create
31+
2632
- name: set up python
2733
uses: actions/setup-python@v4
2834
with:
@@ -38,3 +44,11 @@ jobs:
3844
run: |
3945
cat test.result
4046
grep -q "This is failed tests for" test.result && exit -1 || exit 0
47+
48+
- name: run cluster test
49+
run: python redis_compatibility_test.py --testfile cts.json --port 30001 --specific-version 6.0.0 --cluster --show-failed > cluster.result
50+
51+
- name: check cluster fail tests
52+
run: |
53+
cat cluster.result
54+
grep -q "This is failed tests for" cluster.result && exit -1 || exit 0

.github/workflows/6.2.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ jobs:
2323
run: |
2424
./redis/src/redis-server &
2525
26+
- name: start redis cluster
27+
run: |
28+
cd redis/utils/create-cluster
29+
./create-cluster start
30+
echo yes|./create-cluster create
31+
2632
- name: set up python
2733
uses: actions/setup-python@v4
2834
with:
@@ -38,3 +44,11 @@ jobs:
3844
run: |
3945
cat test.result
4046
grep -q "This is failed tests for" test.result && exit -1 || exit 0
47+
48+
- name: run cluster test
49+
run: python redis_compatibility_test.py --testfile cts.json --port 30001 --specific-version 6.2.0 --cluster --show-failed > cluster.result
50+
51+
- name: check cluster fail tests
52+
run: |
53+
cat cluster.result
54+
grep -q "This is failed tests for" cluster.result && exit -1 || exit 0

.github/workflows/7.0.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ jobs:
2323
run: |
2424
./redis/src/redis-server &
2525
26+
- name: start redis cluster
27+
run: |
28+
cd redis/utils/create-cluster
29+
./create-cluster start
30+
echo yes|./create-cluster create
31+
2632
- name: set up python
2733
uses: actions/setup-python@v4
2834
with:
@@ -38,3 +44,11 @@ jobs:
3844
run: |
3945
cat test.result
4046
grep -q "This is failed tests for" test.result && exit -1 || exit 0
47+
48+
- name: run cluster test
49+
run: python redis_compatibility_test.py --testfile cts.json --port 30001 --specific-version 7.0.0 --cluster --show-failed > cluster.result
50+
51+
- name: check cluster fail tests
52+
run: |
53+
cat cluster.result
54+
grep -q "This is failed tests for" cluster.result && exit -1 || exit 0

.github/workflows/7.2.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ jobs:
2323
run: |
2424
./redis/src/redis-server &
2525
26+
- name: start redis cluster
27+
run: |
28+
cd redis/utils/create-cluster
29+
./create-cluster start
30+
echo yes|./create-cluster create
31+
2632
- name: set up python
2733
uses: actions/setup-python@v4
2834
with:
@@ -38,3 +44,11 @@ jobs:
3844
run: |
3945
cat test.result
4046
grep -q "This is failed tests for" test.result && exit -1 || exit 0
47+
48+
- name: run cluster test
49+
run: python redis_compatibility_test.py --testfile cts.json --port 30001 --specific-version 7.2.0 --cluster --show-failed > cluster.result
50+
51+
- name: check cluster fail tests
52+
run: |
53+
cat cluster.result
54+
grep -q "This is failed tests for" cluster.result && exit -1 || exit 0

.github/workflows/unstable.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ jobs:
2222
run: |
2323
./redis/src/redis-server &
2424
25+
- name: start redis cluster
26+
run: |
27+
cd redis/utils/create-cluster
28+
./create-cluster start
29+
echo yes|./create-cluster create
30+
2531
- name: set up python
2632
uses: actions/setup-python@v4
2733
with:
@@ -37,3 +43,11 @@ jobs:
3743
run: |
3844
cat test.result
3945
grep -q "This is failed tests for" test.result && exit -1 || exit 0
46+
47+
- name: run cluster test
48+
run: python redis_compatibility_test.py --testfile cts.json --port 30001 --cluster --show-failed > cluster.result
49+
50+
- name: check cluster fail tests
51+
run: |
52+
cat cluster.result
53+
grep -q "This is failed tests for" cluster.result && exit -1 || exit 0

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ optional arguments:
2222
--port PORT the redis port
2323
--password PASSWORD the redis password
2424
--testfile TESTFILE the redis compatibility test cases
25-
--specific-version {1.0.0, 2.8.0, 3.2.0, 4.0.0, 5.0.0, 6.0.0, 6.2.0, 7.0.0}
25+
--specific-version {1.0.0,2.8.0,3.2.0,4.0.0,5.0.0,6.0.0,6.2.0,7.0.0,7.2.0}
2626
the redis version
2727
--show-failed show details of failed tests
2828
--cluster server is a node of the Redis cluster
2929
--ssl open ssl connection
30+
--genhtml generate test report in html format
3031
```
3132

3233
Examples:

0 commit comments

Comments
 (0)