mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 22:42:29 +03:00
Merge branch 'include-stages-in-update.json' into 'master'
update: include stages timing info in update.json See merge request fdroid/fdroidserver!1644
This commit is contained in:
commit
265adadaba
2 changed files with 5 additions and 6 deletions
|
@ -133,7 +133,7 @@ def disabled_algorithms_allowed():
|
||||||
or common.default_config['allow_disabled_algorithms'])
|
or common.default_config['allow_disabled_algorithms'])
|
||||||
|
|
||||||
|
|
||||||
def status_update_json(apps, apks):
|
def status_update_json(output, apps, apks):
|
||||||
"""Output a JSON file with metadata about this `fdroid update` run.
|
"""Output a JSON file with metadata about this `fdroid update` run.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
|
@ -145,7 +145,6 @@ def status_update_json(apps, apks):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
logging.debug(_('Outputting JSON'))
|
logging.debug(_('Outputting JSON'))
|
||||||
output = common.setup_status_output(start_timestamp)
|
|
||||||
output['antiFeatures'] = dict()
|
output['antiFeatures'] = dict()
|
||||||
output['disabled'] = []
|
output['disabled'] = []
|
||||||
output['archivePolicy0'] = []
|
output['archivePolicy0'] = []
|
||||||
|
@ -2801,7 +2800,7 @@ def main():
|
||||||
output_status_stage(status_output, 'make_binary_transparency_log')
|
output_status_stage(status_output, 'make_binary_transparency_log')
|
||||||
btlog.make_binary_transparency_log(repodirs)
|
btlog.make_binary_transparency_log(repodirs)
|
||||||
|
|
||||||
status_update_json(apps, apks + archapks)
|
status_update_json(status_output, apps, apks + archapks)
|
||||||
|
|
||||||
logging.info(_("Finished"))
|
logging.info(_("Finished"))
|
||||||
|
|
||||||
|
|
|
@ -1639,7 +1639,7 @@ class UpdateTest(unittest.TestCase):
|
||||||
with mkdtemp() as tmpdir:
|
with mkdtemp() as tmpdir:
|
||||||
os.chdir(tmpdir)
|
os.chdir(tmpdir)
|
||||||
with mock.patch('sys.argv', ['fdroid update', '']):
|
with mock.patch('sys.argv', ['fdroid update', '']):
|
||||||
fdroidserver.update.status_update_json([], [])
|
fdroidserver.update.status_update_json({}, [], [])
|
||||||
with open('repo/status/update.json') as fp:
|
with open('repo/status/update.json') as fp:
|
||||||
data = json.load(fp)
|
data = json.load(fp)
|
||||||
self.assertTrue('apksigner' in data)
|
self.assertTrue('apksigner' in data)
|
||||||
|
@ -1647,14 +1647,14 @@ class UpdateTest(unittest.TestCase):
|
||||||
fdroidserver.update.config = {
|
fdroidserver.update.config = {
|
||||||
'apksigner': 'apksigner',
|
'apksigner': 'apksigner',
|
||||||
}
|
}
|
||||||
fdroidserver.update.status_update_json([], [])
|
fdroidserver.update.status_update_json({}, [], [])
|
||||||
with open('repo/status/update.json') as fp:
|
with open('repo/status/update.json') as fp:
|
||||||
data = json.load(fp)
|
data = json.load(fp)
|
||||||
self.assertEqual(shutil.which(fdroidserver.update.config['apksigner']), data['apksigner'])
|
self.assertEqual(shutil.which(fdroidserver.update.config['apksigner']), data['apksigner'])
|
||||||
|
|
||||||
fdroidserver.update.config = {}
|
fdroidserver.update.config = {}
|
||||||
fdroidserver.common.fill_config_defaults(fdroidserver.update.config)
|
fdroidserver.common.fill_config_defaults(fdroidserver.update.config)
|
||||||
fdroidserver.update.status_update_json([], [])
|
fdroidserver.update.status_update_json({}, [], [])
|
||||||
with open('repo/status/update.json') as fp:
|
with open('repo/status/update.json') as fp:
|
||||||
data = json.load(fp)
|
data = json.load(fp)
|
||||||
self.assertEqual(fdroidserver.update.config.get('apksigner'), data['apksigner'])
|
self.assertEqual(fdroidserver.update.config.get('apksigner'), data['apksigner'])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue