diff options
author | Dor Askayo <dor.askayo@gmail.com> | 2019-01-26 01:53:42 +0200 |
---|---|---|
committer | James Ennis <james.ennis@codethink.com> | 2019-02-05 08:45:11 +0000 |
commit | 880a5c9a5237544559d126d1666150c865dabc16 (patch) | |
tree | 12c1faf1f2c7aa74d965c450d6da6e899e02d4dd /tests | |
parent | f4fa33c8583607d8f481259a81fd77bf1ef33945 (diff) | |
download | buildstream-880a5c9a5237544559d126d1666150c865dabc16.tar.gz |
filter.py: don't recurse when staging dependenciesdoraskayo/filter-indirect-deps-fix-1.2
Also bump the element's version so cached artifacts would be
invalidated.
Fixes #883
(cherry picked from commit 03111d39e093b11ffc6589071f2f5040d5f61ab4)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/plugins/filter.py | 20 | ||||
-rw-r--r-- | tests/plugins/filter/basic/elements/input-with-deps.bst | 14 | ||||
-rw-r--r-- | tests/plugins/filter/basic/elements/output-include-with-indirect-deps.bst | 5 |
3 files changed, 39 insertions, 0 deletions
diff --git a/tests/plugins/filter.py b/tests/plugins/filter.py index 559815a8b..982b6d2c2 100644 --- a/tests/plugins/filter.py +++ b/tests/plugins/filter.py @@ -452,3 +452,23 @@ def test_filter_track_multi_exclude(datafiles, cli, tmpdir): assert "ref" not in new_input["sources"][0] new_input2 = _yaml.load(input2_file) assert new_input2["sources"][0]["ref"] == ref + + +@pytest.mark.datafiles(os.path.join(DATA_DIR, 'basic')) +def test_filter_include_with_indirect_deps(datafiles, cli, tmpdir): + project = os.path.join(datafiles.dirname, datafiles.basename) + result = cli.run(project=project, args=[ + 'build', 'output-include-with-indirect-deps.bst']) + result.assert_success() + + checkout = os.path.join(tmpdir.dirname, tmpdir.basename, 'checkout') + result = cli.run(project=project, args=[ + 'checkout', 'output-include-with-indirect-deps.bst', checkout]) + result.assert_success() + + # direct dependencies should be staged and filtered + assert os.path.exists(os.path.join(checkout, "baz")) + + # indirect dependencies shouldn't be staged and filtered + assert not os.path.exists(os.path.join(checkout, "foo")) + assert not os.path.exists(os.path.join(checkout, "bar")) diff --git a/tests/plugins/filter/basic/elements/input-with-deps.bst b/tests/plugins/filter/basic/elements/input-with-deps.bst new file mode 100644 index 000000000..50aab573c --- /dev/null +++ b/tests/plugins/filter/basic/elements/input-with-deps.bst @@ -0,0 +1,14 @@ +kind: import + +depends: +- filename: input.bst + +sources: +- kind: local + path: files + +public: + bst: + split-rules: + baz: + - /baz diff --git a/tests/plugins/filter/basic/elements/output-include-with-indirect-deps.bst b/tests/plugins/filter/basic/elements/output-include-with-indirect-deps.bst new file mode 100644 index 000000000..8325853e2 --- /dev/null +++ b/tests/plugins/filter/basic/elements/output-include-with-indirect-deps.bst @@ -0,0 +1,5 @@ +kind: filter + +depends: +- filename: input-with-deps.bst + type: build |