summaryrefslogtreecommitdiff
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorWilliam Salmon <will.salmon@codethink.co.uk>2020-07-23 17:30:32 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2020-08-11 08:11:09 +0000
commit46e92ead4ca2878c289fb72a62865d16d916f82a (patch)
treeec703501b098140fae265ce2ee21fba517b9b5cb /tests/conftest.py
parent333644244f8d5779d01dfcfbf357afdc95d37265 (diff)
downloadbuildstream-46e92ead4ca2878c289fb72a62865d16d916f82a.tar.gz
Add tests for checking the working of a remote cache
These basic tests are ment to be run with a remote cache and can be used to check bst conpatiblity with a remote cache server.
Diffstat (limited to 'tests/conftest.py')
-rwxr-xr-xtests/conftest.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index bb4611a11..28e120d5e 100755
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -49,6 +49,7 @@ def pytest_addoption(parser):
parser.addoption("--integration", action="store_true", default=False, help="Run integration tests")
parser.addoption("--plugins", action="store_true", default=False, help="Run only plugins tests")
parser.addoption("--remote-execution", action="store_true", default=False, help="Run remote-execution tests only")
+ parser.addoption("--remote-cache", action="store_true", default=False, help="Run remote-cache tests only")
def pytest_runtest_setup(item):
@@ -67,6 +68,16 @@ def pytest_runtest_setup(item):
if item.get_closest_marker("remoteexecution"):
pytest.skip("skipping remote-execution test")
+ # With --remote-cache: only run tests marked with 'remotecache'
+ if item.config.getvalue("remote_cache"):
+ if not item.get_closest_marker("remotecache"):
+ pytest.skip("skipping non remote-cache test")
+
+ # Without --remote-cache: skip tests marked with 'remotecache'
+ else:
+ if item.get_closest_marker("remotecache"):
+ pytest.skip("skipping remote-cache test")
+
# With --plugins only run plugins tests
if item.config.getvalue("plugins"):
if not item.get_closest_marker("generic_source_test"):