diff options
author | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-03-20 10:49:58 +0000 |
---|---|---|
committer | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-03-21 16:17:46 +0000 |
commit | 28d39193dac15c07397974b7b5ea768bbbac2dd5 (patch) | |
tree | 285b12e504f02fd22c7af09c58831bf62adedbeb | |
parent | 6afd44f673a5a95ca90ff66eb605f4b14b16bfa5 (diff) | |
download | buildstream-aevri/junction_load_provenance.tar.gz |
tests: Add test_invalid_junctiondep_not_a_junctionaevri/junction_load_provenance
Test that we error correctly when we junction-depend on a non-junction.
-rw-r--r-- | tests/format/junctions.py | 13 | ||||
-rw-r--r-- | tests/format/junctions/invalid/junctiondep-not-a-junction.bst | 4 |
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 |