[Dev] [dbscripts] [PATCH 2/2] test/Makefile: Share the package cache between test suite runs

Luke Shumaker lukeshu at lukeshu.com
Fri Apr 6 03:20:56 GMT 2018


From: Luke Shumaker <lukeshu at parabola.nu>

Previous commits introduced a "package cache" that is used during a
test suite run, to avoid rebuilding packages (libremakepkg) many times
throughout the tests.  That cache lived in a temporary directory
created by `make test`.

This patch speeds up the tests even further by allowing that package
cache to persist across test suite runs.  Because package creation
isn't the functionality under test, that should be safe to do.
---
 test/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/Makefile b/test/Makefile
index 5ed3910..9a6d18f 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,4 +1,4 @@
-PACKAGE_CACHE:=$(shell mktemp -d)
+PACKAGE_CACHE ?= $(or $(TMPDIR),/tmp)/dbscripts-build
 
 test:
 	PATH=$(CURDIR)/../:$(CURDIR)/../cron-jobs/:$(PATH) PACKAGE_CACHE=$(PACKAGE_CACHE) bats cases
-- 
2.16.2




More information about the Dev mailing list