diff options
author | Benjamin Schubert <bschubert15@bloomberg.net> | 2019-11-28 18:31:37 +0000 |
---|---|---|
committer | Benjamin Schubert <bschubert15@bloomberg.net> | 2020-01-16 16:33:19 +0000 |
commit | 6021d8544e8808419d1b44f0cf850ce3ca3290f5 (patch) | |
tree | 8324375dd5ffc871869fa33e7e4cb91c710625c6 /tests/sources/git.py | |
parent | 5cb2442e789d6b302f7d261ba5d2a2ad5366d7c2 (diff) | |
download | buildstream-6021d8544e8808419d1b44f0cf850ce3ca3290f5.tar.gz |
element.py: Compute whether an element is cached only on `is_cached`
This removes the early call to get whether sources are locally cached
in `_update_source_state` by delegating it to the call of `is_cached`.
Once it is cached, the element is assumed to stay that way for the
duration of the pipeline, we can therefore cache the result once it is
true.
Also remove `Consistency.IS_CACHED`, which is not used anywhere else.
Diffstat (limited to 'tests/sources/git.py')
-rw-r--r-- | tests/sources/git.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/sources/git.py b/tests/sources/git.py index d6f9cb223..25976ffca 100644 --- a/tests/sources/git.py +++ b/tests/sources/git.py @@ -499,7 +499,9 @@ def test_unlisted_submodule(cli, tmpdir, datafiles, fail): result.assert_main_error(ErrorDomain.PLUGIN, "git:unlisted-submodule") else: result.assert_success() - assert "git:unlisted-submodule" in result.stderr + # We have cached things internally and successfully. Therefore, the plugin + # is not involved in checking whether the cache is correct or not. + assert "git:unlisted-submodule" not in result.stderr @pytest.mark.skipif(HAVE_GIT is False, reason="git is not available") @@ -613,7 +615,9 @@ def test_invalid_submodule(cli, tmpdir, datafiles, fail): result.assert_main_error(ErrorDomain.PLUGIN, "git:invalid-submodule") else: result.assert_success() - assert "git:invalid-submodule" in result.stderr + # We have cached things internally and successfully. Therefore, the plugin + # is not involved in checking whether the cache is correct or not. + assert "git:invalid-submodule" not in result.stderr @pytest.mark.skipif(HAVE_GIT is False, reason="git is not available") |