Skip to content

Commit

Permalink
Improvements for tests in Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
rafie committed Jan 30, 2020
1 parent 3619f53 commit 705b96e
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 53 deletions.
73 changes: 33 additions & 40 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,55 +162,48 @@ workflows:
version: 2
build_and_package:
jobs:
# - build:
# filters:
# tags:
# only: /.*/
# - build-macos:
# filters:
# branches:
# ignore: /.*/
# tags:
# only: /^v[0-9].*/
- build:
filters:
tags:
only: /.*/
- build-macos:
filters:
branches:
only: /.*/
ignore: /.*/
tags:
only: /^v[0-9].*/
#- build-multiarch-docker:
# filters:
# tags:
# only: /^v[0-9].*/
# branches:
# ignore: /.*/
# - build-gpu:
# filters:
# tags:
# only: /.*/
# - deploy_package:
# name: deploy_branch
# package: branch
# requires:
# - build
# filters:
## # uncomment to debug
## tags:
## only: /.*/
# branches:
# only: master
# - deploy_package:
# name: deploy_release
# package: release
# requires:
# - build
# filters:
# branches:
# ignore: /.*/
# tags:
# only: '/^v[0-9].*/'
# - deploy_docs:
# filters:
# branches:
# only: master
- build-gpu:
filters:
tags:
only: /.*/
- deploy_package:
name: deploy_branch
package: branch
requires:
- build
filters:
branches:
only: master
- deploy_package:
name: deploy_release
package: release
requires:
- build
filters:
branches:
ignore: /.*/
tags:
only: '/^v[0-9].*/'
- deploy_docs:
filters:
branches:
only: master

nightly:
triggers:
Expand Down
38 changes: 26 additions & 12 deletions opt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ make build # compile and link
make clean # remove build artifacts
ALL=1 # remove entire artifacts directory
make test # run tests
TEST=test # run only test `test` with Redis output
TEST_ARGS=args # add extra RLTest `args`
make pack # create installation packages
PACK_DEPS=0 # do not pack dependencies
INTO=dir # place artifacts in `dir`
Expand Down Expand Up @@ -136,25 +138,37 @@ TEST_REPORT_DIR ?= $(PWD)

ifeq ($(TEST),)
TEST=basic_tests.py
PYDEBUG=
else
TEST_ARGS += -s
PYDEBUG=1
endif

TEST_PREFIX=set -e; cd $(ROOT)/test
TEST_CMD=\
DEVICE=$(DEVICE) PYDEBUG=$(PYDEBUG) \
python3 -m RLTest $(TEST_ARGS) --test $(TEST) --module $(INSTALL_DIR)/redisai.so

GEN ?= 1
SLAVES ?= 1
AOF ?= 1

test:
ifneq ($(NO_LFS),1)
$(SHOW)if [ "$(git lfs env > /dev/null 2>&1 ; echo $?)" != "0" ]; then cd $(ROOT); git lfs install; fi
$(SHOW)cd $(ROOT); git lfs pull
endif
$(SHOW)set -e ;\
cd $(ROOT)/test ;\
DEVICE=$(DEVICE) ;\
{ \
python3 -m RLTest $(TEST_ARGS) --test $(TEST) --module $(INSTALL_DIR)/redisai.so ;\
printf "\nTests with --use-slaved:\n\n" ;\
python3 -m RLTest $(TEST_ARGS) --test $(TEST) --module $(INSTALL_DIR)/redisai.so --use-slaves ;\
printf "\nTests with --use-aof:\n\n" ;\
python3 -m RLTest $(TEST_ARGS) --test $(TEST) --module $(INSTALL_DIR)/redisai.so --use-aof ;\
}
# Commented until the MacOS CI is available
# python3 -m RLTest $(TEST_ARGS) --test double-panda.py --module $(INSTALL_DIR)/redisai.so
ifeq ($(GEN),1)
$(SHOW)$(TEST_PREFIX); $(TEST_CMD)
endif
ifeq ($(AOF),1)
$(SHOW)$(TEST_PREFIX); printf "\nTests with --use-aof:\n\n" ;\
$(TEST_CMD) --use-aof
endif
ifeq ($(SLAVES),1)
$(SHOW)$(TEST_PREFIX); printf "\nTests with --use-slaves:\n\n" ;\
$(TEST_CMD) --use-slaves
endif

#----------------------------------------------------------------------------------------------

Expand Down
1 change: 0 additions & 1 deletion opt/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ pack_ramp() {
# this is only to extract {semantic_version} into VERSION
RAMPOUT=$(mktemp /tmp/ramp.XXXXXX)
$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
echo "RAMPOUT=`cat $RAMPOUT`"
local rampfile=`realpath $(tail -1 $RAMPOUT)`
rm -f $rampfile $RAMPOUT
echo `basename $rampfile` | sed -e "s/[^.]*\.[^.]*\.\(.*\)\.zip/\1/" > $BINDIR/VERSION
Expand Down

0 comments on commit 705b96e

Please sign in to comment.