summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Smith <josh.smith@codethink.co.uk>2020-08-20 16:07:50 +0100
committerQinusty <qinusty@gmail.com>2020-08-26 13:27:44 +0000
commit1325f90174dedef240b7791581e550f62b7d3ccd (patch)
treeec0d94b1676565256368abb41deee71e8d6cde27
parentfaffc7e3cfde8f630a1bd8a865ca0c2ec571a757 (diff)
downloadbuildstream-1325f90174dedef240b7791581e550f62b7d3ccd.tar.gz
runcli.py: Configurable index/storage artifact types
This enables for seperate index/storage artifact servers to be configured by environment variables passed through tox.
-rw-r--r--src/buildstream/testing/runcli.py9
-rwxr-xr-xtests/conftest.py8
-rw-r--r--tox.ini2
3 files changed, 18 insertions, 1 deletions
diff --git a/src/buildstream/testing/runcli.py b/src/buildstream/testing/runcli.py
index af15b56f1..de4327cd8 100644
--- a/src/buildstream/testing/runcli.py
+++ b/src/buildstream/testing/runcli.py
@@ -775,8 +775,15 @@ def cli_remote_execution(tmpdir, remote_services):
fixture = CliRemote(directory)
+ artifacts = []
if remote_services.artifact_service:
- fixture.configure({"artifacts": [{"url": remote_services.artifact_service, "push": True,}]})
+ artifacts.append({"url": remote_services.artifact_service, "push": True})
+ if remote_services.artifact_index_service:
+ artifacts.append({"url": remote_services.artifact_index_service, "push": True, "type": "index"})
+ if remote_services.artifact_storage_service:
+ artifacts.append({"url": remote_services.artifact_storage_service, "push": True, "type": "storage"})
+ if artifacts:
+ fixture.configure({"artifacts": artifacts})
remote_execution = {}
if remote_services.action_service:
diff --git a/tests/conftest.py b/tests/conftest.py
index 476113105..d79ad40b0 100755
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -101,6 +101,8 @@ class RemoteServices:
self.exec_service = kwargs.get("exec_service")
self.source_service = kwargs.get("source_service")
self.storage_service = kwargs.get("storage_service")
+ self.artifact_index_service = kwargs.get("artifact_index_service")
+ self.artifact_storage_service = kwargs.get("artifact_storage_service")
@pytest.fixture(scope="session")
@@ -110,6 +112,12 @@ def remote_services(request):
if "ARTIFACT_CACHE_SERVICE" in os.environ:
kwargs["artifact_service"] = os.environ.get("ARTIFACT_CACHE_SERVICE")
+ if "ARTIFACT_INDEX_SERVICE" in os.environ:
+ kwargs["artifact_index_service"] = os.environ.get("ARTIFACT_INDEX_SERVICE")
+
+ if "ARTIFACT_STORAGE_SERVICE" in os.environ:
+ kwargs["artifact_storage_service"] = os.environ.get("ARTIFACT_STORAGE_SERVICE")
+
if "REMOTE_EXECUTION_SERVICE" in os.environ:
kwargs["action_service"] = os.environ.get("REMOTE_EXECUTION_SERVICE")
kwargs["exec_service"] = os.environ.get("REMOTE_EXECUTION_SERVICE")
diff --git a/tox.ini b/tox.ini
index 481101ab1..f347e06e3 100644
--- a/tox.ini
+++ b/tox.ini
@@ -49,6 +49,8 @@ deps =
randomized: pytest-random-order
passenv =
ARTIFACT_CACHE_SERVICE
+ ARTIFACT_INDEX_SERVICE
+ ARTIFACT_STORAGE_SERVICE
BST_CAS_STAGING_ROOT
GI_TYPELIB_PATH
INTEGRATION_CACHE