diff options
author | Dor Askayo <dor.askayo@gmail.com> | 2019-01-26 01:53:42 +0200 |
---|---|---|
committer | James Ennis <james.ennis@codethink.com> | 2019-01-30 10:35:06 +0000 |
commit | 03111d39e093b11ffc6589071f2f5040d5f61ab4 (patch) | |
tree | c3d518b68f1082340d3cc63e1dc7e4bc00ca8a59 /tests/elements/filter.py | |
parent | aae35e13e8f5ed550d7ccdd6611482c225a4ff81 (diff) | |
download | buildstream-03111d39e093b11ffc6589071f2f5040d5f61ab4.tar.gz |
filter.py: don't recurse when staging dependencies
Also bump the element's version so cached artifacts would be
invalidated.
Fixes #883
Diffstat (limited to 'tests/elements/filter.py')
-rw-r--r-- | tests/elements/filter.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/elements/filter.py b/tests/elements/filter.py index a63ef29e1..8ff642c64 100644 --- a/tests/elements/filter.py +++ b/tests/elements/filter.py @@ -464,3 +464,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=[ + 'artifact', 'checkout', 'output-include-with-indirect-deps.bst', '--directory', 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")) |