Skip to content

Commit 1585bd0

Browse files
committed
Fixes #2. Now we can provide a custom redis-server location for the Redis binary to be started during tests
1 parent 2daa6c3 commit 1585bd0

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ LUA_LIB_DIR ?= $(PREFIX)/lib/lua/$(LUA_VERSION)
88
INSTALL ?= install
99
TEST_NGINX_AWS_CLIENT_ID ?= ''
1010
TEST_NGINX_AWS_SECRET ?= ''
11+
REDIS_SERVER ?= $(BUILD_DIR)/redis-$(REDIS_VERSION)/src/redis-server
1112

1213
.PHONY: all clean test install
1314

@@ -27,7 +28,8 @@ install: all
2728

2829
test: redis
2930
echo "Starting redis server on default port"
30-
$(BUILD_DIR)/redis-$(REDIS_VERSION)/src/redis-server test/resources/redis/redis-test.conf
31+
# $(BUILD_DIR)/redis-$(REDIS_VERSION)/src/redis-server test/resources/redis/redis-test.conf
32+
$(REDIS_SERVER) test/resources/redis/redis-test.conf
3133
echo "updating git submodules ..."
3234
if [ ! -d "test/resources/test-nginx/lib" ]; then git submodule update --init --recursive; fi
3335
echo "running tests ..."
@@ -41,8 +43,11 @@ test: redis
4143

4244
redis: all
4345
mkdir -p $(BUILD_DIR)
44-
tar -xf test/resources/redis/redis-$(REDIS_VERSION).tar.gz -C $(BUILD_DIR)/
45-
cd $(BUILD_DIR)/redis-$(REDIS_VERSION) && make
46+
if [ "$(REDIS_SERVER)" = "$(BUILD_DIR)/redis-$(REDIS_VERSION)/src/redis-server" ]; then \
47+
tar -xf test/resources/redis/redis-$(REDIS_VERSION).tar.gz -C $(BUILD_DIR)/;\
48+
cd $(BUILD_DIR)/redis-$(REDIS_VERSION) && make; \
49+
fi
50+
echo " ... using REDIS_SERVER=$(REDIS_SERVER)"
4651

4752
test-docker:
4853
echo "running tests with docker ..."
@@ -60,7 +65,7 @@ test-docker:
6065
rm -rf ~/tmp/apiplatform/api-gateway-request-validation
6166

6267
package:
63-
git archive --format=tar --prefix=api-gateway-request-validation-1.1/ -o api-gateway-request-validation-1.1.tar.gz -v HEAD
68+
git archive --format=tar --prefix=api-gateway-request-validation-1.3.0/ -o api-gateway-request-validation-1.3.0.tar.gz -v HEAD
6469

6570
clean: all
6671
rm -rf $(BUILD_DIR)

0 commit comments

Comments
 (0)