From 6a84970155e69ca554453b56f5d6da3fa1710f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Tue, 4 Aug 2020 16:02:27 +0200 Subject: element.py: Drop cache checks from `_tracking_done()` This was a workaround for inconsistent error handling in the frontend. As the error handling is now fixed, drop these cache checks after tracking. --- src/buildstream/element.py | 7 ------- tests/frontend/track.py | 5 ++--- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/buildstream/element.py b/src/buildstream/element.py index 4c3f239a1..5782ae4af 100644 --- a/src/buildstream/element.py +++ b/src/buildstream/element.py @@ -1232,13 +1232,6 @@ class Element(Plugin): # source state. We need to update source state. self.__update_resolved_state() - # Check whether sources are now cached. - # This is done here so that we don't throw an exception trying to show the pipeline at the end - # This has for side-effect to cache this fact too, which will change the object's state. - # This is done here rather than later so we can validate that the sources are valid locally - self._has_all_sources_in_source_cache() - self._has_all_sources_cached() - # _track(): # # Calls track() on the Element sources diff --git a/tests/frontend/track.py b/tests/frontend/track.py index 2ebaae81f..5fe9bbde6 100644 --- a/tests/frontend/track.py +++ b/tests/frontend/track.py @@ -209,8 +209,7 @@ def test_track_consistency_error(cli, datafiles): # Track the element causing a consistency error result = cli.run(project=project, args=["source", "track", "error.bst"]) - result.assert_main_error(ErrorDomain.STREAM, None) - result.assert_task_error(ErrorDomain.SOURCE, "the-consistency-error") + result.assert_main_error(ErrorDomain.SOURCE, "the-consistency-error") @pytest.mark.datafiles(os.path.join(TOP_DIR, "consistencyerror")) @@ -221,7 +220,7 @@ def test_track_consistency_bug(cli, datafiles): result = cli.run(project=project, args=["source", "track", "bug.bst"]) # We expect BuildStream to fail gracefully, with no recorded exception. - result.assert_main_error(ErrorDomain.STREAM, None) + result.assert_main_error(ErrorDomain.PLUGIN, "source-bug") @pytest.mark.datafiles(DATA_DIR) -- cgit v1.2.1