summaryrefslogtreecommitdiff
path: root/tests/sandboxes/missing-command.py
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2018-06-28 11:31:09 +0100
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2018-07-02 14:45:04 +0000
commit9067e269a9f2866e659ef33a69aad72b01cb6633 (patch)
tree214930ffc29bb3e7c10de81babb834e4119f8c77 /tests/sandboxes/missing-command.py
parenta85aaee6630c2e58c20f538a235179ec65b6b32e (diff)
downloadbuildstream-9067e269a9f2866e659ef33a69aad72b01cb6633.tar.gz
Provide better error message on missing commands
Before running a command in the sandbox, check its existence and fail early if it does not. This fixes issue #289.
Diffstat (limited to 'tests/sandboxes/missing-command.py')
-rw-r--r--tests/sandboxes/missing-command.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/sandboxes/missing-command.py b/tests/sandboxes/missing-command.py
new file mode 100644
index 000000000..8f210bcec
--- /dev/null
+++ b/tests/sandboxes/missing-command.py
@@ -0,0 +1,19 @@
+import os
+import pytest
+
+from buildstream._exceptions import ErrorDomain
+
+from tests.testutils import cli
+
+
+DATA_DIR = os.path.join(
+ os.path.dirname(os.path.realpath(__file__)),
+ "missing-command"
+)
+
+
+@pytest.mark.datafiles(DATA_DIR)
+def test_missing_command(cli, tmpdir, datafiles):
+ project = os.path.join(datafiles.dirname, datafiles.basename)
+ result = cli.run(project=project, args=['build', 'no-runtime.bst'])
+ result.assert_task_error(ErrorDomain.SANDBOX, 'missing-command')