mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-05 18:50:09 +02:00
skip new signing test when we can't find apksigner
Also add some error handling to the find_apksigner() method.
This commit is contained in:
parent
f6b7572b10
commit
7eb32feaa5
@ -429,7 +429,11 @@ def find_apksigner():
|
|||||||
if set_command_in_config('apksigner'):
|
if set_command_in_config('apksigner'):
|
||||||
return config['apksigner']
|
return config['apksigner']
|
||||||
build_tools_path = os.path.join(config['sdk_path'], 'build-tools')
|
build_tools_path = os.path.join(config['sdk_path'], 'build-tools')
|
||||||
|
if not os.path.isdir(build_tools_path):
|
||||||
|
return None
|
||||||
for f in sorted(os.listdir(build_tools_path), reverse=True):
|
for f in sorted(os.listdir(build_tools_path), reverse=True):
|
||||||
|
if not os.path.isdir(os.path.join(build_tools_path, f)):
|
||||||
|
continue
|
||||||
if LooseVersion(f) < LooseVersion(MINIMUM_AAPT_BUILD_TOOLS_VERSION):
|
if LooseVersion(f) < LooseVersion(MINIMUM_AAPT_BUILD_TOOLS_VERSION):
|
||||||
return None
|
return None
|
||||||
if os.path.exists(os.path.join(build_tools_path, f, 'apksigner')):
|
if os.path.exists(os.path.join(build_tools_path, f, 'apksigner')):
|
||||||
|
@ -675,6 +675,8 @@ class CommonTest(unittest.TestCase):
|
|||||||
def test_sign_apk_targetsdk_30(self):
|
def test_sign_apk_targetsdk_30(self):
|
||||||
fdroidserver.common.config = None
|
fdroidserver.common.config = None
|
||||||
config = fdroidserver.common.read_config(fdroidserver.common.options)
|
config = fdroidserver.common.read_config(fdroidserver.common.options)
|
||||||
|
if not fdroidserver.common.find_apksigner():
|
||||||
|
self.skipTest('SKIPPING as apksigner is not installed!')
|
||||||
config['jarsigner'] = fdroidserver.common.find_sdk_tools_cmd('jarsigner')
|
config['jarsigner'] = fdroidserver.common.find_sdk_tools_cmd('jarsigner')
|
||||||
config['keyalias'] = 'sova'
|
config['keyalias'] = 'sova'
|
||||||
config['keystorepass'] = 'r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI='
|
config['keystorepass'] = 'r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI='
|
||||||
|
Loading…
Reference in New Issue
Block a user