Raoul Hidalgo Charman pushed to branch raoul/802-refactor-artifactcache at BuildStream / buildstream
Commits:
-
dec9f98a
by Raoul Hidalgo Charman at 2019-01-14T15:28:59Z
1 changed file:
Changes:
... | ... | @@ -39,6 +39,7 @@ def pytest_runtest_setup(item): |
39 | 39 |
@pytest.fixture(scope='session')
|
40 | 40 |
def integration_cache(request):
|
41 | 41 |
|
42 |
+ |
|
42 | 43 |
# Set the tempdir to the INTEGRATION_CACHE variable, or the
|
43 | 44 |
# default if that is not set.
|
44 | 45 |
if 'INTEGRATION_CACHE' in os.environ:
|
... | ... | @@ -46,6 +47,13 @@ def integration_cache(request): |
46 | 47 |
else:
|
47 | 48 |
cache_dir = os.path.abspath('./integration-cache')
|
48 | 49 |
|
50 |
+ # Clean up the tmp dir, should be empty but something in CI tests is
|
|
51 |
+ # leaving files here
|
|
52 |
+ try:
|
|
53 |
+ shutil.rmtree(os.path.join(cache_dir, 'tmp'))
|
|
54 |
+ except FileNotFoundError:
|
|
55 |
+ pass
|
|
56 |
+ |
|
49 | 57 |
yield cache_dir
|
50 | 58 |
|
51 | 59 |
# Clean up the artifacts after each test run - we only want to
|
... | ... | @@ -55,11 +63,6 @@ def integration_cache(request): |
55 | 63 |
except FileNotFoundError:
|
56 | 64 |
pass
|
57 | 65 |
|
58 |
- # Clean up the tmp dir, should be empty but isn't in CI tests
|
|
59 |
- try:
|
|
60 |
- shutil.rmtree(os.path.join(cache_dir, 'tmp'))
|
|
61 |
- except FileNotFoundError:
|
|
62 |
- pass
|
|
63 | 66 |
|
64 | 67 |
def clean_platform_cache():
|
65 | 68 |
Platform._instance = None
|