summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-01-11 14:16:25 -0500
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-01-16 18:35:21 -0500
commitde881c2ac07a072f60d0adcd5e6cc734c08b773b (patch)
tree516cd202bc4d1edd78b61adbc24dbb53be1f2247
parent8f2b4e9aa0631b8622804206d5742701fd3e03c0 (diff)
downloadbuildstream-de881c2ac07a072f60d0adcd5e6cc734c08b773b.tar.gz
tests: Migrate preflight error handling check to tests/format/project.py
This is where other load time related plugin error handling is checked, and is the last thing to remove in the `tests/pipeline` directory.
-rw-r--r--tests/format/project.py7
-rw-r--r--tests/format/project/plugin-preflight-error/error.bst (renamed from tests/pipeline/preflight-error/error.bst)0
-rw-r--r--tests/format/project/plugin-preflight-error/errorplugin/__init__.py (renamed from tests/pipeline/preflight-error/errorplugin/__init__.py)0
-rw-r--r--tests/format/project/plugin-preflight-error/errorplugin/preflighterror.py (renamed from tests/pipeline/preflight-error/errorplugin/preflighterror.py)0
-rw-r--r--tests/format/project/plugin-preflight-error/project.conf (renamed from tests/pipeline/preflight-error/project.conf)0
-rw-r--r--tests/pipeline/preflight.py19
6 files changed, 7 insertions, 19 deletions
diff --git a/tests/format/project.py b/tests/format/project.py
index 294b9a4ff..56109b35b 100644
--- a/tests/format/project.py
+++ b/tests/format/project.py
@@ -188,6 +188,13 @@ def test_project_plugin_no_load_ref(cli, datafiles, ref_storage):
@pytest.mark.datafiles(DATA_DIR)
+def test_project_plugin_preflight_error(cli, datafiles, tmpdir):
+ project = os.path.join(datafiles.dirname, datafiles.basename, 'plugin-preflight-error')
+ result = cli.run(project=project, args=['source', 'fetch', 'error.bst'])
+ result.assert_main_error(ErrorDomain.SOURCE, "the-preflight-error")
+
+
+@pytest.mark.datafiles(DATA_DIR)
def test_project_conf_duplicate_plugins(cli, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename, 'duplicate-plugins')
result = cli.run(project=project, silent=True, args=[
diff --git a/tests/pipeline/preflight-error/error.bst b/tests/format/project/plugin-preflight-error/error.bst
index a9772770c..a9772770c 100644
--- a/tests/pipeline/preflight-error/error.bst
+++ b/tests/format/project/plugin-preflight-error/error.bst
diff --git a/tests/pipeline/preflight-error/errorplugin/__init__.py b/tests/format/project/plugin-preflight-error/errorplugin/__init__.py
index e69de29bb..e69de29bb 100644
--- a/tests/pipeline/preflight-error/errorplugin/__init__.py
+++ b/tests/format/project/plugin-preflight-error/errorplugin/__init__.py
diff --git a/tests/pipeline/preflight-error/errorplugin/preflighterror.py b/tests/format/project/plugin-preflight-error/errorplugin/preflighterror.py
index 0eee463ad..0eee463ad 100644
--- a/tests/pipeline/preflight-error/errorplugin/preflighterror.py
+++ b/tests/format/project/plugin-preflight-error/errorplugin/preflighterror.py
diff --git a/tests/pipeline/preflight-error/project.conf b/tests/format/project/plugin-preflight-error/project.conf
index 20a234413..20a234413 100644
--- a/tests/pipeline/preflight-error/project.conf
+++ b/tests/format/project/plugin-preflight-error/project.conf
diff --git a/tests/pipeline/preflight.py b/tests/pipeline/preflight.py
deleted file mode 100644
index 938f93191..000000000
--- a/tests/pipeline/preflight.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import os
-import pytest
-
-from buildstream._exceptions import ErrorDomain
-from tests.testutils.runcli import cli
-
-DATA_DIR = os.path.join(
- os.path.dirname(os.path.realpath(__file__)),
- 'preflight-error',
-)
-
-
-@pytest.mark.datafiles(DATA_DIR)
-def test_load_simple(cli, datafiles, tmpdir):
- basedir = os.path.join(datafiles.dirname, datafiles.basename)
-
- # Lets try to fetch it...
- result = cli.run(project=basedir, args=['source', 'fetch', 'error.bst'])
- result.assert_main_error(ErrorDomain.SOURCE, "the-preflight-error")