diff options
author | Tristan van Berkom <tristan@codethink.co.uk> | 2020-12-22 18:18:54 +0900 |
---|---|---|
committer | Tristan van Berkom <tristan@codethink.co.uk> | 2020-12-23 14:57:49 +0900 |
commit | 73dde7d768f5cfde50e271fec26809f9b9a75008 (patch) | |
tree | 0c2adb1a7f849b13835542e8bc0d9978ef2af585 | |
parent | 6904c1328cec54b3858e57bbd83ee59e0fd7e16e (diff) | |
download | buildstream-73dde7d768f5cfde50e271fec26809f9b9a75008.tar.gz |
tests/internals/pluginloading.py: Removed test
This internal test was relying on internal construction of pipeline, and
relying on the shape of internal API interactions, which is the case for
many tests in the tests/internals directory, and thus they make internal
API churn harder to deal with.
In this case, this test has been long superceded by the newer test in
tests/plugins/loading.py, which not only tests the ability to load a custom
plugin and source successfully, but also tests the various possible failure
modes.
In short, this internal test is now thankfully obsolete.
9 files changed, 0 insertions, 102 deletions
diff --git a/tests/internals/pluginloading.py b/tests/internals/pluginloading.py deleted file mode 100644 index 1f4446541..000000000 --- a/tests/internals/pluginloading.py +++ /dev/null @@ -1,38 +0,0 @@ -from contextlib import contextmanager -import os -import pytest - -from buildstream._project import Project -from buildstream._pipeline import Pipeline - -from tests.testutils import dummy_context - -DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "pluginloading",) - - -@contextmanager -def create_pipeline(tmpdir, basedir, target): - with dummy_context() as context: - context.deploydir = os.path.join(str(tmpdir), "deploy") - context.casdir = os.path.join(str(tmpdir), "cas") - project = Project(basedir, context) - - pipeline = Pipeline(context, project, None) - (targets,) = pipeline.load([(target,)]) - yield targets - - -@pytest.mark.datafiles(os.path.join(DATA_DIR, "customsource")) -def test_customsource(datafiles, tmpdir): - - basedir = str(datafiles) - with create_pipeline(tmpdir, basedir, "simple.bst") as targets: - assert targets[0].get_kind() == "autotools" - - -@pytest.mark.datafiles(os.path.join(DATA_DIR, "customelement")) -def test_customelement(datafiles, tmpdir): - - basedir = str(datafiles) - with create_pipeline(tmpdir, basedir, "simple.bst") as targets: - assert targets[0].get_kind() == "foo" diff --git a/tests/internals/pluginloading/customelement/elements/simple.bst b/tests/internals/pluginloading/customelement/elements/simple.bst deleted file mode 100644 index fc48e3ba9..000000000 --- a/tests/internals/pluginloading/customelement/elements/simple.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: foo -description: Custom foo source -config: - pony-color: pink diff --git a/tests/internals/pluginloading/customelement/pluginelements/__init__.py b/tests/internals/pluginloading/customelement/pluginelements/__init__.py deleted file mode 100644 index e69de29bb..000000000 --- a/tests/internals/pluginloading/customelement/pluginelements/__init__.py +++ /dev/null diff --git a/tests/internals/pluginloading/customelement/pluginelements/foo.py b/tests/internals/pluginloading/customelement/pluginelements/foo.py deleted file mode 100644 index bdb6c8982..000000000 --- a/tests/internals/pluginloading/customelement/pluginelements/foo.py +++ /dev/null @@ -1,19 +0,0 @@ -from buildstream import Element - - -class FooElement(Element): - - BST_MIN_VERSION = "2.0" - - def preflight(self): - pass - - def configure(self, node): - pass - - def get_unique_key(self): - return {} - - -def setup(): - return FooElement diff --git a/tests/internals/pluginloading/customelement/project.conf b/tests/internals/pluginloading/customelement/project.conf deleted file mode 100644 index 2619bdf82..000000000 --- a/tests/internals/pluginloading/customelement/project.conf +++ /dev/null @@ -1,8 +0,0 @@ -name: pony -min-version: 2.0 -element-path: elements -plugins: -- origin: local - path: pluginelements - elements: - - foo diff --git a/tests/internals/pluginloading/customsource/elements/simple.bst b/tests/internals/pluginloading/customsource/elements/simple.bst deleted file mode 100644 index 7e0cc43b7..000000000 --- a/tests/internals/pluginloading/customsource/elements/simple.bst +++ /dev/null @@ -1,6 +0,0 @@ -kind: autotools -description: Custom foo source -sources: -- kind: foo - ref: 1.2.3 - uri: http://ponyland.com diff --git a/tests/internals/pluginloading/customsource/pluginsources/__init__.py b/tests/internals/pluginloading/customsource/pluginsources/__init__.py deleted file mode 100644 index e69de29bb..000000000 --- a/tests/internals/pluginloading/customsource/pluginsources/__init__.py +++ /dev/null diff --git a/tests/internals/pluginloading/customsource/pluginsources/foo.py b/tests/internals/pluginloading/customsource/pluginsources/foo.py deleted file mode 100644 index c5229f3e2..000000000 --- a/tests/internals/pluginloading/customsource/pluginsources/foo.py +++ /dev/null @@ -1,19 +0,0 @@ -from buildstream import Source - - -class FooSource(Source): - - BST_MIN_VERSION = "2.0" - - def preflight(self): - pass - - def configure(self, node): - pass - - def get_unique_key(self): - pass - - -def setup(): - return FooSource diff --git a/tests/internals/pluginloading/customsource/project.conf b/tests/internals/pluginloading/customsource/project.conf deleted file mode 100644 index 5cb6da537..000000000 --- a/tests/internals/pluginloading/customsource/project.conf +++ /dev/null @@ -1,8 +0,0 @@ -name: pony -min-version: 2.0 -element-path: elements -plugins: -- origin: local - path: pluginsources - sources: - - foo |