summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2017-07-20 06:05:31 +0200
committerJürg Billeter <j@bitron.ch>2017-07-20 07:24:56 +0200
commit62cd410c27b6d2a3a69d2f3c92d222e134f81f8d (patch)
tree05cbef64b3eed6e31c1035471d47df750b7e54a5
parent85de4876371cc84d885cd954503651b36fc09bc6 (diff)
downloadbuildstream-62cd410c27b6d2a3a69d2f3c92d222e134f81f8d.tar.gz
tests/artifactcache: Generate and fetch summary file
-rw-r--r--tests/artifactcache/basics.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/artifactcache/basics.py b/tests/artifactcache/basics.py
index 1f44cc8b0..5db7450f2 100644
--- a/tests/artifactcache/basics.py
+++ b/tests/artifactcache/basics.py
@@ -1,8 +1,9 @@
+import multiprocessing
import os
import pytest
import tempfile
-from buildstream import Context, Project, _yaml
+from buildstream import Context, Project, _yaml, _ostree
from buildstream.exceptions import _ArtifactError
from buildstream.element import _KeyStrength
from buildstream._artifactcache import ArtifactCache
@@ -81,10 +82,20 @@ def test_push_pull(pipeline, tmpdir):
build_commit(pipeline)
assert(pipeline.artifacts.contains(pipeline.target))
- pipeline.artifacts.push(pipeline.target)
+ # push artifact in subprocess to avoid hang in the next OSTree operation
+ p = multiprocessing.Process(target=pipeline.artifacts.push, args=(pipeline.target,))
+ p.start()
+ p.join()
+
+ # generate summary file
+ push_repo = _ostree.ensure(pipeline.context.artifact_push, True)
+ push_repo.regenerate_summary()
pipeline.artifacts.remove(pipeline.target)
assert(not pipeline.artifacts.contains(pipeline.target))
+ # read summary file
+ pipeline.artifacts.fetch_remote_refs()
+
pipeline.artifacts.pull(pipeline.target)
assert(pipeline.artifacts.contains(pipeline.target))