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-05 20:08:31 +0900 |
commit | f93268269afd67b8e1b77ce874ad2a4814fe6a54 (patch) | |
tree | ed3b4e87a9a802f9c4da7c76825034099da0c1be | |
parent | e9889e697917809bfd7f8449b251fd18d20a2d2d (diff) | |
download | buildstream-f93268269afd67b8e1b77ce874ad2a4814fe6a54.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.
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 |