summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Pollard <tom.pollard@codethink.co.uk>2019-09-26 15:04:07 +0100
committerTom Pollard <tom.pollard@codethink.co.uk>2019-10-02 15:40:19 +0100
commit1142484eca2df3ec966e5f6147554cb2a5346b1e (patch)
tree7a7c2e4981fdf0e83e2e2274719ac7ff3842f776
parentf307ac2616802d60dd4e95319f98d50739a549b7 (diff)
downloadbuildstream-1142484eca2df3ec966e5f6147554cb2a5346b1e.tar.gz
Explicitly ensure failed build sources are not pushed
-rw-r--r--src/buildstream/element.py3
-rw-r--r--tests/sourcecache/push.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index 4ebb17d09..58eb7a9b7 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -1880,7 +1880,8 @@ class Element(Plugin):
return True
def _skip_source_push(self):
- if not self.__sources or self._get_workspace():
+ # Skip push if we have no sources, are workspaced or the given element failed to build
+ if not self.__sources or self._get_workspace() or not self._get_build_result()[0]:
return True
return not (self.__sourcecache.has_push_remotes(plugin=self) and
self._source_cached())
diff --git a/tests/sourcecache/push.py b/tests/sourcecache/push.py
index 1be2d40cd..5038e235d 100644
--- a/tests/sourcecache/push.py
+++ b/tests/sourcecache/push.py
@@ -295,5 +295,5 @@ def test_source_push_build_fail(cli, tmpdir, datafiles):
res.assert_task_error(ErrorDomain.ELEMENT, None)
# Sources are not pushed as the build queue is before the source push
- # queue.
+ # queue. We explicitly don't want to push failed build source by default.
assert "Pushed source " not in res.stderr