summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-02-25 11:09:47 +0100
committerJürg Billeter <j@bitron.ch>2019-02-28 12:01:15 +0100
commit805f02ec1ba42701308392d93b5228e6a3f83f10 (patch)
treee6304359be8718af2db4f5cd5ffd1f3d59d5105b
parentb9702b5a003d6ccf993e754dceba5e1ad49e8d51 (diff)
downloadbuildstream-805f02ec1ba42701308392d93b5228e6a3f83f10.tar.gz
tests/artifactcache/expiry.py: Remove test_extract_expiry()
The following commits will remove extract directories.
-rw-r--r--tests/artifactcache/expiry.py50
1 files changed, 0 insertions, 50 deletions
diff --git a/tests/artifactcache/expiry.py b/tests/artifactcache/expiry.py
index 8ece6295c..e959634cb 100644
--- a/tests/artifactcache/expiry.py
+++ b/tests/artifactcache/expiry.py
@@ -395,56 +395,6 @@ def test_invalid_cache_quota(cli, datafiles, tmpdir, quota, err_domain, err_reas
res.assert_main_error(err_domain, err_reason)
-@pytest.mark.datafiles(DATA_DIR)
-def test_extract_expiry(cli, datafiles, tmpdir):
- project = os.path.join(datafiles.dirname, datafiles.basename)
- element_path = 'elements'
-
- cli.configure({
- 'cache': {
- 'quota': 10000000,
- }
- })
-
- create_element_size('target.bst', project, element_path, [], 6000000)
- res = cli.run(project=project, args=['build', 'target.bst'])
- res.assert_success()
- assert cli.get_element_state(project, 'target.bst') == 'cached'
-
- # Force creating extract
- res = cli.run(project=project, args=['artifact', 'checkout', 'target.bst',
- '--directory', os.path.join(str(tmpdir), 'checkout')])
- res.assert_success()
-
- # Get a snapshot of the extracts in advance
- extractdir = os.path.join(project, 'cache', 'extract', 'test', 'target')
- extracts = os.listdir(extractdir)
- assert(len(extracts) == 1)
- extract = os.path.join(extractdir, extracts[0])
-
- # Remove target.bst from artifact cache
- create_element_size('target2.bst', project, element_path, [], 6000000)
- res = cli.run(project=project, args=['build', 'target2.bst'])
- res.assert_success()
- assert cli.get_element_state(project, 'target.bst') != 'cached'
-
- # Now the extract should be removed.
- assert not os.path.exists(extract)
-
- # As an added bonus, let's ensure that no directories have been left behind
- #
- # Now we should have a directory for the cached target2.bst, which
- # replaced target.bst in the cache, we should not have a directory
- # for the target.bst
- refsdir = os.path.join(project, 'cache', 'cas', 'refs', 'heads')
- refsdirtest = os.path.join(refsdir, 'test')
- refsdirtarget = os.path.join(refsdirtest, 'target')
- refsdirtarget2 = os.path.join(refsdirtest, 'target2')
-
- assert os.path.isdir(refsdirtarget2)
- assert not os.path.exists(refsdirtarget)
-
-
# Ensures that when launching BuildStream with a full artifact cache,
# the cache size and cleanup jobs are run before any other jobs.
#