You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by ju...@apache.org on 2021/05/20 09:42:59 UTC
[buildstream] 03/03: fixup tests/remoteexecution/remotecache.py
This is an automated email from the ASF dual-hosted git repository.
juergbi pushed a commit to branch juerg/remote-cache-ci
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit f2828a406158e50c8cfa4d67a94da502d25cfc31
Author: Jürg Billeter <j...@bitron.ch>
AuthorDate: Thu May 20 11:39:45 2021 +0200
fixup tests/remoteexecution/remotecache.py
---
tests/remoteexecution/remotecache.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tests/remoteexecution/remotecache.py b/tests/remoteexecution/remotecache.py
index 5cd8911..8801b16 100644
--- a/tests/remoteexecution/remotecache.py
+++ b/tests/remoteexecution/remotecache.py
@@ -1,6 +1,7 @@
# Pylint doesn't play well with fixtures and dependency injection from pytest
# pylint: disable=redefined-outer-name
+import copy
import os
import pytest
@@ -26,8 +27,10 @@ def test_remote_autotools_build(cli, datafiles, remote_services):
assert set(services) == set(["action-cache", "execution", "storage"])
# Enable remote cache and remove explicit remote execution CAS configuration.
+ config_without_remote_cache = copy.deepcopy(cli.config)
cli.configure({"cache": {"remote-cache": {"url": remote_services.storage_service}}})
del cli.config["remote-execution"]["storage-service"]
+ config_with_remote_cache = cli.config
# Build element with remote execution.
result = cli.run(project=project, args=["build", element_name])
@@ -35,12 +38,12 @@ def test_remote_autotools_build(cli, datafiles, remote_services):
# Attempt checkout from local cache by temporarily disabling remote cache.
# This should fail as the build result shouldn't have been downloaded to the local cache.
- del cli.config["cache"]["remote-cache"]
+ cli.config = config_without_remote_cache
result = cli.run(project=project, args=["artifact", "checkout", element_name, "--directory", checkout])
result.assert_main_error(ErrorDomain.STREAM, "uncached-checkout-attempt")
+ cli.config = config_with_remote_cache
- # Re-enable remote cache and attempt checkout again.
- cli.configure({"cache": {"remote-cache": {"url": remote_services.storage_service}}})
+ # Attempt checkout again with remote cache.
result = cli.run(project=project, args=["artifact", "checkout", element_name, "--directory", checkout])
result.assert_success()