diff options
author | Tristan van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-06-05 19:40:26 +0900 |
---|---|---|
committer | Tristan van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-06-08 23:50:34 +0900 |
commit | 6c0140273156a1a8457b29286342dc27bd444db7 (patch) | |
tree | cd3343bfa097c5ee65fa9cbfe3eccb9760bee34f /tests | |
parent | 5a2a9f4da08ff3b6f952683f970fc0f8c16e1b67 (diff) | |
download | buildstream-6c0140273156a1a8457b29286342dc27bd444db7.tar.gz |
tests/format/link.py: Testing full path link targets
* Test that we succeed to load links with full path targets
* Test that we get correct provenance information in errors when
linking to non-existing elements in existing subprojects, using
full paths.
Diffstat (limited to 'tests')
5 files changed, 23 insertions, 1 deletions
diff --git a/tests/format/link.py b/tests/format/link.py index 47e19b90c..e2c9e0b84 100644 --- a/tests/format/link.py +++ b/tests/format/link.py @@ -59,7 +59,9 @@ def test_conditional_link(cli, tmpdir, datafiles, target, greeting, expected_fil # Test links to junctions from local projects and subprojects # @pytest.mark.datafiles(DATA_DIR) -@pytest.mark.parametrize("target", ["target-local.bst", "target-nested.bst"]) +@pytest.mark.parametrize( + "target", ["target-local.bst", "target-nested.bst", "full-path-link.bst", "target-full-path.bst"] +) def test_simple_junctions(cli, tmpdir, datafiles, target): project = os.path.join(str(datafiles), "simple-junctions") checkoutdir = os.path.join(str(tmpdir), "checkout") @@ -115,6 +117,10 @@ def test_conditional_junctions(cli, tmpdir, datafiles, greeting, expected_file): ("linked-local-junction.bst", "subproject-link-notfound.bst [line 4 column 10]",), # Depends on an element via a link to a non-existing subproject junction ("linked-nested-junction.bst", "subsubproject-link-notfound.bst [line 4 column 10]",), + # Target is a link to a non-existing nested element referred to with a full path + ("link-full-path.bst", "link-full-path.bst [line 4 column 10]"), + # Target depends on a link to a non-existing nested element referred to with a full path + ("target-full-path.bst", "link-full-path.bst [line 4 column 10]"), ], ) def test_link_not_found(cli, tmpdir, datafiles, target, provenance): diff --git a/tests/format/link/notfound/elements/link-full-path.bst b/tests/format/link/notfound/elements/link-full-path.bst new file mode 100644 index 000000000..a619c549a --- /dev/null +++ b/tests/format/link/notfound/elements/link-full-path.bst @@ -0,0 +1,4 @@ +kind: link + +config: + target: subproject.bst:subsubproject-junction.bst:pony.bst diff --git a/tests/format/link/notfound/elements/target-full-path.bst b/tests/format/link/notfound/elements/target-full-path.bst new file mode 100644 index 000000000..ad67c343e --- /dev/null +++ b/tests/format/link/notfound/elements/target-full-path.bst @@ -0,0 +1,4 @@ +kind: stack + +depends: +- link-full-path.bst diff --git a/tests/format/link/simple-junctions/elements/full-path-link.bst b/tests/format/link/simple-junctions/elements/full-path-link.bst new file mode 100644 index 000000000..306e18cb2 --- /dev/null +++ b/tests/format/link/simple-junctions/elements/full-path-link.bst @@ -0,0 +1,4 @@ +kind: link + +config: + target: subproject.bst:subsubproject-junction.bst:hello.bst diff --git a/tests/format/link/simple-junctions/elements/target-full-path.bst b/tests/format/link/simple-junctions/elements/target-full-path.bst new file mode 100644 index 000000000..3fdc9519a --- /dev/null +++ b/tests/format/link/simple-junctions/elements/target-full-path.bst @@ -0,0 +1,4 @@ +kind: stack + +depends: +- full-path-link.bst |