From 1325f90174dedef240b7791581e550f62b7d3ccd Mon Sep 17 00:00:00 2001 From: Josh Smith Date: Thu, 20 Aug 2020 16:07:50 +0100 Subject: runcli.py: Configurable index/storage artifact types This enables for seperate index/storage artifact servers to be configured by environment variables passed through tox. --- src/buildstream/testing/runcli.py | 9 ++++++++- tests/conftest.py | 8 ++++++++ tox.ini | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1