aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2022-02-11 14:13:05 +0100
committerGuido Günther <agx@sigxcpu.org>2022-02-11 14:21:14 +0100
commit63ce4ed556815d0ff9650f1b70b8b11c8e313111 (patch)
treefdb8f81d21564c32df98b712851dee11cddd0e92
parentbb783b5357962e8857dfe63e4e3c22fc9429d395 (diff)
tests: Fix "test_push_failure" with newer git
The test created a broken tag on the remote side to avoid that being pushed in the test however git 2.34 and newer fail every push to that repo so rather create a non-ff branch instead to make the push fail.
-rw-r--r--tests/component/deb/test_push.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/component/deb/test_push.py b/tests/component/deb/test_push.py
index 0dd571cb..50733280 100644
--- a/tests/component/deb/test_push.py
+++ b/tests/component/deb/test_push.py
@@ -16,7 +16,6 @@
# along with this program; if not, please see
# <http://www.gnu.org/licenses/>
-import os
import subprocess
from tests.component import ComponentTestBase
@@ -136,17 +135,16 @@ class TestPush(ComponentTestBase):
"""
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)
+
+ # Make the upstream branch not fast forwardable so pushing to it fails
+ repo.push('origin', 'master')
+ self.target.create_branch('upstream', 'master')
+
self.assertEquals(push(['argv0']), 1)
self._check_repo_state(self.target, 'master',
['master', 'upstream'],
- tags=['upstream/2.8'])
+ tags=['debian/2.8-1', '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_in_log('.*Error running git push: To.*/target')
self._check_log(-1, ".*Failed to push some refs")