summaryrefslogtreecommitdiff
path: root/tests/sourcecache/cache.py
diff options
context:
space:
mode:
authorRaoul Hidalgo Charman <raoul.hidalgocharman@codethink.co.uk>2019-06-24 15:56:31 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-08 10:40:28 +0000
commitbb2cf18be0aef7d6e394a0c6ff6d83eac737c60b (patch)
tree2b9714484fe27645211efaa37065220465cf3b79 /tests/sourcecache/cache.py
parentd493682609f8f96ed127f4083bad42fa2fabb250 (diff)
downloadbuildstream-bb2cf18be0aef7d6e394a0c6ff6d83eac737c60b.tar.gz
Source cache uses new proto methods
This changes the location of source refs from `cache/cas/refs` to `cache/sources_protos` and fixes tests that looked in the old reference place. Source cache now uses the new protocol buffer and grpc methods defined, for storing locally, and pushing and pulling to remotes. Part of #1038
Diffstat (limited to 'tests/sourcecache/cache.py')
-rw-r--r--tests/sourcecache/cache.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/sourcecache/cache.py b/tests/sourcecache/cache.py
index 20faaa64e..793344ef0 100644
--- a/tests/sourcecache/cache.py
+++ b/tests/sourcecache/cache.py
@@ -39,10 +39,10 @@ def test_patch_sources_cached_1(cli, datafiles):
# as we have a local, patch, local config, the first local and patch should
# be cached together, and the last local on it's own
- source_dir = os.path.join(project_dir, 'cache', 'cas', 'refs', 'heads', '@sources')
+ source_protos = os.path.join(project_dir, 'cache', 'source_protos')
- assert len(os.listdir(os.path.join(source_dir, 'patch'))) == 1
- assert len(os.listdir(os.path.join(source_dir, 'local'))) == 2
+ assert len(os.listdir(os.path.join(source_protos, 'patch'))) == 1
+ assert len(os.listdir(os.path.join(source_protos, 'local'))) == 2
@pytest.mark.datafiles(DATA_DIR)
@@ -53,9 +53,9 @@ def test_patch_sources_cached_2(cli, datafiles):
res.assert_success()
# As everything is before the patch it should all be cached together
- source_dir = os.path.join(project_dir, 'cache', 'cas', 'refs', 'heads', '@sources')
+ source_protos = os.path.join(project_dir, 'cache', 'source_protos')
- assert len(os.listdir(os.path.join(source_dir, 'patch'))) == 1
+ assert len(os.listdir(os.path.join(source_protos, 'patch'))) == 1
@pytest.mark.datafiles(DATA_DIR)
@@ -66,9 +66,9 @@ def test_sources_without_patch(cli, datafiles):
res.assert_success()
# No patches so everything should be cached seperately
- source_dir = os.path.join(project_dir, 'cache', 'cas', 'refs', 'heads', '@sources')
+ source_protos = os.path.join(project_dir, 'cache', 'source_protos')
- assert len(os.listdir(os.path.join(source_dir, 'local'))) == 3
+ assert len(os.listdir(os.path.join(source_protos, 'local'))) == 3
@pytest.mark.datafiles(DATA_DIR)
@@ -105,8 +105,8 @@ def test_source_cache_key(cli, datafiles):
res.assert_success()
# Should have one source ref
- patch_refs = os.path.join(project_dir, 'cache', 'cas', 'refs', 'heads', '@sources', 'patch')
- assert len(os.listdir(patch_refs)) == 1
+ patch_protos = os.path.join(project_dir, 'cache', 'source_protos', 'patch')
+ assert len(os.listdir(patch_protos)) == 1
# modify hello-patch file and check tracking updates refs
with open(os.path.join(file_path, 'dev-files', 'usr', 'include', 'pony.h'), 'a') as f:
@@ -120,4 +120,4 @@ def test_source_cache_key(cli, datafiles):
res.assert_success()
# We should have a new source ref
- assert len(os.listdir(patch_refs)) == 2
+ assert len(os.listdir(patch_protos)) == 2