[pmg-devel] [PATCH pmg-api 3/3] tests: conditionally skip integration tests

Stoiko Ivanov s.ivanov at proxmox.com
Fri Jan 2 21:32:01 CET 2026


By setting the SKIP_INTEGRATION_TESTS (environment or Makefile
variable) to a non-empty value the integration-tests are skipped.

To skip them in sbuild - check for the existance of /run/lock/sbuild
(inspired by pve-container's `src/test/Makefile`) with realpath[0],
which returns an empty string for a non-existing file.

tested by running `make sbuild`, `make deb` and
`SKIP_INTEGRATION_TESTS=y make deb`.

[0] https://www.gnu.org/software/make/manual/html_node/File-Name-Functions.html#index-realpath-1

Suggested-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 src/tests/Makefile | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/tests/Makefile b/src/tests/Makefile
index 3d5b0179..20833b4d 100644
--- a/src/tests/Makefile
+++ b/src/tests/Makefile
@@ -1,9 +1,16 @@
 export PERLLIB = ..
 
+# realpath returns an empty string for non-existing files
+SKIP_INTEGRATION_TESTS ?= $(realpath /run/lock/sbuild)
+
 all:
 
 .PHONY: check
+ifeq ($(strip $(SKIP_INTEGRATION_TESTS)),)
 check: test-utils test-sa-channel integration-tests
+else
+check: test-utils test-sa-channel
+endif
 
 .PHONY: test-utils
 test-utils:
-- 
2.47.3





More information about the pmg-devel mailing list