Skip to content

Commit

Permalink
Test with valgrind
Browse files Browse the repository at this point in the history
  • Loading branch information
kristjanvalur committed Jul 7, 2022
1 parent b56a062 commit f52ad49
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,25 @@ jobs:
name: Build all, plus default examples, run tests against redis

runs-on: ubuntu-latest
env:
# the docker image used by the test.sh
REDIS_DOCKER: redis:alpine

steps:

- name: install prerequisites
run: sudo apt-get update && sudo apt-get install -y libev-dev libevent-dev libglib2.0-dev libssl-dev
run: sudo apt-get update && sudo apt-get install -y libev-dev libevent-dev libglib2.0-dev libssl-dev valgrind
- uses: actions/checkout@v2
- name: run make
run: make all examples
- name: Run unittests
run: make check
- name: Run tests with valgrind
env:
REDIS_DOCKER: redis:alpine
TEST_PREFIX: valgrind --error-exitcode=100
SKIPS_ARG: --skip-throughput
run: make check

build-32-bit:
name: Build and test minimal 32 bit linux
runs-on: ubuntu-latest
Expand Down
7 changes: 4 additions & 3 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ REDIS_SERVER=${REDIS_SERVER:-redis-server}
REDIS_PORT=${REDIS_PORT:-56379}
REDIS_SSL_PORT=${REDIS_SSL_PORT:-56443}
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=
SKIPS_ARG=
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 }')"
Expand Down Expand Up @@ -104,6 +105,6 @@ echo waiting for server
while [ ! -S "${SOCK_FILE}" ]; do sleep 1; done

# Treat skips as failures if directed
[ "$SKIPS_AS_FAILS" = 1 ] && SKIPS_ARG="--skips-as-fails"
[ "$SKIPS_AS_FAILS" = 1 ] && SKIPS_ARG="${SKIPS_ARG} --skips-as-fails"

${TEST_PREFIX:-} ./hiredis-test -h 127.0.0.1 -p ${REDIS_PORT} -s ${SOCK_FILE} ${SSL_TEST_ARGS} ${SKIPS_ARG}

0 comments on commit f52ad49

Please sign in to comment.