Skip to content

Commit 705b96e

Browse files
committed
Improvements for tests in Makefile
1 parent 3619f53 commit 705b96e

File tree

3 files changed

+59
-53
lines changed

3 files changed

+59
-53
lines changed

.circleci/config.yml

Lines changed: 33 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -162,55 +162,48 @@ workflows:
162162
version: 2
163163
build_and_package:
164164
jobs:
165-
# - build:
166-
# filters:
167-
# tags:
168-
# only: /.*/
169-
# - build-macos:
170-
# filters:
171-
# branches:
172-
# ignore: /.*/
173-
# tags:
174-
# only: /^v[0-9].*/
165+
- build:
166+
filters:
167+
tags:
168+
only: /.*/
175169
- build-macos:
176170
filters:
177171
branches:
178-
only: /.*/
172+
ignore: /.*/
173+
tags:
174+
only: /^v[0-9].*/
179175
#- build-multiarch-docker:
180176
# filters:
181177
# tags:
182178
# only: /^v[0-9].*/
183179
# branches:
184180
# ignore: /.*/
185-
# - build-gpu:
186-
# filters:
187-
# tags:
188-
# only: /.*/
189-
# - deploy_package:
190-
# name: deploy_branch
191-
# package: branch
192-
# requires:
193-
# - build
194-
# filters:
195-
## # uncomment to debug
196-
## tags:
197-
## only: /.*/
198-
# branches:
199-
# only: master
200-
# - deploy_package:
201-
# name: deploy_release
202-
# package: release
203-
# requires:
204-
# - build
205-
# filters:
206-
# branches:
207-
# ignore: /.*/
208-
# tags:
209-
# only: '/^v[0-9].*/'
210-
# - deploy_docs:
211-
# filters:
212-
# branches:
213-
# only: master
181+
- build-gpu:
182+
filters:
183+
tags:
184+
only: /.*/
185+
- deploy_package:
186+
name: deploy_branch
187+
package: branch
188+
requires:
189+
- build
190+
filters:
191+
branches:
192+
only: master
193+
- deploy_package:
194+
name: deploy_release
195+
package: release
196+
requires:
197+
- build
198+
filters:
199+
branches:
200+
ignore: /.*/
201+
tags:
202+
only: '/^v[0-9].*/'
203+
- deploy_docs:
204+
filters:
205+
branches:
206+
only: master
214207

215208
nightly:
216209
triggers:

opt/Makefile

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ make build # compile and link
1212
make clean # remove build artifacts
1313
ALL=1 # remove entire artifacts directory
1414
make test # run tests
15+
TEST=test # run only test `test` with Redis output
16+
TEST_ARGS=args # add extra RLTest `args`
1517
make pack # create installation packages
1618
PACK_DEPS=0 # do not pack dependencies
1719
INTO=dir # place artifacts in `dir`
@@ -136,25 +138,37 @@ TEST_REPORT_DIR ?= $(PWD)
136138

137139
ifeq ($(TEST),)
138140
TEST=basic_tests.py
141+
PYDEBUG=
142+
else
143+
TEST_ARGS += -s
144+
PYDEBUG=1
139145
endif
140146

147+
TEST_PREFIX=set -e; cd $(ROOT)/test
148+
TEST_CMD=\
149+
DEVICE=$(DEVICE) PYDEBUG=$(PYDEBUG) \
150+
python3 -m RLTest $(TEST_ARGS) --test $(TEST) --module $(INSTALL_DIR)/redisai.so
151+
152+
GEN ?= 1
153+
SLAVES ?= 1
154+
AOF ?= 1
155+
141156
test:
142157
ifneq ($(NO_LFS),1)
143158
$(SHOW)if [ "$(git lfs env > /dev/null 2>&1 ; echo $?)" != "0" ]; then cd $(ROOT); git lfs install; fi
144159
$(SHOW)cd $(ROOT); git lfs pull
145160
endif
146-
$(SHOW)set -e ;\
147-
cd $(ROOT)/test ;\
148-
DEVICE=$(DEVICE) ;\
149-
{ \
150-
python3 -m RLTest $(TEST_ARGS) --test $(TEST) --module $(INSTALL_DIR)/redisai.so ;\
151-
printf "\nTests with --use-slaved:\n\n" ;\
152-
python3 -m RLTest $(TEST_ARGS) --test $(TEST) --module $(INSTALL_DIR)/redisai.so --use-slaves ;\
153-
printf "\nTests with --use-aof:\n\n" ;\
154-
python3 -m RLTest $(TEST_ARGS) --test $(TEST) --module $(INSTALL_DIR)/redisai.so --use-aof ;\
155-
}
156-
# Commented until the MacOS CI is available
157-
# python3 -m RLTest $(TEST_ARGS) --test double-panda.py --module $(INSTALL_DIR)/redisai.so
161+
ifeq ($(GEN),1)
162+
$(SHOW)$(TEST_PREFIX); $(TEST_CMD)
163+
endif
164+
ifeq ($(AOF),1)
165+
$(SHOW)$(TEST_PREFIX); printf "\nTests with --use-aof:\n\n" ;\
166+
$(TEST_CMD) --use-aof
167+
endif
168+
ifeq ($(SLAVES),1)
169+
$(SHOW)$(TEST_PREFIX); printf "\nTests with --use-slaves:\n\n" ;\
170+
$(TEST_CMD) --use-slaves
171+
endif
158172

159173
#----------------------------------------------------------------------------------------------
160174

opt/pack.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ pack_ramp() {
3636
# this is only to extract {semantic_version} into VERSION
3737
RAMPOUT=$(mktemp /tmp/ramp.XXXXXX)
3838
$RAMP_PROG pack -m $ROOT/ramp.yml -o $BINDIR/$PRODUCT.{os}-{architecture}.{semantic_version}.zip $INSTALL_DIR/$PRODUCT.so 2> /dev/null | grep '.zip' > $RAMPOUT
39-
echo "RAMPOUT=`cat $RAMPOUT`"
4039
local rampfile=`realpath $(tail -1 $RAMPOUT)`
4140
rm -f $rampfile $RAMPOUT
4241
echo `basename $rampfile` | sed -e "s/[^.]*\.[^.]*\.\(.*\)\.zip/\1/" > $BINDIR/VERSION

0 commit comments

Comments
 (0)