summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngelos Evripiotis <jevripiotis@bloomberg.net>2019-03-20 10:49:58 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-03-26 18:27:58 +0000
commit000f7eb3959f5a07a94af776b6cee96caa6df6b5 (patch)
tree7d05a04473ce4dad79a7457aebd8cb30de9790e9
parent7a928a14d3357543789dc22b2f4c2a04f7a89594 (diff)
downloadbuildstream-000f7eb3959f5a07a94af776b6cee96caa6df6b5.tar.gz
tests: Add test_invalid_junctiondep_not_a_junction
Test that we error correctly when we junction-depend on a non-junction.
-rw-r--r--tests/format/junctions.py13
-rw-r--r--tests/format/junctions/invalid/junctiondep-not-a-junction.bst4
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/format/junctions.py b/tests/format/junctions.py
index fc2dbc155..3a215761a 100644
--- a/tests/format/junctions.py
+++ b/tests/format/junctions.py
@@ -251,6 +251,19 @@ def test_invalid_junction_dep(cli, datafiles):
result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_DATA)
+# Test that we error correctly when we junction-depend on a non-junction
+@pytest.mark.datafiles(DATA_DIR)
+def test_invalid_junctiondep_not_a_junction(cli, datafiles):
+ project = os.path.join(str(datafiles), 'invalid')
+ copy_subprojects(project, datafiles, ['base'])
+
+ result = cli.run(project=project, args=['build', 'junctiondep-not-a-junction.bst'])
+ result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_DATA)
+
+ # Assert that we have the expected provenance encoded into the error
+ assert "junctiondep-not-a-junction.bst [line 3 column 2]" in result.stderr
+
+
@pytest.mark.datafiles(DATA_DIR)
def test_options_default(cli, tmpdir, datafiles):
project = os.path.join(str(datafiles), 'options-default')
diff --git a/tests/format/junctions/invalid/junctiondep-not-a-junction.bst b/tests/format/junctions/invalid/junctiondep-not-a-junction.bst
new file mode 100644
index 000000000..c59f1be25
--- /dev/null
+++ b/tests/format/junctions/invalid/junctiondep-not-a-junction.bst
@@ -0,0 +1,4 @@
+kind: stack
+depends:
+- junction: app.bst
+ filename: target.bst