diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-01-11 17:28:39 -0500 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-01-16 18:35:21 -0500 |
commit | e825bdd3b0edea6a7b49eadbcae16bd199d839dc (patch) | |
tree | 8436314f5f5bd52b2bdc3d65da220ec0799da4ae /tests/internals/pluginloading | |
parent | 99ea157ae4d22220ff3c529e12c19fe47369c4df (diff) | |
download | buildstream-e825bdd3b0edea6a7b49eadbcae16bd199d839dc.tar.gz |
tests: Migrate plugin loading test to internals directory
Diffstat (limited to 'tests/internals/pluginloading')
16 files changed, 124 insertions, 0 deletions
diff --git a/tests/internals/pluginloading/badversionelement/customelements/__init__.py b/tests/internals/pluginloading/badversionelement/customelements/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/internals/pluginloading/badversionelement/customelements/__init__.py diff --git a/tests/internals/pluginloading/badversionelement/customelements/foo.py b/tests/internals/pluginloading/badversionelement/customelements/foo.py new file mode 100644 index 000000000..75536e87f --- /dev/null +++ b/tests/internals/pluginloading/badversionelement/customelements/foo.py @@ -0,0 +1,19 @@ +from buildstream import Element + + +class FooElement(Element): + + BST_FORMAT_VERSION = 5 + + 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/badversionelement/elements/simple.bst b/tests/internals/pluginloading/badversionelement/elements/simple.bst new file mode 100644 index 000000000..f949dc5b5 --- /dev/null +++ b/tests/internals/pluginloading/badversionelement/elements/simple.bst @@ -0,0 +1,4 @@ +kind: foo +description: Custom foo element +config: + some: thing diff --git a/tests/internals/pluginloading/badversionelement/project.conf b/tests/internals/pluginloading/badversionelement/project.conf new file mode 100644 index 000000000..4f32752c3 --- /dev/null +++ b/tests/internals/pluginloading/badversionelement/project.conf @@ -0,0 +1,9 @@ +name: pony +element-path: elements + +plugins: +- origin: local + path: customelements + elements: + # We provided bar at version 5, should be a conflict. + foo: 10 diff --git a/tests/internals/pluginloading/badversionsource/customsources/__init__.py b/tests/internals/pluginloading/badversionsource/customsources/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/internals/pluginloading/badversionsource/customsources/__init__.py diff --git a/tests/internals/pluginloading/badversionsource/customsources/foo.py b/tests/internals/pluginloading/badversionsource/customsources/foo.py new file mode 100644 index 000000000..f50855fd1 --- /dev/null +++ b/tests/internals/pluginloading/badversionsource/customsources/foo.py @@ -0,0 +1,19 @@ +from buildstream import Source, Consistency + + +class BarSource(Source): + + BST_FORMAT_VERSION = 5 + + def preflight(self): + pass + + def configure(self, node): + pass + + def get_consistency(self): + return Consistency.INCONSISTENT + + +def setup(): + return BarSource diff --git a/tests/internals/pluginloading/badversionsource/elements/simple.bst b/tests/internals/pluginloading/badversionsource/elements/simple.bst new file mode 100644 index 000000000..7e0cc43b7 --- /dev/null +++ b/tests/internals/pluginloading/badversionsource/elements/simple.bst @@ -0,0 +1,6 @@ +kind: autotools +description: Custom foo source +sources: +- kind: foo + ref: 1.2.3 + uri: http://ponyland.com diff --git a/tests/internals/pluginloading/badversionsource/project.conf b/tests/internals/pluginloading/badversionsource/project.conf new file mode 100644 index 000000000..58cf9c577 --- /dev/null +++ b/tests/internals/pluginloading/badversionsource/project.conf @@ -0,0 +1,9 @@ +name: pony +element-path: elements + +plugins: +- origin: local + path: customsources + sources: + # We provided bar at version 5, should be a conflict. + foo: 10 diff --git a/tests/internals/pluginloading/customelement/elements/simple.bst b/tests/internals/pluginloading/customelement/elements/simple.bst new file mode 100644 index 000000000..fc48e3ba9 --- /dev/null +++ b/tests/internals/pluginloading/customelement/elements/simple.bst @@ -0,0 +1,4 @@ +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 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/internals/pluginloading/customelement/pluginelements/__init__.py diff --git a/tests/internals/pluginloading/customelement/pluginelements/foo.py b/tests/internals/pluginloading/customelement/pluginelements/foo.py new file mode 100644 index 000000000..823306ebc --- /dev/null +++ b/tests/internals/pluginloading/customelement/pluginelements/foo.py @@ -0,0 +1,17 @@ +from buildstream import Element + + +class FooElement(Element): + + 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 new file mode 100644 index 000000000..bdc909985 --- /dev/null +++ b/tests/internals/pluginloading/customelement/project.conf @@ -0,0 +1,7 @@ +name: pony +element-path: elements +plugins: +- origin: local + path: pluginelements + elements: + foo: 0 diff --git a/tests/internals/pluginloading/customsource/elements/simple.bst b/tests/internals/pluginloading/customsource/elements/simple.bst new file mode 100644 index 000000000..7e0cc43b7 --- /dev/null +++ b/tests/internals/pluginloading/customsource/elements/simple.bst @@ -0,0 +1,6 @@ +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 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/internals/pluginloading/customsource/pluginsources/__init__.py diff --git a/tests/internals/pluginloading/customsource/pluginsources/foo.py b/tests/internals/pluginloading/customsource/pluginsources/foo.py new file mode 100644 index 000000000..d2b0d9c6d --- /dev/null +++ b/tests/internals/pluginloading/customsource/pluginsources/foo.py @@ -0,0 +1,17 @@ +from buildstream import Source, Consistency + + +class FooSource(Source): + + def preflight(self): + pass + + def configure(self, node): + pass + + def get_consistency(self): + return Consistency.INCONSISTENT + + +def setup(): + return FooSource diff --git a/tests/internals/pluginloading/customsource/project.conf b/tests/internals/pluginloading/customsource/project.conf new file mode 100644 index 000000000..8205d185a --- /dev/null +++ b/tests/internals/pluginloading/customsource/project.conf @@ -0,0 +1,7 @@ +name: pony +element-path: elements +plugins: +- origin: local + path: pluginsources + sources: + foo: 0 |