Skip to content

Commit

Permalink
chore: change name to resp-compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
yangbodong22011 committed Jul 15, 2024
1 parent 61e7e08 commit e3bb089
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/4.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ jobs:
run: pip install -r requirements.txt

- name: run test
run: python redis_compatibility_test.py --testfile cts.json --specific-version 4.0.0 --show-failed > test.result
run: python resp_compatibility.py --testfile cts.json --specific-version 4.0.0 --show-failed > test.result

- name: check fail tests
run: |
cat test.result
grep -q "This is failed tests for" test.result && exit -1 || exit 0
- name: run cluster test
run: python redis_compatibility_test.py --testfile cts.json --port 30001 --specific-version 4.0.0 --cluster --show-failed > cluster.result
run: python resp_compatibility.py --testfile cts.json --port 30001 --specific-version 4.0.0 --cluster --show-failed > cluster.result

- name: check cluster fail tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/5.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ jobs:
run: pip install -r requirements.txt

- name: run test
run: python redis_compatibility_test.py --testfile cts.json --specific-version 5.0.0 --show-failed > test.result
run: python resp_compatibility.py --testfile cts.json --specific-version 5.0.0 --show-failed > test.result

- name: check fail tests
run: |
cat test.result
grep -q "This is failed tests for" test.result && exit -1 || exit 0
- name: run cluster test
run: python redis_compatibility_test.py --testfile cts.json --port 30001 --specific-version 5.0.0 --cluster --show-failed > cluster.result
run: python resp_compatibility.py --testfile cts.json --port 30001 --specific-version 5.0.0 --cluster --show-failed > cluster.result

- name: check cluster fail tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/6.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ jobs:
run: pip install -r requirements.txt

- name: run test
run: python redis_compatibility_test.py --testfile cts.json --specific-version 6.0.0 --show-failed > test.result
run: python resp_compatibility.py --testfile cts.json --specific-version 6.0.0 --show-failed > test.result

- name: check fail tests
run: |
cat test.result
grep -q "This is failed tests for" test.result && exit -1 || exit 0
- name: run cluster test
run: python redis_compatibility_test.py --testfile cts.json --port 30001 --specific-version 6.0.0 --cluster --show-failed > cluster.result
run: python resp_compatibility.py --testfile cts.json --port 30001 --specific-version 6.0.0 --cluster --show-failed > cluster.result

- name: check cluster fail tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/6.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ jobs:
run: pip install -r requirements.txt

- name: run test
run: python redis_compatibility_test.py --testfile cts.json --specific-version 6.2.0 --show-failed > test.result
run: python resp_compatibility.py --testfile cts.json --specific-version 6.2.0 --show-failed > test.result

- name: check fail tests
run: |
cat test.result
grep -q "This is failed tests for" test.result && exit -1 || exit 0
- name: run cluster test
run: python redis_compatibility_test.py --testfile cts.json --port 30001 --specific-version 6.2.0 --cluster --show-failed > cluster.result
run: python resp_compatibility.py --testfile cts.json --port 30001 --specific-version 6.2.0 --cluster --show-failed > cluster.result

- name: check cluster fail tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/7.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ jobs:
run: pip install -r requirements.txt

- name: run test
run: python redis_compatibility_test.py --testfile cts.json --specific-version 7.0.0 --show-failed > test.result
run: python resp_compatibility.py --testfile cts.json --specific-version 7.0.0 --show-failed > test.result

- name: check fail tests
run: |
cat test.result
grep -q "This is failed tests for" test.result && exit -1 || exit 0
- name: run cluster test
run: python redis_compatibility_test.py --testfile cts.json --port 30001 --specific-version 7.0.0 --cluster --show-failed > cluster.result
run: python resp_compatibility.py --testfile cts.json --port 30001 --specific-version 7.0.0 --cluster --show-failed > cluster.result

- name: check cluster fail tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/7.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ jobs:
run: pip install -r requirements.txt

- name: run test
run: python redis_compatibility_test.py --testfile cts.json --specific-version 7.2.0 --show-failed > test.result
run: python resp_compatibility.py --testfile cts.json --specific-version 7.2.0 --show-failed > test.result

- name: check fail tests
run: |
cat test.result
grep -q "This is failed tests for" test.result && exit -1 || exit 0
- name: run cluster test
run: python redis_compatibility_test.py --testfile cts.json --port 30001 --specific-version 7.2.0 --cluster --show-failed > cluster.result
run: python resp_compatibility.py --testfile cts.json --port 30001 --specific-version 7.2.0 --cluster --show-failed > cluster.result

- name: check cluster fail tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unstable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ jobs:
run: pip install -r requirements.txt

- name: run test
run: python redis_compatibility_test.py --testfile cts.json --show-failed > test.result
run: python resp_compatibility.py --testfile cts.json --show-failed > test.result

