Skip to content

Commit c4775f1

Browse files
committed
fixes 9
1 parent 7c3ff5c commit c4775f1

File tree

3 files changed

+33
-13
lines changed

3 files changed

+33
-13
lines changed

Dockerfile.gpu-test

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,34 @@ COPY ./opt/ opt/
2222
COPY ./test/test_requirements.txt test/
2323

2424
RUN ./opt/readies/bin/getpy3
25-
RUN ./opt/system-setup.py
25+
RUN set -e ;\
26+
python3 -m virtualenv venv ;\
27+
. ./venv/bin/activate ;\
28+
./opt/system-setup.py
2629

2730
ARG DEPS_ARGS=""
2831
COPY ./get_deps.sh .
29-
RUN if [ "$DEPS_ARGS" = "" ]; then ./get_deps.sh gpu; else env $DEPS_ARGS ./get_deps.sh gpu; fi
32+
RUN set -e ;\
33+
. ./venv/bin/activate ;\
34+
if [ "$DEPS_ARGS" = "" ]; then \
35+
./get_deps.sh gpu ;\
36+
else \
37+
env $DEPS_ARGS ./get_deps.sh gpu ;\
38+
fi
3039

3140
ARG BUILD_ARGS=""
3241
ADD ./ /build
33-
RUN make -C opt build GPU=1 $BUILD_ARGS SHOW=1
42+
RUN set -e ;\
43+
. ./venv/bin/activate ;\
44+
make -C opt build GPU=1 $BUILD_ARGS SHOW=1
3445

3546
ARG PACK=1
3647

37-
RUN if [ "$PACK" = "1" ]; then make -C opt pack GPU=1; fi
48+
RUN if [ "$PACK" = "1" ]; then \
49+
. ./venv/bin/activate ;\
50+
make -C opt pack GPU=1 ;\
51+
fi
3852

3953
RUN git remote set-url origin https://github.com/RedisAI/RedisAI
4054

41-
CMD ["bash", "-c", "make -C opt test GPU=1 SHOW=1"]
55+
CMD ["bash", "-c", ". ./venv/bin/activate; make -C opt test GPU=1 SHOW=1"]

opt/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ ifneq ($(VGD),)
1212
VALGRIND=$(VGD)
1313
endif
1414

15+
ifeq ($(VALGRIND),1)
16+
DEBUG ?= 1
17+
endif
18+
1519
ifeq ($(COV),1)
1620
DEBUG ?= 1
1721
endif
@@ -179,6 +183,8 @@ export GEN ?= 1
179183
export SLAVES ?= 1
180184
export AOF ?= 1
181185

186+
$(info COV_DIR=$(COV_DIR))
187+
182188
test:
183189
$(COVERAGE_RESET)
184190
$(SHOW)\
@@ -187,7 +193,7 @@ test:
187193
GEN=$(GEN) AOF=$(AOF) SLAVES=$(SLAVES) \
188194
VALGRIND=$(VALGRIND) \
189195
$(ROOT)/test/tests.sh
190-
$(COVERAGE_COLLECT_REPORT)
196+
# $(COVERAGE_COLLECT_REPORT)
191197

192198
valgrind:
193199
$(SHOW)$(ROOT)/test/valgrind.sh $(realpath $(INSTALLED_TARGET))

opt/readies/mk/coverage.defs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ COV_EXCLUDE += \
1414
define COVERAGE_RESET
1515
$(SHOW)set -e ;\
1616
echo "Starting coverage analysys." ;\
17-
mkdir -p $$(COV_DIR) ;\
18-
lcov --directory $$(BINROOT) --base-directory $$(SRCDIR) -z > /dev/null 2>&1
17+
mkdir -p $(COV_DIR) ;\
18+
lcov --directory $(BINROOT) --base-directory $(SRCDIR) -z > /dev/null 2>&1
1919
endef
2020

2121
define COVERAGE_COLLECT
2222
$(SHOW)set -e ;\
2323
echo "Collecting coverage data ..." ;\
24-
lcov --capture --directory $$(BINROOT) --base-directory $$(SRCDIR) --output-file $$(COV_INFO) > /dev/null 2>&1 ;\
25-
lcov -o $$(COV_INFO) -r $$(COV_INFO) $$(COV_EXCLUDE) > /dev/null 2>&1
24+
lcov --capture --directory $(BINROOT) --base-directory $(SRCDIR) --output-file $(COV_INFO) > /dev/null 2>&1 ;\
25+
lcov -o $(COV_INFO) -r $(COV_INFO) $(COV_EXCLUDE) > /dev/null 2>&1
2626
endef
2727

2828
define COVERAGE_REPORT
2929
$(SHOW)set -e ;\
30-
lcov -l $$(COV_INFO) ;\
31-
genhtml --legend -o $$(COV_DIR) $$(COV_INFO) > /dev/null 2>&1 ;\
32-
echo "Coverage info at $$(realpath $$(COV_DIR))/index.html"
30+
lcov -l $(COV_INFO) ;\
31+
genhtml --legend -o $(COV_DIR) $(COV_INFO) > /dev/null 2>&1 ;\
32+
echo "Coverage info at $$(realpath $(COV_DIR))/index.html"
3333
endef
3434

3535
define COVERAGE_COLLECT_REPORT

0 commit comments

Comments
 (0)