summaryrefslogtreecommitdiff
path: root/tests/artifactcache
diff options
context:
space:
mode:
authorPhil Dawson <phil.dawson@codethink.co.uk>2019-01-16 14:03:41 +0000
committerPhil Dawson <phil.dawson@codethink.co.uk>2019-02-08 14:27:54 +0000
commitb4d4c4f59c12c9b500f83d8cd4381418e1124f67 (patch)
treeff2b7c958ba18ab3a018d1917a7b9369bc82b8a9 /tests/artifactcache
parente61f471376d6d3ef2691abf3eee75d30999e7f05 (diff)
downloadbuildstream-phil/plugin-testing-api.tar.gz
Expose basic api for testing external plugins.phil/plugin-testing-api
We want external plugins to be able to make use of the core testing utils. This commit exposes the basic utilities which are currently in use in bst-external plugins. If necessary, more utilities could be exposed in the future. Moves the following files from tests/testutils/ to buildstream/plugintestingutils/: o runcli.py o integration.py As part of this, this commit makes the following changes to runcli.py and integration.py: o runcli.py: Fix linting errors o runcli.py: Add user facing documentation o Integration.py: Add user facing documentation
Diffstat (limited to 'tests/artifactcache')
-rw-r--r--tests/artifactcache/cache_size.py3
-rw-r--r--tests/artifactcache/config.py2
-rw-r--r--tests/artifactcache/expiry.py3
-rw-r--r--tests/artifactcache/junctions.py4
-rw-r--r--tests/artifactcache/pull.py3
-rw-r--r--tests/artifactcache/push.py4
6 files changed, 12 insertions, 7 deletions
diff --git a/tests/artifactcache/cache_size.py b/tests/artifactcache/cache_size.py
index 63ab9ad07..88f8eaddf 100644
--- a/tests/artifactcache/cache_size.py
+++ b/tests/artifactcache/cache_size.py
@@ -5,8 +5,9 @@ from unittest import mock
from buildstream import _yaml
from buildstream._artifactcache import CACHE_SIZE_FILE
from buildstream._exceptions import ErrorDomain
+from buildstream.plugintestutils import cli
-from tests.testutils import cli, create_element_size
+from tests.testutils import create_element_size
# XXX: Currently lacking:
# * A way to check whether it's faster to read cache size on
diff --git a/tests/artifactcache/config.py b/tests/artifactcache/config.py
index fecb3dd2e..fda309725 100644
--- a/tests/artifactcache/config.py
+++ b/tests/artifactcache/config.py
@@ -10,7 +10,7 @@ from buildstream.utils import _deduplicate
from buildstream import _yaml
from buildstream._exceptions import ErrorDomain, LoadErrorReason
-from tests.testutils.runcli import cli
+from buildstream.plugintestutils.runcli import cli
DATA_DIR = os.path.dirname(os.path.realpath(__file__))
diff --git a/tests/artifactcache/expiry.py b/tests/artifactcache/expiry.py
index 2cc59e03c..d92e68f0b 100644
--- a/tests/artifactcache/expiry.py
+++ b/tests/artifactcache/expiry.py
@@ -25,8 +25,9 @@ import pytest
from buildstream import _yaml
from buildstream._exceptions import ErrorDomain, LoadErrorReason
+from buildstream.plugintestutils import cli
-from tests.testutils import cli, create_element_size, update_element_size, wait_for_cache_granularity
+from tests.testutils import create_element_size, update_element_size, wait_for_cache_granularity
DATA_DIR = os.path.join(
diff --git a/tests/artifactcache/junctions.py b/tests/artifactcache/junctions.py
index c6d6921c8..d5de16282 100644
--- a/tests/artifactcache/junctions.py
+++ b/tests/artifactcache/junctions.py
@@ -1,9 +1,11 @@
import os
import shutil
import pytest
-from tests.testutils import cli, create_artifact_share
from buildstream import _yaml
+from buildstream.plugintestutils import cli
+
+from tests.testutils import create_artifact_share
DATA_DIR = os.path.join(
diff --git a/tests/artifactcache/pull.py b/tests/artifactcache/pull.py
index 4c332bf36..edd5a93ba 100644
--- a/tests/artifactcache/pull.py
+++ b/tests/artifactcache/pull.py
@@ -9,8 +9,9 @@ from buildstream import _yaml, _signals, utils
from buildstream._context import Context
from buildstream._project import Project
from buildstream._protos.build.bazel.remote.execution.v2 import remote_execution_pb2
+from buildstream.plugintestutils import cli
-from tests.testutils import cli, create_artifact_share
+from tests.testutils import create_artifact_share
# Project directory
diff --git a/tests/artifactcache/push.py b/tests/artifactcache/push.py
index 116fa7865..ed2a140e7 100644
--- a/tests/artifactcache/push.py
+++ b/tests/artifactcache/push.py
@@ -10,8 +10,8 @@ from buildstream._context import Context
from buildstream._project import Project
from buildstream._protos.build.bazel.remote.execution.v2 import remote_execution_pb2
from buildstream.storage._casbaseddirectory import CasBasedDirectory
-
-from tests.testutils import cli, create_artifact_share
+from buildstream.plugintestutils import cli
+from tests.testutils import create_artifact_share
# Project directory