File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 31
31
32
32
SKIP_SQUASH ?= 1
33
33
DOCKER_BUILD_CONTEXT ?= .
34
+ TEST_ENV := local
34
35
35
36
script_env = \
36
37
SKIP_SQUASH=$(SKIP_SQUASH ) \
@@ -39,7 +40,8 @@ script_env = \
39
40
CLEAN_AFTER=$(CLEAN_AFTER ) \
40
41
DOCKER_BUILD_CONTEXT=$(DOCKER_BUILD_CONTEXT ) \
41
42
OPENSHIFT_NAMESPACES="$(OPENSHIFT_NAMESPACES ) " \
42
- CUSTOM_REPO="$(CUSTOM_REPO ) "
43
+ CUSTOM_REPO="$(CUSTOM_REPO ) " \
44
+ TEST_ENV="$(TEST_ENV ) "
43
45
44
46
# TODO: switch to 'build: build-all' once parallel builds are relatively safe
45
47
.PHONY : build build-serial build-all
Original file line number Diff line number Diff line change @@ -15,7 +15,12 @@ for dir in ${VERSIONS}; do
15
15
# Kept also IMAGE_NAME as some tests might still use that.
16
16
export IMAGE_NAME=$( docker inspect -f " {{.Config.Labels.name}}" $IMAGE_ID )
17
17
18
- if [ -n " ${TEST_MODE} " ]; then
18
+ if [ " ${TEST_ENV} " == " container" ]; then
19
+ TEST_IMAGE_NAME=" sclorg-tests"
20
+ # FIXME: poke user-cont to provide such container image
21
+ docker build --tag=${TEST_IMAGE_NAME} -f Dockerfile.tests $( readlink -f ../)
22
+ docker run --net=host -e PYTHONDONTWRITEBYTECODE=yes -e IMAGE_NAME --rm -v /dev:/dev:ro -v /var/lib/docker:/var/lib/docker:ro --security-opt label=disable --cap-add SYS_ADMIN -ti -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD} :/src -w /src ${TEST_IMAGE_NAME} pytest-3 -vv
23
+ elif [ -n " ${TEST_MODE} " -o " ${TEST_ENV} " == " local" ]; then
19
24
VERSION=$dir test/run
20
25
fi
21
26
You can’t perform that action at this time.
0 commit comments