Skip to content

Commit

Permalink
Update integration test script (#13)
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Hu <[email protected]>
Co-authored-by: Joe Hu <[email protected]>
  • Loading branch information
joehu21 and Joe Hu authored Dec 3, 2024
1 parent 926b6fd commit 373a92e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ make -j unit
make -j test
```

#### To run one integration test:
```text
TEST_PATTERN=<test-function-or-file> make -j test
```
e.g.,
```text
TEST_PATTERN=test_sanity make -j test
TEST_PATTERN=test_rdb.py make -j test
```

## Load the Module
To test the module with a Valkey, you can load the module using any of the following ways:

Expand Down Expand Up @@ -83,4 +93,5 @@ JSON.STRAPPEND
JSON.STRLEN
JSON.TOGGLE
JSON.TYPE
```
```

11 changes: 9 additions & 2 deletions tst/integration/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ pkill -9 -f "valkey-server.*:" || true
pkill -9 -f Valgrind || true
pkill -9 -f "valkey-benchmark" || true

# If environment variable SERVER_VERSION is not set, default to "unstable"
if [ -z "$SERVER_VERSION" ]; then
echo "WARNING: SERVER_VERSION environment variable is not set. Defaulting to \"unstable\"."
export SERVER_VERSION="unstable"
fi

# cd to the current directory of the script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "${DIR}"

export MODULE_PATH=$2/build/src/libjson.so
echo "Running integration tests against Valkey version: $SERVER_VERSION"
echo "Running integration tests against Valkey version $SERVER_VERSION"

if [[ ! -z "${TEST_PATTERN}" ]] ; then
export TEST_PATTERN="-k ${TEST_PATTERN}"
Expand All @@ -31,4 +37,5 @@ if [[ $1 == "test" ]] ; then
else
echo "Unknown target: $1"
exit 1
fi
fi

0 comments on commit 373a92e

Please sign in to comment.