summaryrefslogtreecommitdiff
path: root/tests/artifactcache/push.py
diff options
context:
space:
mode:
authorTristan van Berkom <tristan@codethink.co.uk>2020-08-30 15:57:13 +0900
committerTristan van Berkom <tristan@codethink.co.uk>2020-09-04 18:22:38 +0900
commit1a3e4e89fc86b29342c9ec62ca8915b6eae084d2 (patch)
treed0e88bcc0fe25618306e93a3354026776bb9587b /tests/artifactcache/push.py
parent97812cbb7d295cc3d270be9205cbc12313215028 (diff)
downloadbuildstream-1a3e4e89fc86b29342c9ec62ca8915b6eae084d2.tar.gz
element.py: Hide dependencies which are irrelevant to the Element
This is a large breaking change, a summary of the changes are that: * The Scope type is now private, since Element plugins do not have the choice to view any other scopes. * Element.dependencies() API change Now it accepts a "selection" (sequence) of dependency elements, so that Element.dependencies() can iterate over a collection of dependencies, ensuring that we iterate over every element only once even when we need to iterate over multiple element's dependencies. The old API is moved to Element._dependencies() and still used internally. * Element.stage_dependency_artifacts() API change This gets the same treatment as Element.dependencies(), and the old API is also preserved as Element._stage_dependency_artifacts(), so that the CLI can stage things for `bst artifact checkout` and such. * Element.search() API change The Scope argument is removed, and the old API is preserved as Element._search() temporarily, until we can remove this completely.
Diffstat (limited to 'tests/artifactcache/push.py')
-rw-r--r--tests/artifactcache/push.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/artifactcache/push.py b/tests/artifactcache/push.py
index 87bc3b325..74062ce47 100644
--- a/tests/artifactcache/push.py
+++ b/tests/artifactcache/push.py
@@ -5,7 +5,8 @@ import os
import pytest
-from buildstream import _yaml, Scope
+from buildstream import _yaml
+from buildstream.types import _Scope
from buildstream._project import Project
from buildstream._protos.build.bazel.remote.execution.v2 import remote_execution_pb2
from buildstream.testing import cli # pylint: disable=unused-import
@@ -35,7 +36,7 @@ def _push(cli, cache_dir, project_dir, config_file, target):
# Ensure the element's artifact memeber is initialised
# This is duplicated from Pipeline.resolve_elements()
# as this test does not use the cli frontend.
- for e in element._dependencies(Scope.ALL):
+ for e in element._dependencies(_Scope.ALL):
e._initialize_state()
# Manually setup the CAS remotes