- name: check fail tests
run: |
cat test.result
grep -q "This is failed tests for" test.result && exit -1 || exit 0
- name: run cluster test
run: python redis_compatibility_test.py --testfile cts.json --port 30001 --cluster --show-failed > cluster.result
run: python resp_compatibility.py --testfile cts.json --port 30001 --cluster --show-failed > cluster.result

- name: check cluster fail tests
run: |
Expand Down
12 changes: 6 additions & 6 deletions README-CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# compatibility-test-suite-for-redis
# resp-compatibility

`compatibility-test-suite-for-redis`是一个用来检测你的`Redis-Like`系统兼容到开源`Redis`哪个版本的工具(6.0还是7.0等)。
` resp-compatibility`是一个用来检测你的`Redis-Like`系统兼容到开源`Redis`哪个版本的工具(6.0还是7.0等)。

# 安装

Expand Down Expand Up @@ -33,7 +33,7 @@ optional arguments:
```
例如,测试 host:port 对应的服务是否兼容 Redis 6.2.0 版本并显示失败的测试。
```
$ python3 redis_compatibility_test.py -h host -p port --testfile cts.json --specific-version 6.2.0 --show-failed
$ python3 resp_compatibility.py -h host -p port --testfile cts.json --specific-version 6.2.0 --show-failed
Connecting to 127.0.0.1:6379 use standalone client
test: del command passed
test: unlink command passed
Expand All @@ -42,12 +42,12 @@ test: xtrim command with MINID/LIMIT passed
-------- The result of tests --------
Summary: version: 6.2.0, total tests: 285, passed: 285, rate: 100.00%
```
更多的示例请参考 `python3 redis_compatibility_test.py -h`
更多的示例请参考 `python3 resp_compatibility.py -h`

## cluster
Redis 在 API 层面有两种模式,一个是`Standalone`(Sentinel 模式的 API 兼容性和 Standalone 是一样的),一个是`Cluster`。命令在`Standalone`模式下没有跨 Slot 的限制,但是在集群模式下,要求多 key 的命令(例如 mset/mget命令)必须在同一 Slot 中。因此,我们支持了`--cluster`这个选项来测试系统对于 `Redis Cluster` 模式的兼容性,用法如下:
```
$ python3.9 redis_compatibility_test.py --testfile cts.json --host 127.0.0.1 --port 30001 --cluster --specific-version 6.2.0
$ python3.9 resp_compatibility.py --testfile cts.json --host 127.0.0.1 --port 30001 --cluster --specific-version 6.2.0
connecting to 127.0.0.1:30001 use cluster client
test: del command passed
test: unlink command passed
Expand All @@ -60,7 +60,7 @@ Summary: version: 6.2.0, total tests: 260, passed: 260, rate: 100.00%
## genhtml
您可以使用 `--genhtml` 选项来生成和此[网站](https://tair-opensource.github.io/compatibility-test-suite-for-redis/)相同的 html 报告。 请注意,当使用此选项时候,将会读取 [config.yaml](config.yaml) 文件中的配置进行测试,此时命令行中的 `specific-version` 将会被文件中的覆盖。
```
$ python3.9 redis_compatibility_test.py --testfile cts.json --genhtml --show-failed
$ python3.9 resp_compatibility.py --testfile cts.json --genhtml --show-failed
directory html already exists, will be deleted and renewed.
start test Redis for version 4.0.0
connecting to 127.0.0.1:6379 using standalone client
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# compatibility-test-suite-for-redis
# resp-compatibility

[![4.0](https://github.com/tair-opensource/compatibility-test-suite-for-redis/actions/workflows/4.0.yaml/badge.svg)](https://github.com/tair-opensource/compatibility-test-suite-for-redis/actions/workflows/4.0.yaml) [![5.0](https://github.com/tair-opensource/compatibility-test-suite-for-redis/actions/workflows/5.0.yaml/badge.svg)](https://github.com/tair-opensource/compatibility-test-suite-for-redis/actions/workflows/5.0.yaml) [![6.0](https://github.com/tair-opensource/compatibility-test-suite-for-redis/actions/workflows/6.0.yaml/badge.svg)](https://github.com/tair-opensource/compatibility-test-suite-for-redis/actions/workflows/6.0.yaml) [![6.2](https://github.com/tair-opensource/compatibility-test-suite-for-redis/actions/workflows/6.2.yaml/badge.svg)](https://github.com/tair-opensource/compatibility-test-suite-for-redis/actions/workflows/6.2.yaml) [![7.0](https://github.com/tair-opensource/compatibility-test-suite-for-redis/actions/workflows/7.0.yaml/badge.svg)](https://github.com/tair-opensource/compatibility-test-suite-for-redis/actions/workflows/7.0.yaml) [![7.2](https://github.com/tair-opensource/compatibility-test-suite-for-redis/actions/workflows/7.2.yaml/badge.svg)](https://github.com/tair-opensource/compatibility-test-suite-for-redis/actions/workflows/7.2.yaml) [![unstable](https://github.com/tair-opensource/compatibility-test-suite-for-redis/actions/workflows/unstable.yaml/badge.svg)](https://github.com/tair-opensource/compatibility-test-suite-for-redis/actions/workflows/unstable.yaml)

compatibility-test-suite-for-redis(CTS) is used to test whether your redis-like database is compatible with Redis versions (such as
resp-compatibility is used to test whether your redis-like database is compatible with Redis versions (such as
6.0, 7.0, etc.) [中文文档](README-CN.md)

# Install
Expand Down Expand Up @@ -35,7 +35,7 @@ optional arguments:
```
e.g. Test whether host:port is compatible with redis 6.2.0 and display failure case:
```
$ python3 redis_compatibility_test.py -h host -p port --testfile cts.json --specific-version 6.2.0 --show-failed
$ python3 resp_compatibility.py -h host -p port --testfile cts.json --specific-version 6.2.0 --show-failed
Connecting to 127.0.0.1:6379 use standalone client
test: del command passed
test: unlink command passed
Expand All @@ -44,12 +44,12 @@ test: xtrim command with MINID/LIMIT passed
-------- The result of tests --------
Summary: version: 6.2.0, total tests: 285, passed: 285, rate: 100.00%
```
More examples are shown `python3 redis_compatibility_test.py -h`.
More examples are shown `python3 resp_compatibility.py -h`.

## cluster
Redis has two modes from the API level, namely `Standalone` (Sentinel has no API restrictions like Standalone) and `Cluster`, where the command support of Standalone does not require Cross slot, but Cluster restricts multi-key commands to be executed in the same slot (e.g. mset/mget ), therefore, we support `--cluster` to test the compatibility of cluster mode, you can test your Redis Cluster cluster compatibility as follows:
```
$ python3.9 redis_compatibility_test.py --testfile cts.json --host 127.0.0.1 --port 30001 --cluster --specific-version 6.2.0
$ python3.9 resp_compatibility.py --testfile cts.json --host 127.0.0.1 --port 30001 --cluster --specific-version 6.2.0
connecting to 127.0.0.1:30001 use cluster client
test: del command passed
test: unlink command passed
Expand All @@ -62,7 +62,7 @@ Summary: version: 6.2.0, total tests: 260, passed: 260, rate: 100.00%
## genhtml
You can use `--genhtml` to generate a test report similar to the html of this [website](https://tair-opensource.github.io/compatibility-test-suite-for-redis/). It should be noted that this option will read the configuration in [config.yaml](config.yaml) for testing. Special attention needs to be paid, at this time the `specific-version` specified in your command line will be overwritten by the one in the configuration file.
```
$ python3.9 redis_compatibility_test.py --testfile cts.json --genhtml --show-failed
$ python3.9 resp_compatibility.py --testfile cts.json --genhtml --show-failed
directory html already exists, will be deleted and renewed.
start test Redis for version 4.0.0
connecting to 127.0.0.1:6379 using standalone client
Expand Down
12 changes: 6 additions & 6 deletions redis_compatibility_test.py → resp_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
Examples:
Run tests without specifying a version
python3 redis_compatibility_test.py --testfile cts.json
python3 resp_compatibility.py --testfile cts.json
Run the test for compatibility with Redis 6.2.0
python3 redis_compatibility_test.py --testfile cts.json --specific-version 6.2.0
python3 resp_compatibility.py --testfile cts.json --specific-version 6.2.0
Run the test whether it is compatible with Redis 6.2.0, and print the failure case
python3 redis_compatibility_test.py --testfile cts.json --specific-version 6.2.0 --show-failed
python3 resp_compatibility.py --testfile cts.json --specific-version 6.2.0 --show-failed
Run the test for redis cluster
python3 redis_compatibility_test.py --testfile cts.json --host 127.0.0.1 --port 30001 --cluster
python3 resp_compatibility.py --testfile cts.json --host 127.0.0.1 --port 30001 --cluster
"""


Expand Down Expand Up @@ -329,8 +329,8 @@ def create_client(host, port, password, ssl, cluster):


def parse_args():
parser = argparse.ArgumentParser(prog="redis_compatibility_test",
description="redis_compatibility_test is used to test whether your redis-like "
parser = argparse.ArgumentParser(prog=" resp_compatibility",
description=" resp_compatibility is used to test whether your redis-like "
"database is compatible with Redis versions (such as 6.0, 7.0, etc.)",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=EXAMPLE)
Expand Down

0 comments on commit e3bb089

Please sign in to comment.