summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan van Berkom <tristan.vanberkom@codethink.co.uk>2019-08-02 18:47:51 -0400
committerTristan van Berkom <tristan.vanberkom@codethink.co.uk>2019-08-03 16:50:32 -0400
commita50327422fb8a0882c350c7e3b7ecf160cec8d20 (patch)
treea25d8e4e8059685ca49aa19275c147cc18c76f38
parentd1c8ed3dfbd26beebb5361045da6a5e1513cb151 (diff)
downloadbuildstream-a50327422fb8a0882c350c7e3b7ecf160cec8d20.tar.gz
tests: Fix the fatal-warnings initial test plugins
For some reason after rebasing Josh's work onto the `bst-1` branch, the plugins do not succeed, needed to at least have the `assemble()` methods return a path to an existing directory.
-rw-r--r--tests/frontend/configuredwarning/plugins/corewarn.py12
-rw-r--r--tests/frontend/configuredwarning/plugins/warninga.py9
-rw-r--r--tests/frontend/configuredwarning/plugins/warningb.py9
3 files changed, 29 insertions, 1 deletions
diff --git a/tests/frontend/configuredwarning/plugins/corewarn.py b/tests/frontend/configuredwarning/plugins/corewarn.py
index 1f263a0ce..bb744b0dd 100644
--- a/tests/frontend/configuredwarning/plugins/corewarn.py
+++ b/tests/frontend/configuredwarning/plugins/corewarn.py
@@ -1,3 +1,5 @@
+import os
+
from buildstream import Element
from buildstream.plugin import CoreWarnings
@@ -13,7 +15,7 @@ class CoreWarn(Element):
pass
def configure_sandbox(self, sandbox):
- pass
+ sandbox.mark_directory(self.get_variable('install-root'))
def stage(self, sandbox):
pass
@@ -22,6 +24,14 @@ class CoreWarn(Element):
self.warn("Testing: CoreWarning produced during assemble",
warning_token=CoreWarnings.OVERLAPS)
+ # Return an arbitrary existing directory in the sandbox
+ #
+ rootdir = sandbox.get_directory()
+ install_root = self.get_variable('install-root')
+ outputdir = os.path.join(rootdir, install_root.lstrip(os.sep))
+ os.makedirs(outputdir, exist_ok=True)
+ return install_root
+
def setup():
return CoreWarn
diff --git a/tests/frontend/configuredwarning/plugins/warninga.py b/tests/frontend/configuredwarning/plugins/warninga.py
index 9fd8dc61b..09c9ac3d9 100644
--- a/tests/frontend/configuredwarning/plugins/warninga.py
+++ b/tests/frontend/configuredwarning/plugins/warninga.py
@@ -1,3 +1,4 @@
+import os
from buildstream import Element
WARNING_A = "warning-a"
@@ -22,6 +23,14 @@ class WarningA(Element):
def assemble(self, sandbox):
self.warn("Testing: warning-a produced during assemble", warning_token=WARNING_A)
+ # Return an arbitrary existing directory in the sandbox
+ #
+ rootdir = sandbox.get_directory()
+ install_root = self.get_variable('install-root')
+ outputdir = os.path.join(rootdir, install_root.lstrip(os.sep))
+ os.makedirs(outputdir, exist_ok=True)
+ return install_root
+
def setup():
return WarningA
diff --git a/tests/frontend/configuredwarning/plugins/warningb.py b/tests/frontend/configuredwarning/plugins/warningb.py
index 64d25ef39..1859e7dee 100644
--- a/tests/frontend/configuredwarning/plugins/warningb.py
+++ b/tests/frontend/configuredwarning/plugins/warningb.py
@@ -1,3 +1,4 @@
+import os
from buildstream import Element
WARNING_B = "warning-b"
@@ -22,6 +23,14 @@ class WarningB(Element):
def assemble(self, sandbox):
self.warn("Testing: warning-b produced during assemble", warning_token=WARNING_B)
+ # Return an arbitrary existing directory in the sandbox
+ #
+ rootdir = sandbox.get_directory()
+ install_root = self.get_variable('install-root')
+ outputdir = os.path.join(rootdir, install_root.lstrip(os.sep))
+ os.makedirs(outputdir, exist_ok=True)
+ return install_root
+
def setup():
return WarningB