From a50327422fb8a0882c350c7e3b7ecf160cec8d20 Mon Sep 17 00:00:00 2001 From: Tristan van Berkom Date: Fri, 2 Aug 2019 18:47:51 -0400 Subject: 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. --- tests/frontend/configuredwarning/plugins/corewarn.py | 12 +++++++++++- tests/frontend/configuredwarning/plugins/warninga.py | 9 +++++++++ tests/frontend/configuredwarning/plugins/warningb.py | 9 +++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1