diff options
Diffstat (limited to 'tests/pipeline/preflight-error')
4 files changed, 50 insertions, 0 deletions
diff --git a/tests/pipeline/preflight-error/error.bst b/tests/pipeline/preflight-error/error.bst new file mode 100644 index 000000000..a9772770c --- /dev/null +++ b/tests/pipeline/preflight-error/error.bst @@ -0,0 +1,4 @@ +kind: import +description: An element with a failing source at preflight time +sources: +- kind: preflighterror diff --git a/tests/pipeline/preflight-error/errorplugin/__init__.py b/tests/pipeline/preflight-error/errorplugin/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/pipeline/preflight-error/errorplugin/__init__.py diff --git a/tests/pipeline/preflight-error/errorplugin/preflighterror.py b/tests/pipeline/preflight-error/errorplugin/preflighterror.py new file mode 100644 index 000000000..59c49e012 --- /dev/null +++ b/tests/pipeline/preflight-error/errorplugin/preflighterror.py @@ -0,0 +1,35 @@ +from buildstream import Source, SourceError, Consistency + + +class PreflightErrorSource(Source): + + def configure(self, node): + pass + + def preflight(self): + + # Raise a preflight error unconditionally + raise SourceError("{}: Unsatisfied requirements in preflight, raising this error", + reason="the-preflight-error") + + def get_unique_key(self): + return {} + + def get_consistency(self): + return Consistency.CACHED + + def get_ref(self): + return None + + def set_ref(self, ref, node): + pass + + def fetch(self): + pass + + def stage(self, directory): + pass + + +def setup(): + return PreflightErrorSource diff --git a/tests/pipeline/preflight-error/project.conf b/tests/pipeline/preflight-error/project.conf new file mode 100644 index 000000000..20a234413 --- /dev/null +++ b/tests/pipeline/preflight-error/project.conf @@ -0,0 +1,11 @@ +# Basic project configuration that doesnt override anything +# +name: pony + +# Whitelist the local test Source "errorplugin" to be loaded +# +plugins: +- origin: local + path: errorplugin + sources: + preflighterror: 0 |