[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 01/18] tests/docker: restore TESTS/IMAGES filtering
From: |
Alex Bennée |
Subject: |
[PATCH v2 01/18] tests/docker: restore TESTS/IMAGES filtering |
Date: |
Fri, 25 Feb 2022 17:20:04 +0000 |
This was broken in the re-factor:
e86c9a64f4 ("tests/docker/Makefile.include: add a generic docker-run target")
Rather than unwind the changes just apply the filters to the total set
of available images and tests. That way we don't inadvertently build
images only not to use them later.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reported-by: Alex Williamson <alex.williamson@redhat.com>
Message-Id: <20220211160309.335014-2-alex.bennee@linaro.org>
---
tests/docker/Makefile.include | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index f1a0c5db7a..0ec59b2193 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -8,13 +8,19 @@ COMMA := ,
HOST_ARCH = $(if $(ARCH),$(ARCH),$(shell uname -m))
+# These variables can be set by the user to limit the set of docker
+# images and tests to a more restricted subset
+TESTS ?= %
+IMAGES ?= %
+
DOCKER_SUFFIX := .docker
DOCKER_FILES_DIR := $(SRC_PATH)/tests/docker/dockerfiles
# we don't run tests on intermediate images (used as base by another image)
DOCKER_PARTIAL_IMAGES := debian10 debian11
# we don't directly build virtual images (they are used to build other images)
DOCKER_VIRTUAL_IMAGES := debian-bootstrap debian-toolchain empty
-DOCKER_IMAGES := $(sort $(filter-out $(DOCKER_VIRTUAL_IMAGES), $(notdir
$(basename $(wildcard $(DOCKER_FILES_DIR)/*.docker)))))
+__IMAGES := $(sort $(filter-out $(DOCKER_VIRTUAL_IMAGES), $(notdir $(basename
$(wildcard $(DOCKER_FILES_DIR)/*.docker)))))
+DOCKER_IMAGES := $(if $(IMAGES), $(filter $(IMAGES), $(__IMAGES)), $(__IMAGES))
DOCKER_TARGETS := $(patsubst %,docker-image-%,$(DOCKER_IMAGES))
# Use a global constant ccache directory to speed up repetitive builds
DOCKER_CCACHE_DIR := $$HOME/.cache/qemu-docker-ccache
@@ -23,16 +29,14 @@ DOCKER_DEFAULT_REGISTRY :=
registry.gitlab.com/qemu-project/qemu
endif
DOCKER_REGISTRY := $(if $(REGISTRY),$(REGISTRY),$(DOCKER_DEFAULT_REGISTRY))
-DOCKER_TESTS := $(notdir $(shell \
- find $(SRC_PATH)/tests/docker/ -name 'test-*' -type f))
+__TESTS := $(notdir $(shell \
+ find $(SRC_PATH)/tests/docker/ -name 'test-*' -type f))
+DOCKER_TESTS := $(if $(TESTS), $(filter $(TESTS), $(__TESTS)), $(__TESTS))
ENGINE := auto
DOCKER_SCRIPT=$(SRC_PATH)/tests/docker/docker.py --engine $(ENGINE)
-TESTS ?= %
-IMAGES ?= %
-
CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$)
DOCKER_SRC_COPY := $(BUILD_DIR)/docker-src.$(CUR_TIME)
@@ -274,8 +278,8 @@ endif
@echo ' TARGET_LIST=a,b,c Override target list in builds.'
@echo ' EXTRA_CONFIGURE_OPTS="..."'
@echo ' Extra configure options.'
- @echo ' IMAGES="a b c ..": Filters which images to build or run.'
- @echo ' TESTS="x y z .." Filters which tests to run (for
docker-test).'
+ @echo ' IMAGES="a b c ..": Restrict available images to subset.'
+ @echo ' TESTS="x y z .." Restrict available tests to subset.'
@echo ' J=[0..9]* Overrides the -jN parameter for make
commands'
@echo ' (default is 1)'
@echo ' DEBUG=1 Stop and drop to shell in the created
container'
--
2.30.2
- [PATCH v2 00/18] testing and semihosting pre-PR, Alex Bennée, 2022/02/25
- [PATCH v2 04/18] tests/docker: update debian-arm64-cross with lci-tool, Alex Bennée, 2022/02/25
- [PATCH v2 03/18] tests/lcitool: update to latest version, Alex Bennée, 2022/02/25
- [PATCH v2 10/18] tests/tcg/ppc64: clean-up handling of byte-reverse, Alex Bennée, 2022/02/25
- [PATCH v2 01/18] tests/docker: restore TESTS/IMAGES filtering,
Alex Bennée <=
- [PATCH v2 02/18] tests/docker: add NOUSER for alpine image, Alex Bennée, 2022/02/25
- [PATCH v2 08/18] scripts/ci: allow for a secondary runner, Alex Bennée, 2022/02/25
- [PATCH v2 07/18] scripts/ci: add build env rules for aarch32 on aarch64, Alex Bennée, 2022/02/25
- [PATCH v2 06/18] tests/docker: introduce debian-riscv64-test-cross, Alex Bennée, 2022/02/25
- [PATCH v2 05/18] tests/docker: update debian-s390x-cross with lcitool, Alex Bennée, 2022/02/25
- [PATCH v2 18/18] tests/tcg: port SYS_HEAPINFO to a system test, Alex Bennée, 2022/02/25
- [PATCH v2 09/18] gitlab: add a new aarch32 custom runner definition, Alex Bennée, 2022/02/25
- [PATCH v2 13/18] tests/tcg: add vectorised sha512 versions, Alex Bennée, 2022/02/25
- [PATCH v2 14/18] travis.yml: Update the s390x jobs to Ubuntu Focal, Alex Bennée, 2022/02/25