mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-02 09:10:11 +02:00
update tests for fixed log deployment+changelog
This commit is contained in:
parent
d665106813
commit
7fa3c34e5b
@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|||||||
([!669](https://gitlab.com/fdroid/fdroidserver/merge_requests/669))
|
([!669](https://gitlab.com/fdroid/fdroidserver/merge_requests/669))
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
* fix build-logs dissapearing when deploying
|
||||||
|
([!685](https://gitlab.com/fdroid/fdroidserver/merge_requests/685))
|
||||||
* do not crash when system encoding can not be retrieved
|
* do not crash when system encoding can not be retrieved
|
||||||
([!671](https://gitlab.com/fdroid/fdroidserver/merge_requests/671))
|
([!671](https://gitlab.com/fdroid/fdroidserver/merge_requests/671))
|
||||||
* checkupdates: UpdateCheckIngore gets properly observed now
|
* checkupdates: UpdateCheckIngore gets properly observed now
|
||||||
|
@ -3253,6 +3253,9 @@ def deploy_build_log_with_rsync(appid, vercode, log_content):
|
|||||||
logging.warning(_('skip deploying full build logs: log content is empty'))
|
logging.warning(_('skip deploying full build logs: log content is empty'))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if not os.path.exists('repo'):
|
||||||
|
os.mkdir('repo')
|
||||||
|
|
||||||
# gzip compress log file
|
# gzip compress log file
|
||||||
log_gz_path = os.path.join('repo',
|
log_gz_path = os.path.join('repo',
|
||||||
'{pkg}_{ver}.log.gz'.format(pkg=appid,
|
'{pkg}_{ver}.log.gz'.format(pkg=appid,
|
||||||
|
@ -1008,8 +1008,14 @@ class CommonTest(unittest.TestCase):
|
|||||||
|
|
||||||
with mock.patch('subprocess.call',
|
with mock.patch('subprocess.call',
|
||||||
side_effect=assert_subprocess_call):
|
side_effect=assert_subprocess_call):
|
||||||
fdroidserver.common.deploy_build_log_with_rsync(
|
with tempfile.TemporaryDirectory() as tmpdir, TmpCwd(tmpdir):
|
||||||
'com.example.app', '4711', mocklogcontent)
|
fdroidserver.common.deploy_build_log_with_rsync(
|
||||||
|
'com.example.app', '4711', mocklogcontent)
|
||||||
|
|
||||||
|
expected_log_path = os.path.join(tmpdir, 'repo', 'com.example.app_4711.log.gz')
|
||||||
|
self.assertTrue(os.path.isfile(expected_log_path))
|
||||||
|
with gzip.open(expected_log_path, 'r') as f:
|
||||||
|
self.assertEqual(f.read(), mocklogcontent)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
Reference in New Issue
Block a user