diff options
author | Guido Günther <agx@sigxcpu.org> | 2017-11-01 13:49:20 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2017-11-01 13:49:56 +0100 |
commit | 5b05ead3a6f7b078f105336edb8ddd78fce48fe6 (patch) | |
tree | 821052bee1b791a90f055f5cf12c5389234a1598 /tests | |
parent | 8f851ecf36bea506f95d20852121bf77a1468ee1 (diff) |
push: Don't abort on first failure
Push as many refs as possible instead of aborting on the first error.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/component/deb/test_push.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/component/deb/test_push.py b/tests/component/deb/test_push.py index 641f63c6..7d9e485a 100644 --- a/tests/component/deb/test_push.py +++ b/tests/component/deb/test_push.py @@ -16,6 +16,7 @@ # along with this program; if not, please see # <http://www.gnu.org/licenses/> +import os import subprocess from tests.component import ComponentTestBase @@ -107,3 +108,23 @@ class TestPush(ComponentTestBase): ['master', 'upstream'], tags=['debian/2.8-1', 'upstream/2.8']) self.assertEquals(repo.head, self.target.head) + + @RepoFixtures.quilt30() + def test_push_failure(self, repo): + """ + Check that in case of failure we push all other branches/tags + """ + # Create a broken tag so pushing to it fails: + tag = os.path.join(self.target.path, 'refs', 'tags', 'debian', '2.8-1') + os.mkdir(os.path.dirname(tag)) + with open(tag, 'w') as f: + f.write("broken_tag") + + repo.add_remote_repo('origin', self.target.path) + self.assertEquals(push(['argv0']), 1) + self._check_repo_state(self.target, 'master', + ['master', 'upstream'], + tags=['upstream/2.8']) + self.assertEquals(repo.head, self.target.head) + self._check_in_log('.*Error running git push: .*refs/tags/debian/2.8-1') + self._check_log(-1, ".*Failed to push some refs") |