From 9c281970842b81319ba4d4378023156ad2438cdc Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Wed, 30 Sep 2015 17:38:53 -0700 Subject: [PATCH] Bug 1208320 - Produce common tests archive via Python; r=glandium This doesn't change I/O or copy behavior at all. But it does remove a one-off make rule. --- .../mozbuild/mozbuild/action/test_archive.py | 31 +++++++++++++++++++ testing/testsuite-targets.mk | 7 +---- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/python/mozbuild/mozbuild/action/test_archive.py b/python/mozbuild/mozbuild/action/test_archive.py index a5e180c96b4..70f00ecb9c3 100644 --- a/python/mozbuild/mozbuild/action/test_archive.py +++ b/python/mozbuild/mozbuild/action/test_archive.py @@ -11,6 +11,7 @@ from __future__ import absolute_import, print_function, unicode_literals import argparse +import itertools import os import sys @@ -24,6 +25,21 @@ STAGE = mozpath.join(buildconfig.topobjdir, 'dist', 'test-stage') ARCHIVE_FILES = { + 'common': [ + { + 'source': STAGE, + 'base': '', + 'pattern': '**', + 'ignore': [ + 'cppunittest/**', + 'mochitest/**', + 'reftest/**', + 'talos/**', + 'web-platform/**', + 'xpcshell/**', + ], + }, + ], 'mochitest': [ { 'source': buildconfig.topobjdir, @@ -79,6 +95,21 @@ ARCHIVE_FILES = { } +# "common" is our catch all archive and it ignores things from other archives. +# Verify nothing sneaks into ARCHIVE_FILES without a corresponding exclusion +# rule in the "common" archive. +for k, v in ARCHIVE_FILES.items(): + # Skip mozharness because it isn't staged. + if k in ('common', 'mozharness'): + continue + + ignores = set(itertools.chain(*(e.get('ignore', []) + for e in ARCHIVE_FILES['common']))) + + if not any(p.startswith('%s/' % k) for p in ignores): + raise Exception('"common" ignore list probably should contain %s' % k) + + def find_files(archive): for entry in ARCHIVE_FILES[archive]: source = entry['source'] diff --git a/testing/testsuite-targets.mk b/testing/testsuite-targets.mk index 664405590bb..a5c68d5f31e 100644 --- a/testing/testsuite-targets.mk +++ b/testing/testsuite-targets.mk @@ -398,6 +398,7 @@ TEST_PKGS := \ $(NULL) PYTHON_TEST_PKGS := \ + common \ mochitest \ talos \ web-platform \ @@ -437,12 +438,6 @@ package-tests-mozharness: package-tests-prepare-dest $(abspath $(DIST))/$(PKG_PATH)/mozharness.zip) package-tests: package-tests-mozharness -package-tests-common: stage-all package-tests-prepare-dest - cd $(abspath $(PKG_STAGE)) && \ - zip -rq9D '$(abspath $(DIST))/$(PKG_PATH)$(TEST_PACKAGE)' \ - * -x \*/.mkdir.done \*.pyc $(foreach name,$(ALL_TEST_PKGS),$(name)\*) -package-tests: package-tests-common - define package_archive package-tests-$(1): stage-all package-tests-prepare-dest rm -f '$$(DIST)/$$(PKG_PATH)$$(PKG_BASENAME).$(1).tests.zip' && \