Skip to content

Commit 5d5c7eb

Browse files
committed
Improve run-tests action
1 parent 720ce4e commit 5d5c7eb

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

.github/actions/run-tests/action.yml

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@ runs:
3535
CLIENT_LIBS_TEST_IMAGE: "redislabs/client-libs-test:${{ inputs.redis-version }}"
3636
run: |
3737
set -e
38+
39+
echo "::group::Installing dependencies"
3840
pip install -U setuptools wheel
3941
pip install -r requirements.txt
4042
pip install -r dev_requirements.txt
4143
if [ "${{inputs.parser-backend}}" == "hiredis" ]; then
4244
pip install hiredis${{inputs.hiredis-version}}
4345
fi
46+
echo "::endgroup::"
4447
48+
echo "::group::Starting Redis servers"
4549
redis_major_version=$(echo "$REDIS_VERSION" | grep -oP '^\d+')
4650
4751
if (( redis_major_version < 8 )); then
@@ -69,36 +73,33 @@ runs:
6973
fi
7074
7175
sleep 10 # time to settle
76+
echo "::endgroup::"
7277
shell: bash
7378

7479
- name: Run RESP2 tests
75-
run: |
76-
if [ "${{inputs.event-loop}}" == "uvloop" ]; then
77-
invoke standalone-tests --redis-mod-url=${REDIS_MOD_URL} --uvloop --protocol=2
78-
invoke cluster-tests --uvloop --protocol=2
79-
else
80-
invoke standalone-tests --redis-mod-url=${REDIS_MOD_URL} --protocol=2
81-
invoke cluster-tests --protocol=2
82-
fi
83-
shell: bash
84-
85-
- name: Run RESP3 tests
8680
run: |
87-
if [ "${{inputs.event-loop}}" == "uvloop" ]; then
88-
invoke standalone-tests --redis-mod-url=${REDIS_MOD_URL} --uvloop --protocol=3
89-
90-
# hiredis does not support RESP3 on cluster
91-
if [ "${{inputs.parser-backend}}" != 'hiredis' ]; then
92-
invoke cluster-tests --uvloop --protocol=3
81+
run_tests() {
82+
local protocol=$1
83+
local eventloop=""
84+
85+
if [ "${{inputs.event-loop}}" == "uvloop" ]; then
86+
eventloop="--uvloop"
9387
fi
94-
else
95-
invoke standalone-tests --redis-mod-url=${REDIS_MOD_URL} --protocol=3
96-
97-
# hiredis does not support RESP3 on cluster
98-
if [ "${{inputs.parser-backend}}" != 'hiredis' ]; then
99-
invoke cluster-tests --uvloop --protocol=3
88+
89+
echo "::group::RESP${protocol} standalone tests"
90+
echo "REDIS_MOD_URL=${REDIS_MOD_URL}"
91+
invoke standalone-tests --redis-mod-url=${REDIS_MOD_URL} $eventloop --protocol=${protocol}
92+
echo "::endgroup::"
93+
94+
if [ "$protocol" == "2" ] || [ "${{inputs.parser-backend}}" != 'hiredis' ]; then
95+
echo "::group::RESP${protocol} cluster tests"
96+
invoke cluster-tests $eventloop --protocol=${protocol}
97+
echo "::endgroup::"
10098
fi
101-
fi
99+
}
100+
101+
run_tests 2
102+
run_tests 3
102103
shell: bash
103104

104105
- name: Upload test results and profiling data

0 commit comments

Comments
 (0)