summaryrefslogtreecommitdiff
path: root/tests/frontend/show.py
diff options
context:
space:
mode:
authorChandan Singh <chandan@chandansingh.net>2020-05-14 18:45:53 +0000
committerChandan Singh <chandan@chandansingh.net>2020-05-14 19:37:37 +0000
commitbcd2536c2405ffa5dcd52ed9823a7c437cc1b2de (patch)
tree7a63e9dd83f8e93689adee7c9846c7ad5e1cce51 /tests/frontend/show.py
parentdd2eb18bfc60cef39c9aa478397a4ff9a6c87a1d (diff)
downloadbuildstream-chandan/duplicate-format-deps.tar.gz
Ensure there are no duplicates in Elements.dependencies()chandan/duplicate-format-deps
When we are not recursing, `Element.dependencies()` uses a much more light weight codepath since it just needs to print the direct dependencies. However, this simple codepath was not accounting for duplicates, in case something is both a build time and run time dependency. One way this manifested itself was in `bst show --format %{deps}`, but it would also affect anything that was using this method to iterate on the dependencies. Fixes #1308.
Diffstat (limited to 'tests/frontend/show.py')
-rw-r--r--tests/frontend/show.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/frontend/show.py b/tests/frontend/show.py
index 17931ffe3..4be4b72e9 100644
--- a/tests/frontend/show.py
+++ b/tests/frontend/show.py
@@ -399,14 +399,14 @@ def test_exceed_max_recursion_depth(cli, tmpdir, dependency_depth):
@pytest.mark.parametrize(
"dep_kind, expected_deps",
[
- ("%{deps}", "[import-dev.bst, import-bin.bst]"),
- ("%{build-deps}", "[import-dev.bst]"),
- ("%{runtime-deps}", "[import-bin.bst]"),
+ ("%{deps}", "[import-dev.bst, import-links.bst, import-bin.bst]"),
+ ("%{build-deps}", "[import-dev.bst, import-links.bst]"),
+ ("%{runtime-deps}", "[import-links.bst, import-bin.bst]"),
],
)
def test_format_deps(cli, datafiles, dep_kind, expected_deps):
project = str(datafiles)
- target = "checkout-deps.bst"
+ target = "format-deps.bst"
result = cli.run(
project=project, silent=True, args=["show", "--deps", "none", "--format", "%{name}: " + dep_kind, target]
)