Fix tests so they work for Redis 7.0
* Redis >= 7.0.0 disables the `DEBUG` command by default, which we need for our unit tests. * Downgrade to Redis 6.2.x in macOS temporarily There is a macOS specific TLS error on large payloads when running against 7.x.x so temporarily run our tests against 6.2, while we investigate the root cause.
This commit is contained in:
parent
95a0c1283a
commit
f4b6ed2898
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
@ -152,7 +152,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
brew install openssl redis
|
brew install openssl redis@6.2
|
||||||
|
brew link redis@6.2 --force
|
||||||
|
|
||||||
- name: Build hiredis
|
- name: Build hiredis
|
||||||
run: USE_SSL=1 make
|
run: USE_SSL=1 make
|
||||||
|
|||||||
9
test.sh
9
test.sh
@ -5,9 +5,16 @@ REDIS_PORT=${REDIS_PORT:-56379}
|
|||||||
REDIS_SSL_PORT=${REDIS_SSL_PORT:-56443}
|
REDIS_SSL_PORT=${REDIS_SSL_PORT:-56443}
|
||||||
TEST_SSL=${TEST_SSL:-0}
|
TEST_SSL=${TEST_SSL:-0}
|
||||||
SKIPS_AS_FAILS=${SKIPS_AS_FAILS-:0}
|
SKIPS_AS_FAILS=${SKIPS_AS_FAILS-:0}
|
||||||
|
ENABLE_DEBUG_CMD=
|
||||||
SSL_TEST_ARGS=
|
SSL_TEST_ARGS=
|
||||||
SKIPS_ARG=
|
SKIPS_ARG=
|
||||||
|
|
||||||
|
# We need to enable the DEBUG command for redis-server >= 7.0.0
|
||||||
|
REDIS_MAJOR_VERSION="$(redis-server --version|awk -F'[^0-9]+' '{ print $2 }')"
|
||||||
|
if [ "$REDIS_MAJOR_VERSION" -gt "6" ]; then
|
||||||
|
ENABLE_DEBUG_CMD="enable-debug-command local"
|
||||||
|
fi
|
||||||
|
|
||||||
tmpdir=$(mktemp -d)
|
tmpdir=$(mktemp -d)
|
||||||
PID_FILE=${tmpdir}/hiredis-test-redis.pid
|
PID_FILE=${tmpdir}/hiredis-test-redis.pid
|
||||||
SOCK_FILE=${tmpdir}/hiredis-test-redis.sock
|
SOCK_FILE=${tmpdir}/hiredis-test-redis.sock
|
||||||
@ -49,8 +56,10 @@ cleanup() {
|
|||||||
}
|
}
|
||||||
trap cleanup INT TERM EXIT
|
trap cleanup INT TERM EXIT
|
||||||
|
|
||||||
|
|
||||||
cat > ${tmpdir}/redis.conf <<EOF
|
cat > ${tmpdir}/redis.conf <<EOF
|
||||||
daemonize yes
|
daemonize yes
|
||||||
|
${ENABLE_DEBUG_CMD}
|
||||||
pidfile ${PID_FILE}
|
pidfile ${PID_FILE}
|
||||||
port ${REDIS_PORT}
|
port ${REDIS_PORT}
|
||||||
bind 127.0.0.1
|
bind 127.0.0.1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user