From 71e481f0d9da044fb23e47f42666f4d7580dbeca Mon Sep 17 00:00:00 2001 From: David Rheinsberg Date: Tue, 7 Apr 2020 15:12:15 +0200 Subject: [PATCH] test: prune cache after each stage-test Make sure we prune the caches after each stage-test to keep our disk footprint small. This does considerably increase build-times since we no longer share cached entries. However, the current CI builds simply run out of disk-space. Once we use separate output-directories we will be able to drop the automatic checkpointing from the tests, and thus effectively get the same behavior. Until then, lets prune the caches explicitly. --- test/osbuildtest.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test/osbuildtest.py b/test/osbuildtest.py index 66c725b2..98d135c5 100644 --- a/test/osbuildtest.py +++ b/test/osbuildtest.py @@ -23,16 +23,14 @@ class TestCase(unittest.TestCase): it for actual testing. """ - @classmethod - def setUpClass(cls): - cls.store = os.getenv("OSBUILD_TEST_STORE") - if not cls.store: - cls.store = tempfile.mkdtemp(prefix="osbuild-test-", dir="/var/tmp") + def setUp(self): + self.store = os.getenv("OSBUILD_TEST_STORE") + if not self.store: + self.store = tempfile.mkdtemp(prefix="osbuild-test-", dir="/var/tmp") - @classmethod - def tearDownClass(cls): + def tearDown(self): if not os.getenv("OSBUILD_TEST_STORE"): - shutil.rmtree(cls.store) + shutil.rmtree(self.store) def run_osbuild(self, pipeline, input=None): osbuild_cmd = ["python3", "-m", "osbuild", "--json", "--store", self.store, "--libdir", ".", pipeline]