From ad0369fd1b1255407418d5789e83503f52fcd49b Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Mon, 26 Feb 2018 12:33:41 +0000 Subject: Store integration tests cache inside the current directory by default Previously the code would default to a directory in `/tmp`, but this is often unsuitable as the Linux 'tmpfs' filesystem doesn't support extended file attributes and thus cannot store OSTree repositories. See: https://gitlab.com/BuildStream/buildstream/issues/267 --- conftest.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'conftest.py') diff --git a/conftest.py b/conftest.py index 22eaae23b..ad42b70eb 100755 --- a/conftest.py +++ b/conftest.py @@ -39,16 +39,16 @@ def integration_cache(request): # Set the tempdir to the INTEGRATION_CACHE variable, or the # default if that is not set. - cache_dir = os.environ.get('INTEGRATION_CACHE', tempfile.gettempdir()) + if 'INTEGRATION_CACHE' in os.environ: + cache_dir = os.path.join(os.environ['INTEGRATION_CACHE'], 'integration-cache') + else: + cache_dir = os.path.abspath('./integration-cache') - # We use a separate tempdir to cache sources and artifacts to - # increase test speed - cache = os.path.join(cache_dir, 'integration-cache') - yield cache + yield cache_dir # Clean up the artifacts after each test run - we only want to # cache sources try: - shutil.rmtree(os.path.join(cache, 'artifacts')) + shutil.rmtree(os.path.join(cache_dir, 'artifacts')) except FileNotFoundError: pass -- cgit v1.2.1