diff --git a/.github/workflows/build_test_push.yaml b/.github/workflows/build_test_push.yaml index feb5dae..85a355c 100644 --- a/.github/workflows/build_test_push.yaml +++ b/.github/workflows/build_test_push.yaml @@ -16,7 +16,10 @@ jobs: - run: brew install protobuf - - name: Build + - name: Build Slash + run: cd pink/third/slash/slash && make + + - name: Build Pink run: cd pink && make static_lib build-and-run-redis-benchmark: @@ -105,15 +108,17 @@ jobs: # Running this multiple times to check for memory leaks and that overwrites/updates/deletes work - name: Run tests multiple times run: | - for i in {1..100}; do + for i in {1..50}; do docker exec -w $DOCKER_WORK_DIR -i $CONTAINER_NAME bash -c \ - "pink/rondis/tests/get_set.sh $((i % 2))" + "pink/rondis/tests/get_set.sh $((i % 3))" + docker exec -w $DOCKER_WORK_DIR -i $CONTAINER_NAME bash -c \ + "pink/rondis/tests/hget_hset.sh $((i % 5)) $((i % 3))" echo "Success in run $i" done + - name: Run Redis benchmark + run: docker exec -i $CONTAINER_NAME bash -c "redis-benchmark -t incr,get,set,hget,hset,hincr -r 100 -P 10 --threads 3" + - name: Show Rondis logs if: always() run: cat $LOCAL_RONDIS_LOG - - - name: Run Redis benchmark - run: docker exec -i $CONTAINER_NAME bash -c "redis-benchmark -t get,set -r 100 -P 10 --threads 3" diff --git a/pink/rondis/tests/get_set.sh b/pink/rondis/tests/get_set.sh index 7d05740..4df24eb 100755 --- a/pink/rondis/tests/get_set.sh +++ b/pink/rondis/tests/get_set.sh @@ -106,8 +106,7 @@ echo "Testing edge case large key length (Redis allows up to 512MB for the value edge_value=$(head -c 100000 < /dev/zero | tr '\0' 'b') set_and_get "$KEY:edge_large" "$edge_value" -key="key" -incr_key="$key:incr$RANDOM" +incr_key="$KEY:incr${RANDOM}${RANDOM}" incr_output=$(redis-cli INCR "$incr_key") incr_result=$(redis-cli GET "$incr_key") if [[ "$incr_result" == 1 ]]; then diff --git a/pink/rondis/tests/hget_hset.sh b/pink/rondis/tests/hget_hset.sh index efcb517..cb98c71 100755 --- a/pink/rondis/tests/hget_hset.sh +++ b/pink/rondis/tests/hget_hset.sh @@ -2,9 +2,10 @@ set -e -# Change key suffix using script arguments -HASH_KEY="key" -KEY_SUFFIX=${1:-0} +# Change key suffixes using script arguments +HASH_KEY_SUFFIX=${1:-0} +HASH_KEY="key_$HASH_KEY_SUFFIX" +KEY_SUFFIX=${2:-0} KEY="test_key_$KEY_SUFFIX" # Function to set a value and retrieve it, then verify if it matches @@ -107,8 +108,7 @@ echo "Testing edge case large key length (Redis allows up to 512MB for the value edge_value=$(head -c 100000 < /dev/zero | tr '\0' 'b') hset_and_hget "$KEY:edge_large" "$edge_value" -field="key" -incr_field="$field:incr$RANDOM" +incr_field="$KEY:incr${RANDOM}${RANDOM}" incr_output=$(redis-cli HINCR "$HASH_KEY" "$incr_field") incr_result=$(redis-cli HGET "$HASH_KEY" "$incr_field") if [[ "$incr_result" == 1 ]]; then