From 5166a47acb7e7b433f8d86dee7d4dbb86210e42b Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 2 Sep 2021 15:20:34 -0400 Subject: tests: when generating git repositories, make sure that pgpsign is off I have a local configuration tag.forcesignannotated=true commit.gpgsign=true This causes the tests to fail with e.g. error: gpg failed to sign the data fatal: failed to write commit object Since this is a unittest, it is never wrong to tell git "just ignore prior configuration, and disable all PGP signing". --- unittests/allplatformstests.py | 2 +- unittests/subprojectscommandtests.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py index 66b8bf4..bf90bed 100644 --- a/unittests/allplatformstests.py +++ b/unittests/allplatformstests.py @@ -101,7 +101,7 @@ def _git_init(project_dir): def _git_add_all(project_dir): subprocess.check_call('git add *', cwd=project_dir, shell=True, stdout=subprocess.DEVNULL) - subprocess.check_call(['git', 'commit', '-a', '-m', 'I am a project'], cwd=project_dir, + subprocess.check_call(['git', 'commit', '--no-gpg-sign', '-a', '-m', 'I am a project'], cwd=project_dir, stdout=subprocess.DEVNULL) class AllPlatformTests(BasePlatformTests): diff --git a/unittests/subprojectscommandtests.py b/unittests/subprojectscommandtests.py index edb8da6..edd6ac1 100644 --- a/unittests/subprojectscommandtests.py +++ b/unittests/subprojectscommandtests.py @@ -83,7 +83,7 @@ class SubprojectsCommandTests(BasePlatformTests): self._git(['init'] + extra_cmd, path) self._git_config(path) self._git(['add', '.'], path) - self._git(['commit', '-m', 'Initial commit'], path) + self._git(['commit', '--no-gpg-sign', '-m', 'Initial commit'], path) def _git_create_remote_repo(self, name): self._git_create_repo(self.root_dir / name) @@ -93,15 +93,15 @@ class SubprojectsCommandTests(BasePlatformTests): def _git_create_remote_commit(self, name, branch): self._git_remote(['checkout', branch], name) - self._git_remote(['commit', '--allow-empty', '-m', f'initial {branch} commit'], name) + self._git_remote(['commit', '--no-gpg-sign', '--allow-empty', '-m', f'initial {branch} commit'], name) def _git_create_remote_branch(self, name, branch): self._git_remote(['checkout', '-b', branch], name) - self._git_remote(['commit', '--allow-empty', '-m', f'initial {branch} commit'], name) + self._git_remote(['commit', '--no-gpg-sign', '--allow-empty', '-m', f'initial {branch} commit'], name) def _git_create_remote_tag(self, name, tag): - self._git_remote(['commit', '--allow-empty', '-m', f'tag {tag} commit'], name) - self._git_remote(['tag', tag], name) + self._git_remote(['commit', '--no-gpg-sign', '--allow-empty', '-m', f'tag {tag} commit'], name) + self._git_remote(['tag', '--no-sign', tag], name) def _wrap_create_git(self, name, revision='master'): path = self.root_dir / name -- cgit v1.1