summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenjamin Schubert <bschubert15@bloomberg.net>2019-12-06 09:58:07 +0000
committerBenjamin Schubert <contact@benschubert.me>2020-01-13 17:32:08 +0000
commit2d2bd16a1f931b4aece069baf94257df22e869cc (patch)
tree469db8d136752eb17b651b67492dd85a69ce99e4 /tests
parentd2cf34b9f8f0230b002e1213b8783f00326439b8 (diff)
downloadbuildstream-2d2bd16a1f931b4aece069baf94257df22e869cc.tar.gz
tox.ini: Add a external plugins environment test and run it in CI
This runs two versions of the plugins: - The latest stable is not allowed failures and is run on every platform - The master version is allowed failure, and only runs on a single architecture This also adds a new entrypoint to register source tests to run against BuildStream.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/conftest.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index cfca4ad06..8d33fa024 100755
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -21,6 +21,8 @@
#
import os
import multiprocessing
+
+import pkg_resources
import pytest
from buildstream.testing import register_repo_kind, sourcetests_collection_hook
@@ -46,7 +48,7 @@ from tests.testutils.repo.zip import Zip
#################################################
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")
@@ -66,6 +68,11 @@ def pytest_runtest_setup(item):
if item.get_closest_marker("remoteexecution"):
pytest.skip("skipping remote-execution test")
+ # With --plugins only run plugins tests
+ if item.config.getvalue("plugins"):
+ if not item.get_closest_marker("generic_source_test"):
+ pytest.skip("Skipping not generic source test")
+
#################################################
# remote_services fixture #
@@ -112,6 +119,12 @@ register_repo_kind("zip", Zip, None)
# This hook enables pytest to collect the templated source tests from
# buildstream.testing
def pytest_sessionstart(session):
+ if session.config.getvalue("plugins"):
+ # Enable all plugins that implement the 'buildstream.tests.source_plugins' hook
+ for entrypoint in pkg_resources.iter_entry_points("buildstream.tests.source_plugins"):
+ module = entrypoint.load()
+ module.register_sources()
+
sourcetests_collection_hook(session)