Skip to content

Commit 001ae3f

Browse files
committed
Bug 1239808 - Rename test_packages.json to include package basename as prefix. r=chmanchester, r=jlund
MozReview-Commit-ID: LxTr8Mo2P0i
1 parent 8470084 commit 001ae3f

File tree

4 files changed

+26
-29
lines changed

4 files changed

+26
-29
lines changed

build/gen_test_packages_manifest.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ def parse_args():
4545
parser.add_argument("--jsshell", required=True,
4646
action="store", dest="jsshell",
4747
help="Name of the jsshell zip.")
48-
parser.add_argument("--use-short-names", action="store_true",
49-
help="Use short names for packages (target.$name.tests.zip "
50-
"instead of $(PACKAGE_BASENAME).$name.tests.zip)")
5148
for harness in PACKAGE_SPECIFIED_HARNESSES:
5249
parser.add_argument("--%s" % harness, required=True,
5350
action="store", dest=harness,
@@ -61,6 +58,7 @@ def parse_args():
6158
help="Path to the output file to be written.")
6259
return parser.parse_args()
6360

61+
6462
def generate_package_data(args):
6563
# Generate a dictionary mapping test harness names (exactly as they're known to
6664
# mozharness and testsuite-targets.mk, ideally) to the set of archive names that
@@ -69,9 +67,6 @@ def generate_package_data(args):
6967
# which will be an optimization once parts of the main zip are split to harness
7068
# specific zips.
7169
tests_common = args.tests_common
72-
if args.use_short_names:
73-
tests_common = 'target.common.tests.zip'
74-
7570
jsshell = args.jsshell
7671

7772
harness_requirements = dict([(k, [tests_common]) for k in ALL_HARNESSES])
@@ -80,8 +75,6 @@ def generate_package_data(args):
8075
pkg_name = getattr(args, harness, None)
8176
if pkg_name is None:
8277
continue
83-
if args.use_short_names:
84-
pkg_name = 'target.%s.tests.zip' % harness
8578
harness_requirements[harness].append(pkg_name)
8679
return harness_requirements
8780

testing/mozharness/mozharness/mozilla/testing/testbase.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,34 @@ def query_build_dir_url(self, file_name):
164164

165165
return '%s/%s' % (base_url, file_name)
166166

167+
def query_prefixed_build_dir_url(self, suffix):
168+
"""Resolve a file name prefixed with platform and build details to a potential url
169+
in the build upload directory where that file can be found.
170+
"""
171+
if self.test_packages_url:
172+
reference_suffixes = ['.test_packages.json']
173+
reference_url = self.test_packages_url
174+
elif self.installer_url:
175+
reference_suffixes = INSTALLER_SUFFIXES
176+
reference_url = self.installer_url
177+
else:
178+
self.fatal("Can't figure out build directory urls without an installer_url "
179+
"or test_packages_url!")
180+
181+
url = None
182+
for reference_suffix in reference_suffixes:
183+
if reference_url.endswith(reference_suffix):
184+
url = reference_url[:-len(reference_suffix)] + suffix
185+
break
186+
187+
return url
188+
167189
def query_symbols_url(self):
168190
if self.symbols_url:
169191
return self.symbols_url
170192

171193
elif self.installer_url:
172-
symbols_url = None
173-
for suffix in INSTALLER_SUFFIXES:
174-
if self.installer_url.endswith(suffix):
175-
symbols_url = self.installer_url[:-len(suffix)] + '.crashreporter-symbols.zip'
176-
break
194+
symbols_url = self.query_prefixed_build_dir_url('.crashreporter-symbols.zip')
177195

178196
# Check if the URL exists. If not, use none to allow mozcrash to auto-check for symbols
179197
try:
@@ -536,7 +554,7 @@ def download_and_extract(self, target_unzip_dirs=None, suite_categories=None):
536554
# where the packages manifest is located. This is the case when the
537555
# test package manifest isn't set as a buildbot property, which is true
538556
# for some self-serve jobs and platforms using parse_make_upload.
539-
self.test_packages_url = self.query_build_dir_url('test_packages.json')
557+
self.test_packages_url = self.query_prefixed_build_dir_url('.test_packages.json')
540558

541559
suite_categories = suite_categories or ['common']
542560
self._download_test_packages(suite_categories, target_unzip_dirs)

testing/testsuite-targets.mk

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ stage-all: \
266266
stage-cppunittests \
267267
stage-luciddream \
268268
test-packages-manifest \
269-
test-packages-manifest-tc \
270269
$(NULL)
271270
ifdef MOZ_WEBRTC
272271
stage-all: stage-steeplechase
@@ -289,16 +288,6 @@ endif
289288

290289
PKG_ARG = --$(1) '$(PKG_BASENAME).$(1).tests.zip'
291290

292-
test-packages-manifest-tc:
293-
@rm -f $(MOZ_TEST_PACKAGES_FILE_TC)
294-
$(NSINSTALL) -D $(dir $(MOZ_TEST_PACKAGES_FILE_TC))
295-
$(PYTHON) $(topsrcdir)/build/gen_test_packages_manifest.py \
296-
--jsshell $(JSSHELL_NAME) \
297-
--dest-file $(MOZ_TEST_PACKAGES_FILE_TC) \
298-
--use-short-names \
299-
$(call PKG_ARG,common) \
300-
$(foreach pkg,$(TEST_PKGS),$(call PKG_ARG,$(pkg)))
301-
302291
test-packages-manifest:
303292
@rm -f $(MOZ_TEST_PACKAGES_FILE)
304293
$(NSINSTALL) -D $(dir $(MOZ_TEST_PACKAGES_FILE))
@@ -478,6 +467,4 @@ stage-extensions: make-stage-dir
478467
stage-instrumentation-tests \
479468
stage-luciddream \
480469
test-packages-manifest \
481-
test-packages-manifest-tc \
482470
$(NULL)
483-

toolkit/mozapps/installer/package-name.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ MOZ_SOURCESTAMP_FILE = $(DIST)/$(PKG_PATH)/$(MOZ_INFO_BASENAME).txt
156156
MOZ_BUILDINFO_FILE = $(DIST)/$(PKG_PATH)/$(MOZ_INFO_BASENAME).json
157157
MOZ_BUILDID_INFO_TXT_FILE = $(DIST)/$(PKG_PATH)/$(MOZ_INFO_BASENAME)_info.txt
158158
MOZ_MOZINFO_FILE = $(DIST)/$(PKG_PATH)/$(MOZ_INFO_BASENAME).mozinfo.json
159-
MOZ_TEST_PACKAGES_FILE = $(DIST)/$(PKG_PATH)/test_packages.json
160-
MOZ_TEST_PACKAGES_FILE_TC = $(DIST)/$(PKG_PATH)/test_packages_tc.json
159+
MOZ_TEST_PACKAGES_FILE = $(DIST)/$(PKG_PATH)/$(PKG_BASENAME).test_packages.json
161160

162161
# JavaScript Shell
163162
ifdef MOZ_SIMPLE_PACKAGE_NAME

0 commit comments

Comments
 (0)