Bug 1644228 - Remove support for IMPACTED_TESTS; r=remote-protocol-reviewers,firefox-build-system-reviewers,rstewart,whimboo

IMPACTED_TESTS was added in bug 1184405, but is under-utilized in current moz.build
annotations; also bug 1516847 removed use of IMPACTED_TESTS in 'mach test'. This
patch removes remaining support for IMPACTED_TESTS.

Differential Revision: https://phabricator.services.mozilla.com/D79141
This commit is contained in:
Geoff Brown 2020-06-12 08:04:08 +00:00
parent 6814c06aae
commit e1d05bdc1d
30 changed files with 0 additions and 199 deletions

View File

@ -104,13 +104,6 @@ class TestMozbuildReading(unittest.TestCase):
"'%s' corresponds to no files in the tree.\n"
"Please update this entry." %
(p, ctx.main_path))
test_files = ctx['IMPACTED_TESTS'].files
for p in test_files:
if not pattern_exists(os.path.relpath(p.full_path, config.topsrcdir)):
self.fail("The pattern '%s' in a dependent tests entry "
"in '%s' corresponds to no files in the tree.\n"
"Please update this entry." %
(p, ctx.main_path))
if __name__ == '__main__':

View File

@ -41,7 +41,6 @@ from mozbuild.util import (
from .. import schedules
from ..testing import (
all_test_flavors,
read_manifestparser_manifest,
read_reftest_manifest,
)
@ -1023,13 +1022,6 @@ def OrderedPathListWithAction(action):
ManifestparserManifestList = OrderedPathListWithAction(read_manifestparser_manifest)
ReftestManifestList = OrderedPathListWithAction(read_reftest_manifest)
OrderedSourceList = ContextDerivedTypedList(SourcePath, StrictOrderingOnAppendList)
OrderedTestFlavorList = TypedList(Enum(*all_test_flavors()),
StrictOrderingOnAppendList)
OrderedStringList = TypedList(six.text_type, StrictOrderingOnAppendList)
DependentTestsEntry = ContextDerivedTypedRecord(('files', OrderedSourceList),
('tags', OrderedStringList),
('flavors', OrderedTestFlavorList))
BugzillaComponent = TypedNamedTuple('BugzillaComponent',
[('product', six.text_type), ('component', six.text_type)])
SchedulingComponents = ContextDerivedTypedRecord(
@ -1112,54 +1104,6 @@ class Files(SubContext):
See :ref:`mozbuild_files_metadata_finalizing` for more info.
"""),
'IMPACTED_TESTS': (DependentTestsEntry, list,
"""File patterns, tags, and flavors for tests relevant to these files.
Maps source files to the tests potentially impacted by those files.
Tests can be specified by file pattern, tag, or flavor.
For example:
with Files('runtests.py'):
IMPACTED_TESTS.files += [
'**',
]
in testing/mochitest/moz.build will suggest that any of the tests
under testing/mochitest may be impacted by a change to runtests.py.
File patterns may be made relative to the topsrcdir with a leading
'/', so
with Files('httpd.js'):
IMPACTED_TESTS.files += [
'/testing/mochitest/tests/Harness_sanity/**',
]
in netwerk/test/httpserver/moz.build will suggest that any change to httpd.js
will be relevant to the mochitest sanity tests.
Tags and flavors are sorted string lists (flavors are limited to valid
values).
For example:
with Files('toolkit/devtools/*'):
IMPACTED_TESTS.tags += [
'devtools',
]
in the root moz.build would suggest that any test tagged 'devtools' would
potentially be impacted by a change to a file under toolkit/devtools, and
with Files('dom/base/nsGlobalWindow.cpp'):
IMPACTED_TESTS.flavors += [
'mochitest',
]
Would suggest that nsGlobalWindow.cpp is potentially relevant to
any plain mochitest.
"""),
'SCHEDULES': (Schedules, list,
"""Maps source files to the CI tasks that should be scheduled when
they change. The tasks are grouped by named components, and those
@ -1207,13 +1151,6 @@ class Files(SubContext):
self.test_flavors |= other.test_flavors
for k, v in other.items():
if k == 'IMPACTED_TESTS':
self.test_files |= set(mozpath.relpath(e.full_path, e.context.config.topsrcdir)
for e in v.files)
self.test_tags |= set(v.tags)
self.test_flavors |= set(v.flavors)
continue
if k == 'SCHEDULES' and 'SCHEDULES' in self:
self['SCHEDULES'] = self['SCHEDULES'] | v
continue

View File

@ -1,6 +0,0 @@
XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']
REFTEST_MANIFESTS += ['tests/reftests/reftest.list']
EXTRA_JS_MODULES += [
'module.js',
]

View File

@ -1,4 +0,0 @@
DIRS += [
'default',
'simple',
]

View File

@ -1,22 +0,0 @@
with Files('src/*'):
IMPACTED_TESTS.files += [
'tests/test_general.html',
]
with Files('src/module.jsm'):
IMPACTED_TESTS.files += [
'browser/**.js',
]
with Files('base.cpp'):
IMPACTED_TESTS.files += [
'/default/tests/xpcshell/test_default_mod.js',
'tests/*',
]
MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
BROWSER_CHROME_MANIFESTS += ['browser/browser.ini']
UNIFIED_SOURCES += ['base.cpp']
DIRS += ['src']

View File

@ -1,3 +0,0 @@
EXTRA_JS_MODULES += [
'module.jsm',
]

View File

@ -1,2 +0,0 @@
[test_general.html]
[test_specific.html]

View File

@ -1 +0,0 @@
MOCHITEST_MANIFESTS += ['mochitest.ini']

View File

@ -1,15 +0,0 @@
with Files('src/submodule/**'):
IMPACTED_TESTS.tags += [
'submodule',
]
with Files('src/bar.jsm'):
IMPACTED_TESTS.flavors += [
'browser-chrome',
]
IMPACTED_TESTS.files += [
'**.js',
]
MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell.ini']

View File

@ -1,3 +0,0 @@
[test_simple.html]
[test_specific.html]
tags = submodule

View File

@ -418,72 +418,6 @@ class TestBuildReader(unittest.TestCase):
self.assertEqual(v['bug_component/final/subcomponent/bar']['BUG_COMPONENT'],
BugzillaComponent('Another', 'Component'))
def test_file_test_deps(self):
reader = self.reader('files-test-metadata')
expected = {
'simple/src/module.jsm': set(['simple/tests/test_general.html',
'simple/browser/**.js']),
'simple/base.cpp': set(['simple/tests/*',
'default/tests/xpcshell/test_default_mod.js']),
}
v = reader.files_info([
'simple/src/module.jsm',
'simple/base.cpp',
])
for path, pattern_set in expected.items():
self.assertEqual(v[path].test_files,
expected[path])
def test_file_test_deps_default(self):
reader = self.reader('files-test-metadata')
v = reader.files_info([
'default/module.js',
])
expected = {
'default/module.js': set(['default/tests/xpcshell/**',
'default/tests/reftests/**']),
}
for path, pattern_set in expected.items():
self.assertEqual(v[path].test_files,
expected[path])
def test_file_test_deps_tags(self):
reader = self.reader('files-test-metadata')
v = reader.files_info([
'tagged/src/bar.jsm',
'tagged/src/submodule/foo.js',
])
expected_patterns = {
'tagged/src/submodule/foo.js': set([]),
'tagged/src/bar.jsm': set(['tagged/**.js']),
}
for path, pattern_set in expected_patterns.items():
self.assertEqual(v[path].test_files,
expected_patterns[path])
expected_tags = {
'tagged/src/submodule/foo.js': set(['submodule']),
'tagged/src/bar.jsm': set([]),
}
for path, pattern_set in expected_tags.items():
self.assertEqual(v[path].test_tags,
expected_tags[path])
expected_flavors = {
'tagged/src/bar.jsm': set(['browser-chrome']),
'tagged/src/submodule/foo.js': set([]),
}
for path, pattern_set in expected_flavors.items():
self.assertEqual(v[path].test_flavors,
expected_flavors[path])
def test_invalid_flavor(self):
reader = self.reader('invalid-files-flavor')

View File

@ -15,6 +15,3 @@ BROWSER_CHROME_MANIFESTS += [
"browser/security/browser.ini",
"browser/target/browser.ini",
]
with Files("puppeteer/test/**/*.spec.js"):
IMPACTED_TESTS.flavors += ["puppeteer"]