Skip to content

Commit 15eb6e9

Browse files
authored
Python: added 3.11, dropped 3.6; Picked up redis-py 4.5.1 (#189)
1 parent eb2c8b8 commit 15eb6e9

File tree

8 files changed

+32
-144
lines changed

8 files changed

+32
-144
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,24 @@ jobs:
1515
timeout-minutes: 40
1616
strategy:
1717
matrix:
18-
platform: ['ubuntu-20.04']
19-
python: ['3.6', '3.7', '3.8', '3.9']
18+
platform: ['ubuntu-20.04', 'macos-11']
19+
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
20+
fail-fast: false
2021

2122
steps:
22-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
2324
# Number of commits to fetch. 0 indicates all history for all branches and tags.
2425
with:
2526
fetch-depth: ''
2627

27-
- name: Install OpenSSL development libraries
28-
run: |
29-
sudo apt-get install -y libssl-dev
30-
3128
- name: Setup Python
32-
uses: actions/setup-python@v1
29+
uses: actions/setup-python@v4
3330
with:
3431
python-version: ${{ matrix.python }}
3532
architecture: x64
3633

3734
- name: Cache pip
38-
uses: actions/cache@v1
35+
uses: actions/cache@v3
3936
with:
4037
path: ~/.cache/pip # This path is specific to Ubuntu
4138
# Look to see if there is a cache hit for the corresponding requirements file
@@ -45,29 +42,18 @@ jobs:
4542
4643
- name: Install Python dependencies
4744
run: |
48-
sudo apt-get install -y python3-setuptools
4945
pip install poetry
5046
poetry config virtualenvs.create false
5147
poetry export --dev --without-hashes -o requirements-${{matrix.platform}}-${{matrix.python}}.txt
5248
pip install -r requirements-${{matrix.platform}}-${{matrix.python}}.txt
5349
54-
# - name: Cache Redis
55-
# id: cache-redis
56-
# uses: actions/cache@v1
57-
# with:
58-
# path: redis
59-
# key: ${{ matrix.platform }}-${{ matrix.python }}-redis
60-
# restore-keys: |
61-
# ${{ matrix.platform }}-${{ matrix.python }}-redis
62-
6350
- name: Install Redis Server test dependencies
6451
# if: steps.cache-redis.outputs.cache-hit != 'true'
6552
run: |
6653
git clone https://github.com/redis/redis.git --branch 6.2.7 --depth 1
6754
cd redis
6855
make BUILD_TLS=yes -j
6956
./src/redis-server --version
70-
cd ..
7157
7258
- name: Generate test certificates
7359
run: |
@@ -92,9 +78,7 @@ jobs:
9278
run: |
9379
cd tests/flow
9480
make -C modules
95-
CONTAINS_MODULES=1 RLTest --env oss -v --clear-logs --oss-redis-path ../../redis/src/redis-server \
96-
--module modules/module1.so
97-
cd ..
81+
CONTAINS_MODULES=1 RLTest --env oss -v --clear-logs --oss-redis-path ../../redis/src/redis-server --module modules/module1.so
9882
9983
- name: Flow Test OSS Multiple Modules --use-slaves
10084
run: |
@@ -103,7 +87,6 @@ jobs:
10387
CONTAINS_MODULES=1 RLTest --env oss -v --clear-logs --oss-redis-path ../../redis/src/redis-server \
10488
--module modules/module1.so --module-args '' --module modules/module2.so --module-args '' \
10589
--use-slaves
106-
cd ..
10790
10891
- name: Flow Test OSS Multiple Modules --use-aof
10992
run: |
@@ -112,47 +95,40 @@ jobs:
11295
CONTAINS_MODULES=1 RLTest --env oss -v --clear-logs --oss-redis-path ../../redis/src/redis-server \
11396
--module modules/module1.so --module-args '' --module modules/module2.so --module-args '' \
11497
--use-aof
115-
cd ..
11698
11799
- name: Flow Test OSS Multiple Modules
118100
run: |
119101
cd tests/flow
120102
make -C modules
121103
CONTAINS_MODULES=1 RLTest --env oss -v --clear-logs --oss-redis-path ../../redis/src/redis-server \
122104
--module modules/module1.so --module-args '' --module modules/module2.so --module-args ''
123-
cd ..
124105
125106
- name: Flow Test OSS-CLUSTER Modules
126107
run: |
127108
cd tests/flow
128109
make -C modules
129110
CONTAINS_MODULES=1 RLTest --env oss-cluster -v --clear-logs --oss-redis-path ../../redis/src/redis-server \
130111
--module modules/module1.so --module-args '' --module modules/module2.so --module-args ''
131-
cd ..
132112
133113
- name: Flow Test OSS TCP
134114
run: |
135115
cd tests/flow
136116
RLTest --env oss -v --clear-logs --oss-redis-path ../../redis/src/redis-server
137-
cd ..
138117
139118
- name: Flow Test OSS UNIX SOCKETS
140119
run: |
141120
cd tests/flow
142121
RLTest --env oss -v --clear-logs --oss-redis-path ../../redis/src/redis-server
143-
cd ..
144122
145123
- name: Flow Test OSS TCP SLAVES
146124
run: |
147125
cd tests/flow
148126
RLTest --env oss -v --unix --clear-logs --oss-redis-path ../../redis/src/redis-server
149-
cd ..
150127
151128
- name: Flow Test OSS-CLUSTER TCP
152129
run: |
153130
cd tests/flow
154131
RLTest --env oss-cluster -v --clear-logs --shards-count 3 --oss-redis-path ../../redis/src/redis-server
155-
cd ..
156132
157133
- name: Flow Test OSS TCP with TLS
158134
run: |
@@ -163,7 +139,6 @@ jobs:
163139
--tls-key-file ../../redis/tests/tls/redis.key \
164140
--tls-ca-cert-file ../../redis/tests/tls/ca.crt \
165141
--tls
166-
cd ..
167142
168143
- name: Flow Test OSS-CLUSTER with TLS
169144
run: |
@@ -174,7 +149,6 @@ jobs:
174149
--tls-key-file ../../redis/tests/tls/redis.key \
175150
--tls-ca-cert-file ../../redis/tests/tls/ca.crt \
176151
--tls
177-
cd ..
178152
179153
- name: Flow Test OSS-CLUSTER with SLAVES and TLS
180154
run: |
@@ -185,10 +159,9 @@ jobs:
185159
--tls-key-file ../../redis/tests/tls/redis.key \
186160
--tls-ca-cert-file ../../redis/tests/tls/ca.crt \
187161
--tls
188-
cd ../..
189162
190163
- name: Generate coverage report
191-
if: matrix.python == '3.6'
164+
if: matrix.python == '3.9' && matrix.platform != 'macos-11'
192165
run: |
193166
TLS_CERT=./redis/tests/tls/redis.crt \
194167
TLS_KEY=./redis/tests/tls/redis.key \
@@ -197,8 +170,8 @@ jobs:
197170
pytest --ignore=tests/flow --ignore=test_example.py --cov-config=.coveragerc --cov-report=xml --cov=RLTest
198171
199172
- name: Upload coverage to Codecov
200-
uses: codecov/codecov-action@v1
201-
if: matrix.python == '3.6'
173+
uses: codecov/codecov-action@v3
174+
if: matrix.python == '3.9' && matrix.platform != 'macos-11'
202175
with:
203176
token: ${{ secrets.CODECOV_TOKEN }}
204177
file: ./coverage.xml

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,6 @@ venv.bak/
112112

113113
# vscode
114114
.vscode
115+
116+
# Misc
117+
/1/

RLTest.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

RLTest/__main__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,13 @@ def _runTest(self, test, numberOfAssertionFailed=0, prefix='', before=None, afte
582582
if not test.is_method:
583583
Defaults.curr_test_name = testFullName
584584

585-
if len(inspect.getargspec(test.target).args) > 0 and not test.is_method:
585+
try:
586+
# Python < 3.11
587+
test_args = inspect.getargspec(test.target).args
588+
except:
589+
test_args = inspect.getfullargspec(test.target).args
590+
591+
if len(test_args) > 0 and not test.is_method:
586592
try:
587593
env = Env(testName=test.name)
588594
except Exception as e:

RLTest2.sh

Lines changed: 0 additions & 41 deletions
This file was deleted.

RLTest3.sh

Lines changed: 0 additions & 41 deletions
This file was deleted.

pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[tool.poetry]
22
name = "RLTest"
3-
version = "0.5.12"
4-
description="Redis Labs Test Framework, allow to run tests on redis and modules on a variety of environments"
5-
authors = ["RedisLabs <oss@redislabs.com>"]
3+
version = "0.6.0"
4+
description="Redis Modules Test Framework, allow to run tests on redis and modules on a variety of environments"
5+
authors = ["Redis, Inc. <oss@redis.com>"]
66
license = "BSD-3-Clause"
77
readme = "README.md"
88

@@ -14,19 +14,19 @@ classifiers = [
1414
'Topic :: Database',
1515
'Programming Language :: Python',
1616
'Intended Audience :: Developers',
17-
'Programming Language :: Python :: 3.6',
1817
'Programming Language :: Python :: 3.7',
1918
'Programming Language :: Python :: 3.8',
2019
'Programming Language :: Python :: 3.9',
2120
'Programming Language :: Python :: 3.10',
21+
'Programming Language :: Python :: 3.11',
2222
'License :: OSI Approved :: BSD License',
2323
'Development Status :: 5 - Production/Stable'
2424
]
2525

2626
[tool.poetry.dependencies]
27-
python = ">= 3.6.0"
27+
python = ">= 3.7.0"
2828
distro = "^1.5.0"
29-
redis = "^4.2.2"
29+
redis = "^4.5.1"
3030
psutil = "5.8.0" # 5.9.0 currently broken on macOS
3131
pytest-cov = "2.5"
3232

tests/flow/modules/Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
55
ifeq ($(uname_S),Linux)
66
SHOBJ_CFLAGS ?= -fno-common -g -ggdb
77
SHOBJ_LDFLAGS ?= -shared -Bsymbolic
8+
CC=gcc
89
else
910
SHOBJ_CFLAGS ?= -dynamic -fno-common -g -ggdb
10-
SHOBJ_LDFLAGS ?= -bundle -undefined dynamic_lookup
11+
SHOBJ_LDFLAGS ?= -dynamiclib -undefined dynamic_lookup
12+
CC=clang
1113
endif
12-
CFLAGS = -I$(RM_INCLUDE_DIR) -Wall -g -fPIC -lc -lm -std=gnu99
13-
CC=gcc
14+
CFLAGS = -I$(RM_INCLUDE_DIR) -Wall -g -fPIC -std=gnu99
1415

1516
all: module1.so module2.so
1617

1718
module1.so: module1.o
18-
$(LD) -o $@ module1.o $(SHOBJ_LDFLAGS) $(LIBS) -lc
19+
$(CC) -o $@ module1.o $(SHOBJ_LDFLAGS) $(LIBS)
1920

2021
module2.so: module2.o
21-
$(LD) -o $@ module2.o $(SHOBJ_LDFLAGS) $(LIBS) -lc
22+
$(CC) -o $@ module2.o $(SHOBJ_LDFLAGS) $(LIBS)
2223

2324
clean:
2425
rm -rf *.xo *.so *.o

0 commit comments

Comments
 (0)