mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-03 17:50:11 +02:00
fix intermittent test failure
For some reason, the parser stopped working intermittently, even though the format has been the same since aapt 23 or earlier. Then also, some of the test cases pointed to symlinks that were no longer generated, and one test app now has a blank versionName. Strange that this wasn't caught in the gitlab-ci runs. !484 FAIL: test_get_api_id_aapt (__main__.CommonTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "./common.TestCase", line 578, in testA_get_api_id_aapt self.assertEqual(versionName, vn) AssertionError: '0.1' != "0.1' platformBuildVersionName='4.3.1-1425645" - 0.1 + 0.1' platformBuildVersionName='4.3.1-1425645
This commit is contained in:
parent
cc1e10a37a
commit
98a2f70e38
@ -1995,12 +1995,12 @@ def is_apk_and_debuggable(apkfile):
|
||||
|
||||
|
||||
def get_apk_id_aapt(apkfile):
|
||||
"""Extrat identification information from APK using aapt.
|
||||
"""Extract identification information from APK using aapt.
|
||||
|
||||
:param apkfile: path to an APK file.
|
||||
:returns: triplet (appid, version code, version name)
|
||||
"""
|
||||
r = re.compile("^package: name='(?P<appid>.*)' versionCode='(?P<vercode>.*)' versionName='(?P<vername>.*)'.*")
|
||||
r = re.compile("^package: name='(?P<appid>.*)' versionCode='(?P<vercode>.*)' versionName='(?P<vername>.*?)'(?: platformBuildVersionName='.*')?")
|
||||
p = SdkToolsPopen(['aapt', 'dump', 'badging', apkfile], output=False)
|
||||
for line in p.output.splitlines():
|
||||
m = r.match(line)
|
||||
|
@ -543,8 +543,6 @@ class CommonTest(unittest.TestCase):
|
||||
|
||||
testcases = [
|
||||
('repo/obb.main.twoversions_1101613.apk', 'obb.main.twoversions', '1101613', '0.1'),
|
||||
('OBBMainPatchCurrent.apk', 'obb.mainpatch.current', '1619', '0.1'),
|
||||
('OBBMainTwoVersions.apk', 'obb.main.twoversions', '1101613', '0.1'),
|
||||
('org.bitbucket.tickytacky.mirrormirror_1.apk', 'org.bitbucket.tickytacky.mirrormirror', '1', '1.0'),
|
||||
('org.bitbucket.tickytacky.mirrormirror_2.apk', 'org.bitbucket.tickytacky.mirrormirror', '2', '1.0.1'),
|
||||
('org.bitbucket.tickytacky.mirrormirror_3.apk', 'org.bitbucket.tickytacky.mirrormirror', '3', '1.0.2'),
|
||||
@ -555,12 +553,11 @@ class CommonTest(unittest.TestCase):
|
||||
('urzip-badsig.apk', 'info.guardianproject.urzip', '100', '0.1'),
|
||||
('urzip-release.apk', 'info.guardianproject.urzip', '100', '0.1'),
|
||||
('urzip-release-unsigned.apk', 'info.guardianproject.urzip', '100', '0.1'),
|
||||
('urzip-πÇÇπÇÇ现代汉语通用字-български-عربي1234.apk', 'info.guardianproject.urzip', '100', '0.1'),
|
||||
('repo/com.politedroid_3.apk', 'com.politedroid', '3', '1.2'),
|
||||
('repo/com.politedroid_4.apk', 'com.politedroid', '4', '1.3'),
|
||||
('repo/com.politedroid_5.apk', 'com.politedroid', '5', '1.4'),
|
||||
('repo/com.politedroid_6.apk', 'com.politedroid', '6', '1.5'),
|
||||
('repo/duplicate.permisssions_9999999.apk', 'duplicate.permisssions', '9999999', '0.3-7-gb817ac8'),
|
||||
('repo/duplicate.permisssions_9999999.apk', 'duplicate.permisssions', '9999999', ''),
|
||||
('repo/info.zwanenburg.caffeinetile_4.apk', 'info.zwanenburg.caffeinetile', '4', '1.3'),
|
||||
('repo/obb.main.oldversion_1444412523.apk', 'obb.main.oldversion', '1444412523', '0.1'),
|
||||
('repo/obb.mainpatch.current_1619_another-release-key.apk', 'obb.mainpatch.current', '1619', '0.1'),
|
||||
|
Loading…
Reference in New Issue
Block a user