From b220a97ef56ea0ddfb51d18466afc2228d9ebcd1 Mon Sep 17 00:00:00 2001 From: Salil Mishra Date: Tue, 26 Mar 2024 07:11:30 +0000 Subject: [PATCH] Add support for downloading Firefox on Android (Fenix) builds (#632) --- .gitignore | 2 + README.md | 4 +- mozdownload/factory.py | 4 +- mozdownload/scraper.py | 109 +++++++++++------- mozdownload/treeherder.py | 4 - tests/daily_scraper/test_daily_scraper.py | 32 +++-- ...fenix-108.0b1.multi.android-arm64-v8a.apk} | 0 ...nix-108.0b1.multi.android-armeabi-v7a.apk} | 0 .../fenix-108.0b1.multi.android-x86.apk} | 0 .../fenix-108.0b1.multi.android-x86_64.apk} | 0 .../fenix-119.0.multi.android-arm64-v8a.apk} | 0 ...fenix-119.0.multi.android-armeabi-v7a.apk} | 0 .../fenix-119.0.multi.android-x86.apk | 0 .../fenix-119.0.multi.android-x86_64.apk | 0 .../fenix/releases/119.0b9/placeholder.txt | 0 .../fenix-120.0b9.multi.android-arm64-v8a.apk | 0 ...enix-120.0b9.multi.android-armeabi-v7a.apk | 0 .../fenix-120.0b9.multi.android-x86.apk | 0 .../fenix-120.0b9.multi.android-x86_64.apk | 0 .../fenix-120.1.0.multi.android-arm64-v8a.apk | 0 ...enix-120.1.0.multi.android-armeabi-v7a.apk | 0 .../fenix-120.1.0.multi.android-x86.apk | 0 .../fenix-120.1.0.multi.android-x86_64.apk | 0 .../fennec-46.0a2.multi.android-arm.txt | 2 - .../fennec-41.0a1.multi.android-arm.txt | 2 - .../fennec-47.0a1.multi.android-arm.txt | 2 - .../fennec-47.0a1.multi.android-arm.txt | 2 - .../fennec-47.0a1.multi.android-i386.txt | 2 - .../factory/test_missing_mandatory_options.py | 8 +- tests/release_scraper/test_release_scraper.py | 12 ++ .../test_release_scraper_latest.py | 24 ++++ tests/remote/manifest.ini | 2 +- tests/remote/test_fenix.py | 20 ++++ tests/remote/test_fennec.py | 35 ------ tests/treeherder/test_api.py | 2 +- 35 files changed, 147 insertions(+), 121 deletions(-) rename tests/data/{mobile/nightly/2015/06/2015-06-11-03-02-08-mozilla-central-android-api-11/fennec-41.0a1.multi.android-arm.apk => fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-arm64-v8a/fenix-108.0b1.multi.android-arm64-v8a.apk} (100%) rename tests/data/{mobile/nightly/2015/06/2015-06-12-00-40-06-mozilla-aurora-android-api-11/fennec-40.0a2.multi.android-arm.apk => fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-armeabi-v7a/fenix-108.0b1.multi.android-armeabi-v7a.apk} (100%) rename tests/data/{mobile/nightly/2016/02/2016-02-01-03-02-41-mozilla-central-android-api-15/fennec-47.0a1.multi.android-arm.apk => fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-x86/fenix-108.0b1.multi.android-x86.apk} (100%) rename tests/data/{mobile/nightly/2016/02/2016-02-01-03-02-41-mozilla-central-android-api-9/fennec-47.0a1.multi.android-arm.apk => fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-x86_64/fenix-108.0b1.multi.android-x86_64.apk} (100%) rename tests/data/{mobile/nightly/2016/02/2016-02-01-03-02-41-mozilla-central-android-x86/fennec-47.0a1.multi.android-i386.apk => fenix/releases/119.0/android/fenix-119.0-android-arm64-v8a/fenix-119.0.multi.android-arm64-v8a.apk} (100%) rename tests/data/{mobile/nightly/2016/02/2016-02-02-00-40-08-mozilla-aurora-android-api-15/fennec-46.0a2.multi.android-arm.apk => fenix/releases/119.0/android/fenix-119.0-android-armeabi-v7a/fenix-119.0.multi.android-armeabi-v7a.apk} (100%) create mode 100644 tests/data/fenix/releases/119.0/android/fenix-119.0-android-x86/fenix-119.0.multi.android-x86.apk create mode 100644 tests/data/fenix/releases/119.0/android/fenix-119.0-android-x86_64/fenix-119.0.multi.android-x86_64.apk create mode 100644 tests/data/fenix/releases/119.0b9/placeholder.txt create mode 100644 tests/data/fenix/releases/120.0b9/android/fenix-120.0b9-android-arm64-v8a/fenix-120.0b9.multi.android-arm64-v8a.apk create mode 100644 tests/data/fenix/releases/120.0b9/android/fenix-120.0b9-android-armeabi-v7a/fenix-120.0b9.multi.android-armeabi-v7a.apk create mode 100644 tests/data/fenix/releases/120.0b9/android/fenix-120.0b9-android-x86/fenix-120.0b9.multi.android-x86.apk create mode 100644 tests/data/fenix/releases/120.0b9/android/fenix-120.0b9-android-x86_64/fenix-120.0b9.multi.android-x86_64.apk create mode 100644 tests/data/fenix/releases/120.1.0/android/fenix-120.1.0-android-arm64-v8a/fenix-120.1.0.multi.android-arm64-v8a.apk create mode 100644 tests/data/fenix/releases/120.1.0/android/fenix-120.1.0-android-armeabi-v7a/fenix-120.1.0.multi.android-armeabi-v7a.apk create mode 100644 tests/data/fenix/releases/120.1.0/android/fenix-120.1.0-android-x86/fenix-120.1.0.multi.android-x86.apk create mode 100644 tests/data/fenix/releases/120.1.0/android/fenix-120.1.0-android-x86_64/fenix-120.1.0.multi.android-x86_64.apk delete mode 100644 tests/data/mobile/nightly/latest-mozilla-aurora-android-api-15/fennec-46.0a2.multi.android-arm.txt delete mode 100644 tests/data/mobile/nightly/latest-mozilla-central-android-api-11/fennec-41.0a1.multi.android-arm.txt delete mode 100644 tests/data/mobile/nightly/latest-mozilla-central-android-api-15/fennec-47.0a1.multi.android-arm.txt delete mode 100644 tests/data/mobile/nightly/latest-mozilla-central-android-api-9/fennec-47.0a1.multi.android-arm.txt delete mode 100644 tests/data/mobile/nightly/latest-mozilla-central-android-x86/fennec-47.0a1.multi.android-i386.txt create mode 100644 tests/remote/test_fenix.py delete mode 100644 tests/remote/test_fennec.py diff --git a/.gitignore b/.gitignore index a2aa60e..f4c984d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,7 @@ *.egg-info *.pyc .coverage +.pytest_cache/ +.vscode/ build dist diff --git a/README.md b/README.md index 5064bb1..774f818 100644 --- a/README.md +++ b/README.md @@ -111,8 +111,8 @@ All those scraper instances allow you to retrieve the url which is used to downl ```python from mozdownload import FactoryScraper scraper = FactoryScraper('daily') -print scraper.url -print scraper.filename +print(scraper.url) +print(scraper.filename) ``` To actually download the remote file the download() method has to be called: diff --git a/mozdownload/factory.py b/mozdownload/factory.py index 456f179..639197a 100644 --- a/mozdownload/factory.py +++ b/mozdownload/factory.py @@ -63,8 +63,8 @@ class FactoryScraper(scraper.Scraper): if scraper_type in ('try') and not kwargs.get('revision'): raise ValueError('The revision of the build has to be specified.') - if kwargs.get('application') == 'fennec' and scraper_type not in ('daily'): - error_msg = '%s build is not yet supported for fennec' % scraper_type + if kwargs.get('application') == 'fenix' and scraper_type not in ('daily', 'release'): + error_msg = '%s build is not yet supported for fenix' % scraper_type raise NotSupportedError(error_msg) if (kwargs.get('application') == 'devedition' diff --git a/mozdownload/scraper.py b/mozdownload/scraper.py index 4ddd992..a9ae5d2 100755 --- a/mozdownload/scraper.py +++ b/mozdownload/scraper.py @@ -24,32 +24,45 @@ from mozdownload.parser import DirectoryParser from mozdownload.timezones import PacificTimezone from mozdownload.utils import urljoin -APPLICATIONS = ('devedition', 'firefox', 'fennec', 'thunderbird') +APPLICATIONS = ('devedition', 'firefox', 'fenix', 'thunderbird') # Some applications contain all locales in a single build -APPLICATIONS_MULTI_LOCALE = ('fennec') +APPLICATIONS_MULTI_LOCALE = ('fenix') -# Used if the application is named differently than the subfolder on the server -APPLICATIONS_TO_FTP_DIRECTORY = {'fennec': 'mobile'} -# Used if the application is named differently then the binary on the server +# Used if the application is named differently than the binary on the server APPLICATIONS_TO_BINARY_NAME = {'devedition': 'firefox'} # Used when sorting versions APPLICATIONS_TO_VERSION_CLASS = {'devedition': 'DeveditionVersion', 'firefox': 'FirefoxVersion', - 'fennec': 'FennecVersion', + 'fenix': 'MobileVersion', 'thunderbird': 'ThunderbirdVersion'} +APPLICATION_BUILD_FILENAME = { + app: ( + '%(TIMESTAMP)s-%(BRANCH)s-%(NAME)s' if app != 'fenix' + else '%(TIMESTAMP)s-%(NAME)s' + ) + for app in APPLICATIONS +} + +APPLICATION_REGEX = { + app: ( + r'%(DATE)s-(\d+-)+%(BRANCH)s%(L10N)s%(PLATFORM)s$' if app != 'fenix' + else r'%(DATE)s-(\d+-){3}fenix-(\d+\.\d.\d)%(PLATFORM)s$' + ) + for app in APPLICATIONS +} + # Base URL for the path to all builds BASE_URL = 'https://archive.mozilla.org/pub/' # Chunk size when downloading a file CHUNK_SIZE = 16 * 1024 -DEFAULT_FILE_EXTENSIONS = {'android-api-9': 'apk', - 'android-api-11': 'apk', - 'android-api-15': 'apk', - 'android-api-16': 'apk', +DEFAULT_FILE_EXTENSIONS = {'android-arm64-v8a': 'apk', + 'android-armeabi-v7a': 'apk', 'android-x86': 'apk', + 'android-x86_64': 'apk', 'linux': 'tar.bz2', 'linux64': 'tar.bz2', 'mac': 'dmg', @@ -57,11 +70,10 @@ DEFAULT_FILE_EXTENSIONS = {'android-api-9': 'apk', 'win32': 'exe', 'win64': 'exe'} -PLATFORM_FRAGMENTS = {'android-api-9': r'android-arm', - 'android-api-11': r'android-arm', - 'android-api-15': r'android-arm', - 'android-api-16': r'android-arm', - 'android-x86': r'android-i386', +PLATFORM_FRAGMENTS = {'android-arm64-v8a': r'android-arm64-v8a', + 'android-armeabi-v7a': r'android-armeabi-v7a', + 'android-x86': r'android-x86', + 'android-x86_64': r'android-x86_64', 'linux': r'linux-i686', 'linux64': r'linux-x86_64', 'mac': r'mac', @@ -138,10 +150,7 @@ class Scraper(object): # build the base URL self.application = application - self.base_url = '%s/' % urljoin( - base_url, - APPLICATIONS_TO_FTP_DIRECTORY.get(self.application, self.application) - ) + self.base_url = '%s/' % urljoin(base_url, self.application) if extension: self.extension = extension @@ -377,10 +386,7 @@ class DailyScraper(Scraper): """Define additional build information.""" # Retrieve build by revision if self.revision: - th = treeherder.Treeherder( - APPLICATIONS_TO_FTP_DIRECTORY.get(self.application, self.application), - self.branch, - self.platform) + th = treeherder.Treeherder(self.application, self.branch, self.platform) builds = th.query_builds_by_revision( self.revision, job_type_name='L10n Nightly' if self.locale_build else 'Nightly') @@ -432,8 +438,23 @@ class DailyScraper(Scraper): def get_latest_build_date(self): """Return date of latest available nightly build.""" - if self.application not in ('fennec'): + if self.application not in ('fenix'): url = urljoin(self.base_url, 'nightly', 'latest-%s/' % self.branch) + elif self.application == 'fenix': + years = self._create_directory_parser(urljoin(self.base_url, 'nightly/')) + years.entries.sort() + months = self._create_directory_parser(urljoin(self.base_url, 'nightly', + years.entries[-1] + '/')) + months.entries.sort() + + url = urljoin(self.base_url, 'nightly', years.entries[-1], + months.entries[-1] + '/') + parser = self._create_directory_parser(url) + parser.entries = parser.filter(r'.*%s' % self.platform_regex) + parser.entries.sort() + + date = ''.join(parser.entries[-1].split('-')[:6]) + return datetime.strptime(date, '%Y%m%d%H%M%S') else: url = urljoin(self.base_url, 'nightly', 'latest-%s-%s/' % (self.branch, self.platform)) @@ -487,15 +508,13 @@ class DailyScraper(Scraper): self.logger.info('Retrieving list of builds from %s' % url) parser = self._create_directory_parser(url) - regex = r'%(DATE)s-(\d+-)+%(BRANCH)s%(L10N)s%(PLATFORM)s$' % { + regex = APPLICATION_REGEX[self.application] % { 'DATE': date.strftime('%Y-%m-%d'), 'BRANCH': self.branch, # ensure to select the correct subfolder for localized builds 'L10N': '(-l10n)?' if self.locale_build else '', - 'PLATFORM': '' if self.application not in ( - 'fennec') else '-' + self.platform + 'PLATFORM': '' if self.application not in ('fenix') else '-' + self.platform } - parser.entries = parser.filter(regex) parser.entries = parser.filter(self.is_build_dir) @@ -530,11 +549,10 @@ class DailyScraper(Scraper): """Return the regex for the binary.""" regex_base_name = (r'^%(BINARY_NAME)s(\s%(STUB_NEW)s\.%(LOCALE)s|' + r'-.*\.%(LOCALE)s\.%(PLATFORM)s)') - regex_suffix = {'android-api-9': r'\.%(EXT)s$', - 'android-api-11': r'\.%(EXT)s$', - 'android-api-15': r'\.%(EXT)s$', - 'android-api-16': r'\.%(EXT)s$', + regex_suffix = {'android-arm64-v8a': r'\.%(EXT)s$', + 'android-armeabi-v7a': r'\.%(EXT)s$', 'android-x86': r'\.%(EXT)s$', + 'android-x86_64': r'\.%(EXT)s$', 'linux': r'\.%(EXT)s$', 'linux64': r'\.%(EXT)s$', 'mac': r'\.%(EXT)s$', @@ -561,7 +579,7 @@ class DailyScraper(Scraper): # If it's not available use the build's date timestamp = self.date.strftime('%Y-%m-%d') - return '%(TIMESTAMP)s-%(BRANCH)s-%(NAME)s' % { + return APPLICATION_BUILD_FILENAME[self.application] % { 'TIMESTAMP': timestamp, 'BRANCH': self.branch, 'NAME': binary} @@ -640,10 +658,16 @@ class ReleaseScraper(Scraper): r'^%(BINARY_NAME)s(%(STUB_NEW)s|(?:\sSetup\s|-)%(STUB)s%(VERSION)s)\.%(EXT)s$', 'win64': r'^%(BINARY_NAME)s(%(STUB_NEW)s|(?:\sSetup\s|-)%(STUB)s%(VERSION)s)\.%(EXT)s$', + 'android-arm64-v8a': r'^%(BINARY_NAME)s-%(VERSION)s\.multi.%(PLATFORM)s\.%(EXT)s$', + 'android-armeabi-v7a': + r'^%(BINARY_NAME)s-%(VERSION)s\.multi.%(PLATFORM)s\.%(EXT)s$', + 'android-x86': r'^%(BINARY_NAME)s-%(VERSION)s\.multi.%(PLATFORM)s\.%(EXT)s$', + 'android-x86_64': r'^%(BINARY_NAME)s-%(VERSION)s\.multi.%(PLATFORM)s\.%(EXT)s$', } return regex[self.platform] % { 'BINARY_NAME': APPLICATIONS_TO_BINARY_NAME.get(self.application, self.application), 'EXT': self.extension, + 'PLATFORM': self.platform, 'STUB': 'Stub ' if self.is_stub_installer else '', 'STUB_NEW': ' Installer' if self.is_stub_installer else '', 'VERSION': self.version, @@ -652,7 +676,10 @@ class ReleaseScraper(Scraper): @property def path_regex(self): """Return the regex for the path to the build folder.""" - regex = r'releases/%(VERSION)s/%(PLATFORM)s/%(LOCALE)s/' + if self.application == "fenix": + regex = r'releases/%(VERSION)s/android/fenix-%(VERSION)s-%(PLATFORM)s/' + else: + regex = r'releases/%(VERSION)s/%(PLATFORM)s/%(LOCALE)s/' return regex % {'LOCALE': self.locale, 'PLATFORM': self.platform_regex, 'VERSION': self.version} @@ -689,8 +716,8 @@ class ReleaseScraper(Scraper): parser = self._create_directory_parser(url) if version: versions = parser.filter(latest_version_filter(version, self.application)) - from mozilla_version import gecko - MozVersion = getattr(gecko, APPLICATIONS_TO_VERSION_CLASS[self.application]) + import mozilla_version + MozVersion = getattr(mozilla_version, APPLICATIONS_TO_VERSION_CLASS[self.application]) versions.sort(key=MozVersion.parse) return [versions[-1]] else: @@ -795,10 +822,7 @@ class TinderboxScraper(Scraper): """Define additional build information.""" # Retrieve build by revision if self.revision: - th = treeherder.Treeherder( - APPLICATIONS_TO_FTP_DIRECTORY.get(self.application, self.application), - self.branch, - self.platform) + th = treeherder.Treeherder(self.application, self.branch, self.platform) builds = th.query_builds_by_revision( self.revision, job_type_name='Build', debug_build=self.debug_build) @@ -998,10 +1022,7 @@ class TryScraper(Scraper): def get_build_info(self): """Define additional build information.""" # Retrieve build by revision - th = treeherder.Treeherder( - APPLICATIONS_TO_FTP_DIRECTORY.get(self.application, self.application), - 'try', - self.platform) + th = treeherder.Treeherder(self.application, 'try', self.platform) builds = th.query_builds_by_revision( self.revision, job_type_name='Build', debug_build=self.debug_build) diff --git a/mozdownload/treeherder.py b/mozdownload/treeherder.py index 570c2f0..bee8b8e 100644 --- a/mozdownload/treeherder.py +++ b/mozdownload/treeherder.py @@ -13,10 +13,6 @@ from thclient import TreeherderClient from mozdownload.errors import NotSupportedError PLATFORM_MAP = { - 'android-api-9': {'build_platform': 'android-2-3-armv7-api9'}, - 'android-api-11': {'build_platform': 'android-4-0-armv7-api11'}, - 'android-api-15': {'build_platform': 'android-4-0-armv7-api15'}, - 'android-x86': {'build_platform': 'android-4-2-x86'}, 'linux': {'build_platform': 'linux32'}, 'linux64': {'build_platform': 'linux64'}, 'mac': {'build_os': 'mac', 'build_architecture': 'x86_64'}, diff --git a/tests/daily_scraper/test_daily_scraper.py b/tests/daily_scraper/test_daily_scraper.py index 47549ee..72ff95b 100644 --- a/tests/daily_scraper/test_daily_scraper.py +++ b/tests/daily_scraper/test_daily_scraper.py @@ -109,26 +109,22 @@ thunderbird_tests = [ 'thunderbird/nightly/2013/10/2013-10-01-03-02-04-comm-aurora/thunderbird-27.0a1.en-US.win32.installer.exe'), ] -fennec_tests = [ - ({'application': 'fennec', 'platform': 'android-api-9', 'branch': 'mozilla-central'}, - '2016-02-01-03-02-41-mozilla-central-fennec-47.0a1.multi.android-arm.apk', - 'mobile/nightly/2016/02/2016-02-01-03-02-41-mozilla-central-android-api-9/fennec-47.0a1.multi.android-arm.apk'), - ({'application': 'fennec', 'platform': 'android-api-11', 'branch': 'mozilla-central'}, - '2015-06-11-03-02-08-mozilla-central-fennec-41.0a1.multi.android-arm.apk', - 'mobile/nightly/2015/06/2015-06-11-03-02-08-mozilla-central-android-api-11/fennec-41.0a1.multi.android-arm.apk'), - ({'application': 'fennec', 'platform': 'android-api-15', 'branch': 'mozilla-central'}, - '2016-02-01-03-02-41-mozilla-central-fennec-47.0a1.multi.android-arm.apk', - 'mobile/nightly/2016/02/2016-02-01-03-02-41-mozilla-central-android-api-15/fennec-47.0a1.multi.android-arm.apk'), - ({'application': 'fennec', 'platform': 'android-x86', 'branch': 'mozilla-central'}, - '2016-02-01-03-02-41-mozilla-central-fennec-47.0a1.multi.android-i386.apk', - 'mobile/nightly/2016/02/2016-02-01-03-02-41-mozilla-central-android-x86/fennec-47.0a1.multi.android-i386.apk'), - ({'application': 'fennec', 'platform': 'android-api-15', 'branch': 'mozilla-aurora'}, - '2016-02-02-00-40-08-mozilla-aurora-fennec-46.0a2.multi.android-arm.apk', - 'mobile/nightly/2016/02/2016-02-02-00-40-08-mozilla-aurora-android-api-15/fennec-46.0a2.multi.android-arm.apk'), +fenix_tests = [ + ({'application': 'fenix', 'platform': 'android-arm64-v8a', 'date': '2022-11-14'}, + '2022-11-14-17-01-36-fenix-108.0b1.multi.android-arm64-v8a.apk', + 'fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-arm64-v8a/fenix-108.0b1.multi.android-arm64-v8a.apk'), + ({'application': 'fenix', 'platform': 'android-x86', 'date': '2022-11-14'}, + '2022-11-14-17-01-36-fenix-108.0b1.multi.android-x86.apk', + 'fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-x86/fenix-108.0b1.multi.android-x86.apk'), + ({'application': 'fenix', 'platform': 'android-armeabi-v7a', 'date': '2022-11-14'}, + '2022-11-14-17-01-36-fenix-108.0b1.multi.android-armeabi-v7a.apk', + 'fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-armeabi-v7a/fenix-108.0b1.multi.android-armeabi-v7a.apk'), + ({'application': 'fenix', 'platform': 'android-x86_64', 'date': '2022-11-14'}, + '2022-11-14-17-01-36-fenix-108.0b1.multi.android-x86_64.apk', + 'fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-x86_64/fenix-108.0b1.multi.android-x86_64.apk'), ] - -@pytest.mark.parametrize("args,filename,url", firefox_tests + thunderbird_tests + fennec_tests) +@pytest.mark.parametrize("args,filename,url", firefox_tests + thunderbird_tests + fenix_tests) def test_scraper(httpd, tmpdir, args, filename, url): """Testing various download scenarios for DailyScraper""" diff --git a/tests/data/mobile/nightly/2015/06/2015-06-11-03-02-08-mozilla-central-android-api-11/fennec-41.0a1.multi.android-arm.apk b/tests/data/fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-arm64-v8a/fenix-108.0b1.multi.android-arm64-v8a.apk similarity index 100% rename from tests/data/mobile/nightly/2015/06/2015-06-11-03-02-08-mozilla-central-android-api-11/fennec-41.0a1.multi.android-arm.apk rename to tests/data/fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-arm64-v8a/fenix-108.0b1.multi.android-arm64-v8a.apk diff --git a/tests/data/mobile/nightly/2015/06/2015-06-12-00-40-06-mozilla-aurora-android-api-11/fennec-40.0a2.multi.android-arm.apk b/tests/data/fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-armeabi-v7a/fenix-108.0b1.multi.android-armeabi-v7a.apk similarity index 100% rename from tests/data/mobile/nightly/2015/06/2015-06-12-00-40-06-mozilla-aurora-android-api-11/fennec-40.0a2.multi.android-arm.apk rename to tests/data/fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-armeabi-v7a/fenix-108.0b1.multi.android-armeabi-v7a.apk diff --git a/tests/data/mobile/nightly/2016/02/2016-02-01-03-02-41-mozilla-central-android-api-15/fennec-47.0a1.multi.android-arm.apk b/tests/data/fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-x86/fenix-108.0b1.multi.android-x86.apk similarity index 100% rename from tests/data/mobile/nightly/2016/02/2016-02-01-03-02-41-mozilla-central-android-api-15/fennec-47.0a1.multi.android-arm.apk rename to tests/data/fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-x86/fenix-108.0b1.multi.android-x86.apk diff --git a/tests/data/mobile/nightly/2016/02/2016-02-01-03-02-41-mozilla-central-android-api-9/fennec-47.0a1.multi.android-arm.apk b/tests/data/fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-x86_64/fenix-108.0b1.multi.android-x86_64.apk similarity index 100% rename from tests/data/mobile/nightly/2016/02/2016-02-01-03-02-41-mozilla-central-android-api-9/fennec-47.0a1.multi.android-arm.apk rename to tests/data/fenix/nightly/2022/11/2022-11-14-17-01-36-fenix-108.0b1-android-x86_64/fenix-108.0b1.multi.android-x86_64.apk diff --git a/tests/data/mobile/nightly/2016/02/2016-02-01-03-02-41-mozilla-central-android-x86/fennec-47.0a1.multi.android-i386.apk b/tests/data/fenix/releases/119.0/android/fenix-119.0-android-arm64-v8a/fenix-119.0.multi.android-arm64-v8a.apk similarity index 100% rename from tests/data/mobile/nightly/2016/02/2016-02-01-03-02-41-mozilla-central-android-x86/fennec-47.0a1.multi.android-i386.apk rename to tests/data/fenix/releases/119.0/android/fenix-119.0-android-arm64-v8a/fenix-119.0.multi.android-arm64-v8a.apk diff --git a/tests/data/mobile/nightly/2016/02/2016-02-02-00-40-08-mozilla-aurora-android-api-15/fennec-46.0a2.multi.android-arm.apk b/tests/data/fenix/releases/119.0/android/fenix-119.0-android-armeabi-v7a/fenix-119.0.multi.android-armeabi-v7a.apk similarity index 100% rename from tests/data/mobile/nightly/2016/02/2016-02-02-00-40-08-mozilla-aurora-android-api-15/fennec-46.0a2.multi.android-arm.apk rename to tests/data/fenix/releases/119.0/android/fenix-119.0-android-armeabi-v7a/fenix-119.0.multi.android-armeabi-v7a.apk diff --git a/tests/data/fenix/releases/119.0/android/fenix-119.0-android-x86/fenix-119.0.multi.android-x86.apk b/tests/data/fenix/releases/119.0/android/fenix-119.0-android-x86/fenix-119.0.multi.android-x86.apk new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/fenix/releases/119.0/android/fenix-119.0-android-x86_64/fenix-119.0.multi.android-x86_64.apk b/tests/data/fenix/releases/119.0/android/fenix-119.0-android-x86_64/fenix-119.0.multi.android-x86_64.apk new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/fenix/releases/119.0b9/placeholder.txt b/tests/data/fenix/releases/119.0b9/placeholder.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/fenix/releases/120.0b9/android/fenix-120.0b9-android-arm64-v8a/fenix-120.0b9.multi.android-arm64-v8a.apk b/tests/data/fenix/releases/120.0b9/android/fenix-120.0b9-android-arm64-v8a/fenix-120.0b9.multi.android-arm64-v8a.apk new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/fenix/releases/120.0b9/android/fenix-120.0b9-android-armeabi-v7a/fenix-120.0b9.multi.android-armeabi-v7a.apk b/tests/data/fenix/releases/120.0b9/android/fenix-120.0b9-android-armeabi-v7a/fenix-120.0b9.multi.android-armeabi-v7a.apk new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/fenix/releases/120.0b9/android/fenix-120.0b9-android-x86/fenix-120.0b9.multi.android-x86.apk b/tests/data/fenix/releases/120.0b9/android/fenix-120.0b9-android-x86/fenix-120.0b9.multi.android-x86.apk new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/fenix/releases/120.0b9/android/fenix-120.0b9-android-x86_64/fenix-120.0b9.multi.android-x86_64.apk b/tests/data/fenix/releases/120.0b9/android/fenix-120.0b9-android-x86_64/fenix-120.0b9.multi.android-x86_64.apk new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/fenix/releases/120.1.0/android/fenix-120.1.0-android-arm64-v8a/fenix-120.1.0.multi.android-arm64-v8a.apk b/tests/data/fenix/releases/120.1.0/android/fenix-120.1.0-android-arm64-v8a/fenix-120.1.0.multi.android-arm64-v8a.apk new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/fenix/releases/120.1.0/android/fenix-120.1.0-android-armeabi-v7a/fenix-120.1.0.multi.android-armeabi-v7a.apk b/tests/data/fenix/releases/120.1.0/android/fenix-120.1.0-android-armeabi-v7a/fenix-120.1.0.multi.android-armeabi-v7a.apk new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/fenix/releases/120.1.0/android/fenix-120.1.0-android-x86/fenix-120.1.0.multi.android-x86.apk b/tests/data/fenix/releases/120.1.0/android/fenix-120.1.0-android-x86/fenix-120.1.0.multi.android-x86.apk new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/fenix/releases/120.1.0/android/fenix-120.1.0-android-x86_64/fenix-120.1.0.multi.android-x86_64.apk b/tests/data/fenix/releases/120.1.0/android/fenix-120.1.0-android-x86_64/fenix-120.1.0.multi.android-x86_64.apk new file mode 100644 index 0000000..e69de29 diff --git a/tests/data/mobile/nightly/latest-mozilla-aurora-android-api-15/fennec-46.0a2.multi.android-arm.txt b/tests/data/mobile/nightly/latest-mozilla-aurora-android-api-15/fennec-46.0a2.multi.android-arm.txt deleted file mode 100644 index 4a16e3c..0000000 --- a/tests/data/mobile/nightly/latest-mozilla-aurora-android-api-15/fennec-46.0a2.multi.android-arm.txt +++ /dev/null @@ -1,2 +0,0 @@ -20160202004008 -https://hg.mozilla.org/releases/mozilla-aurora/rev/980fea2f7011680074bf2f0941ee7e5d0eb3c4a3 diff --git a/tests/data/mobile/nightly/latest-mozilla-central-android-api-11/fennec-41.0a1.multi.android-arm.txt b/tests/data/mobile/nightly/latest-mozilla-central-android-api-11/fennec-41.0a1.multi.android-arm.txt deleted file mode 100644 index 926ea99..0000000 --- a/tests/data/mobile/nightly/latest-mozilla-central-android-api-11/fennec-41.0a1.multi.android-arm.txt +++ /dev/null @@ -1,2 +0,0 @@ -20150611030208 -https://hg.mozilla.org/mozilla-central/rev/bfd82015df48 diff --git a/tests/data/mobile/nightly/latest-mozilla-central-android-api-15/fennec-47.0a1.multi.android-arm.txt b/tests/data/mobile/nightly/latest-mozilla-central-android-api-15/fennec-47.0a1.multi.android-arm.txt deleted file mode 100644 index 12e40bf..0000000 --- a/tests/data/mobile/nightly/latest-mozilla-central-android-api-15/fennec-47.0a1.multi.android-arm.txt +++ /dev/null @@ -1,2 +0,0 @@ -20160201030241 -https://hg.mozilla.org/mozilla-central/rev/941033a51983ddec2d99aa9f868a54c0196a4075 diff --git a/tests/data/mobile/nightly/latest-mozilla-central-android-api-9/fennec-47.0a1.multi.android-arm.txt b/tests/data/mobile/nightly/latest-mozilla-central-android-api-9/fennec-47.0a1.multi.android-arm.txt deleted file mode 100644 index 12e40bf..0000000 --- a/tests/data/mobile/nightly/latest-mozilla-central-android-api-9/fennec-47.0a1.multi.android-arm.txt +++ /dev/null @@ -1,2 +0,0 @@ -20160201030241 -https://hg.mozilla.org/mozilla-central/rev/941033a51983ddec2d99aa9f868a54c0196a4075 diff --git a/tests/data/mobile/nightly/latest-mozilla-central-android-x86/fennec-47.0a1.multi.android-i386.txt b/tests/data/mobile/nightly/latest-mozilla-central-android-x86/fennec-47.0a1.multi.android-i386.txt deleted file mode 100644 index 12e40bf..0000000 --- a/tests/data/mobile/nightly/latest-mozilla-central-android-x86/fennec-47.0a1.multi.android-i386.txt +++ /dev/null @@ -1,2 +0,0 @@ -20160201030241 -https://hg.mozilla.org/mozilla-central/rev/941033a51983ddec2d99aa9f868a54c0196a4075 diff --git a/tests/factory/test_missing_mandatory_options.py b/tests/factory/test_missing_mandatory_options.py index 4821fb2..7f68667 100644 --- a/tests/factory/test_missing_mandatory_options.py +++ b/tests/factory/test_missing_mandatory_options.py @@ -22,14 +22,14 @@ def test_try_without_revision(httpd, tmpdir): FactoryScraper('try', destination=str(tmpdir), base_url=httpd.get_url()) -def test_non_daily_fennec(httpd, tmpdir): - """Test that non-daily scraper_type for fennec raises exception""" +def test_non_daily_fenix(httpd, tmpdir): + """Test that non-daily scraper_type for fenix raises exception""" with pytest.raises(NotSupportedError): FactoryScraper('candidate', destination=str(tmpdir), base_url=httpd.get_url(), - application='fennec', - version='60.0b1') + application='fenix', + version='110.0b1') def test_non_release_non_candidate_devedition(httpd, tmpdir): diff --git a/tests/release_scraper/test_release_scraper.py b/tests/release_scraper/test_release_scraper.py index 1acfb9e..d6ed861 100644 --- a/tests/release_scraper/test_release_scraper.py +++ b/tests/release_scraper/test_release_scraper.py @@ -14,6 +14,18 @@ from mozdownload.utils import urljoin @pytest.mark.parametrize("args,filename,url", [ + ({'application': 'fenix', 'platform': 'android-arm64-v8a', 'version': '120.1.0'}, + 'fenix-120.1.0.multi.android-arm64-v8a.apk', + 'fenix/releases/120.1.0/android/fenix-120.1.0-android-arm64-v8a/fenix-120.1.0.multi.android-arm64-v8a.apk'), + ({'application': 'fenix', 'platform': 'android-armeabi-v7a', 'version': '120.1.0'}, + 'fenix-120.1.0.multi.android-armeabi-v7a.apk', + 'fenix/releases/120.1.0/android/fenix-120.1.0-android-armeabi-v7a/fenix-120.1.0.multi.android-armeabi-v7a.apk'), + ({'application': 'fenix', 'platform': 'android-x86', 'version': '120.1.0'}, + 'fenix-120.1.0.multi.android-x86.apk', + 'fenix/releases/120.1.0/android/fenix-120.1.0-android-x86/fenix-120.1.0.multi.android-x86.apk'), + ({'application': 'fenix', 'platform': 'android-x86_64', 'version': '120.1.0'}, + 'fenix-120.1.0.multi.android-x86_64.apk', + 'fenix/releases/120.1.0/android/fenix-120.1.0-android-x86_64/fenix-120.1.0.multi.android-x86_64.apk'), ({'platform': 'win32', 'version': '23.0.1'}, 'firefox-23.0.1.en-US.win32.exe', 'firefox/releases/23.0.1/win32/en-US/Firefox Setup 23.0.1.exe'), diff --git a/tests/release_scraper/test_release_scraper_latest.py b/tests/release_scraper/test_release_scraper_latest.py index 254fc93..6641999 100644 --- a/tests/release_scraper/test_release_scraper_latest.py +++ b/tests/release_scraper/test_release_scraper_latest.py @@ -14,6 +14,30 @@ from mozdownload.utils import urljoin @pytest.mark.parametrize("args,filename,url", [ + ({'application': 'fenix', 'platform': 'android-arm64-v8a', 'version': 'latest'}, + 'fenix-120.1.0.multi.android-arm64-v8a.apk', + 'fenix/releases/120.1.0/android/fenix-120.1.0-android-arm64-v8a/fenix-120.1.0.multi.android-arm64-v8a.apk'), + ({'application': 'fenix', 'platform': 'android-armeabi-v7a', 'version': 'latest'}, + 'fenix-120.1.0.multi.android-armeabi-v7a.apk', + 'fenix/releases/120.1.0/android/fenix-120.1.0-android-armeabi-v7a/fenix-120.1.0.multi.android-armeabi-v7a.apk'), + ({'application': 'fenix', 'platform': 'android-x86', 'version': 'latest'}, + 'fenix-120.1.0.multi.android-x86.apk', + 'fenix/releases/120.1.0/android/fenix-120.1.0-android-x86/fenix-120.1.0.multi.android-x86.apk'), + ({'application': 'fenix', 'platform': 'android-x86_64', 'version': 'latest'}, + 'fenix-120.1.0.multi.android-x86_64.apk', + 'fenix/releases/120.1.0/android/fenix-120.1.0-android-x86_64/fenix-120.1.0.multi.android-x86_64.apk'), + ({'application': 'fenix', 'platform': 'android-arm64-v8a', 'version': 'latest-beta'}, + 'fenix-120.0b9.multi.android-arm64-v8a.apk', + 'fenix/releases/120.0b9/android/fenix-120.0b9-android-arm64-v8a/fenix-120.0b9.multi.android-arm64-v8a.apk'), + ({'application': 'fenix', 'platform': 'android-armeabi-v7a', 'version': 'latest-beta'}, + 'fenix-120.0b9.multi.android-armeabi-v7a.apk', + 'fenix/releases/120.0b9/android/fenix-120.0b9-android-armeabi-v7a/fenix-120.0b9.multi.android-armeabi-v7a.apk'), + ({'application': 'fenix', 'platform': 'android-x86', 'version': 'latest-beta'}, + 'fenix-120.0b9.multi.android-x86.apk', + 'fenix/releases/120.0b9/android/fenix-120.0b9-android-x86/fenix-120.0b9.multi.android-x86.apk'), + ({'application': 'fenix', 'platform': 'android-x86_64', 'version': 'latest-beta'}, + 'fenix-120.0b9.multi.android-x86_64.apk', + 'fenix/releases/120.0b9/android/fenix-120.0b9-android-x86_64/fenix-120.0b9.multi.android-x86_64.apk'), ({'application': 'firefox', 'platform': 'linux', 'version': 'latest'}, 'firefox-23.0.1.en-US.linux.tar.bz2', 'firefox/releases/23.0.1/linux-i686/en-US/firefox-23.0.1.tar.bz2'), diff --git a/tests/remote/manifest.ini b/tests/remote/manifest.ini index ac5a12c..9e5deb0 100644 --- a/tests/remote/manifest.ini +++ b/tests/remote/manifest.ini @@ -1,3 +1,3 @@ -[test_fennec.py] +[test_fenix.py] [test_firefox.py] [test_thunderbird.py] diff --git a/tests/remote/test_fenix.py b/tests/remote/test_fenix.py new file mode 100644 index 0000000..a11a965 --- /dev/null +++ b/tests/remote/test_fenix.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this file, +# You can obtain one at http://mozilla.org/MPL/2.0/. + +import pytest + +import mozdownload + + +@pytest.mark.ci_only +@pytest.mark.parametrize("args", [ + {'application': 'fenix', 'platform': 'android-arm64-v8a', 'date': '2022-11-14'}, + {'application': 'fenix', 'platform': 'android-armeabi-v7a'}, + {'application': 'fenix', 'platform': 'android-x86'}, + {'application': 'fenix', 'platform': 'android-x86_64'}, +]) +def test_daily_scraper(tmpdir, args): + mozdownload.DailyScraper(destination=tmpdir, **args) diff --git a/tests/remote/test_fennec.py b/tests/remote/test_fennec.py deleted file mode 100644 index 1b63a3a..0000000 --- a/tests/remote/test_fennec.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python - -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this file, -# You can obtain one at http://mozilla.org/MPL/2.0/. - -import pytest - -import mozdownload - - -@pytest.mark.ci_only -@pytest.mark.parametrize("args", [ - # Support for API level 9 ended on Mar 11th 2016 - {'application': 'fennec', 'platform': 'android-api-9', - 'branch': 'mozilla-central', 'date': '2016-03-11'}, - # Support for API level 11 ended on Jan 28th 2016 - {'application': 'fennec', 'platform': 'android-api-11', - 'branch': 'mozilla-central', 'date': '2016-01-28'}, - # Support for API level 15 ended on Aug 29th 2017 - {'application': 'fennec', 'platform': 'android-api-15', - 'branch': 'mozilla-central', 'date': '2017-08-29'}, - {'application': 'fennec', 'platform': 'android-api-16', 'branch': 'mozilla-central','date':'2019-05-16'}, - {'application': 'fennec', 'platform': 'android-x86', 'branch': 'mozilla-central','date':'2019-05-16'}, - {'application': 'fennec', 'platform': 'android-api-16', - 'branch': 'mozilla-central', 'date': '2017-08-30', 'build_number': 1}, - {'application': 'fennec', 'platform': 'android-api-16', - 'branch': 'mozilla-central', 'build_id': '20170830100224'}, - {'application': 'fennec', 'platform': 'android-api-16', - 'branch': 'mozilla-central', 'build_id': '20170830100224', 'locale': 'en-US'}, - {'application': 'fennec', 'platform': 'android-api-16', - 'branch': 'mozilla-central', 'build_id': '20170830100224', 'extension': 'txt'}, -]) -def test_daily_scraper(tmpdir, args): - mozdownload.DailyScraper(destination=tmpdir, **args) diff --git a/tests/treeherder/test_api.py b/tests/treeherder/test_api.py index 6f4ebfd..8b93820 100644 --- a/tests/treeherder/test_api.py +++ b/tests/treeherder/test_api.py @@ -61,7 +61,7 @@ def test_query_tinderbox_builds(httpd, platform): if platform == 'mac64': pytest.skip("mac64 is identical to mac") - application = 'firefox' if not platform.startswith('android') else 'mobile' + application = 'firefox' if not platform.startswith('android') else 'fenix' th = Treeherder(application, 'mozilla-beta', platform, server_url='http://{}:{}'.format(httpd.host, httpd.port)) builds = th.query_builds_by_revision('29258f59e545')