diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 79eb1d45..2b0ab577 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -285,9 +285,7 @@ black: - black --check --diff --color $CI_PROJECT_DIR fedora_latest: - image: fedora:latest - only: - - master@fdroid/fdroidserver + image: fedora:39 # support ends on 2024-11-12 script: # tricks to hopefully make runs more reliable - echo "timeout=600" >> /etc/dnf/dnf.conf diff --git a/tests/index.TestCase b/tests/index.TestCase index 2f137608..633c0e5f 100755 --- a/tests/index.TestCase +++ b/tests/index.TestCase @@ -701,8 +701,14 @@ class IndexTest(unittest.TestCase): app = apps[appid] metadata = index.package_metadata(app, 'repo') # files - self.assertEqual(36027, metadata['featureGraphic']['en-US']['size']) - self.assertEqual(1413, metadata['icon']['en-US']['size']) + self.assertEqual( + os.path.getsize(f'repo/{appid}/en-US/featureGraphic.png'), + metadata['featureGraphic']['en-US']['size'], + ) + self.assertEqual( + os.path.getsize(f'repo/{appid}/en-US/icon.png'), + metadata['icon']['en-US']['size'], + ) # localized strings self.assertEqual({'en-US': 'title'}, metadata['name']) self.assertEqual({'en-US': 'video'}, metadata['video']) diff --git a/tests/nightly.TestCase b/tests/nightly.TestCase index b6d47447..9e505c7f 100755 --- a/tests/nightly.TestCase +++ b/tests/nightly.TestCase @@ -70,7 +70,10 @@ class NightlyTest(unittest.TestCase): def tearDown(self): self.tempdir.cleanup() - os.rmdir(self.testroot) + try: + os.rmdir(self.testroot) + except OSError: # other test modules might have left stuff around + pass def _copy_test_debug_keystore(self): self.dot_android.mkdir() diff --git a/tests/testcommon.py b/tests/testcommon.py index fe3728ba..069ac42e 100644 --- a/tests/testcommon.py +++ b/tests/testcommon.py @@ -18,6 +18,9 @@ import os import sys import tempfile +import unittest + +from pathlib import Path class TmpCwd: @@ -60,3 +63,12 @@ def mkdtemp(): return tempfile.TemporaryDirectory() else: return tempfile.TemporaryDirectory(ignore_cleanup_errors=True) + + +def mkdir_testfiles(localmodule, test): + """Keep the test files in a labeled test dir for easy reference""" + testroot = Path(localmodule) / '.testfiles' + testroot.mkdir(exist_ok=True) + testdir = testroot / unittest.TestCase.id(test) + testdir.mkdir(exist_ok=True) + return tempfile.mkdtemp(dir=testdir)