Bug 979640 - Make build system error on missing test files; r=ted
authorGregory Szorc <gps@mozilla.com>
Tue, 04 Mar 2014 17:48:50 -0800
changeset 172126 5e693452204779866cdfd5a66741514f820c56ae
parent 172125 d2066176c6f8ea9820ebee578e02f5a75755a8b5
child 172127 c368136afb266ad6d4de7cdd0c31e76e320a16d0
push id26350
push userkwierso@gmail.com
push dateThu, 06 Mar 2014 02:20:45 +0000
treeherdermozilla-central@8122ffa9e1aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs979640, 872273
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 979640 - Make build system error on missing test files; r=ted Previously, the build system may silently missing test files defined in manifests. This patch makes missing test files a fatal error, detected when reading test manifests. The test_bug872273.html XBL test appeared to be orphaned in content/xbl/test. It has been reunited with its family. dom/tests/mochitest/notification referenced a single test file which was recently deleted. That manifest has been removed. Missing test files related to the Python unit tests for the build system have been added. (They are a bunch of empty files.)
accessible/tests/mochitest/hittest/a11y.ini
browser/components/sessionstore/test/browser.ini
browser/devtools/commandline/test/browser.ini
browser/devtools/sourceeditor/test/browser.ini
dom/encoding/test/unit/mochitest.ini
dom/imptests/html/mochitest.ini
dom/tests/mochitest/notification/chrome.ini
dom/tests/mochitest/notification/moz.build
dom/tests/mochitest/webcomponents/mochitest.ini
python/mozbuild/mozbuild/frontend/emitter.py
python/mozbuild/mozbuild/test/backend/data/test-manifests-duplicate-support-files/test_bar.js
python/mozbuild/mozbuild/test/backend/data/test-manifests-written/mochitest.js
python/mozbuild/mozbuild/test/frontend/data/test-manifest-missing-test-file/mochitest.ini
python/mozbuild/mozbuild/test/frontend/data/test-manifest-missing-test-file/moz.build
python/mozbuild/mozbuild/test/frontend/data/test-manifest-unmatched-generated/test_foo
python/mozbuild/mozbuild/test/frontend/test_emitter.py
--- a/accessible/tests/mochitest/hittest/a11y.ini
+++ b/accessible/tests/mochitest/hittest/a11y.ini
@@ -1,11 +1,13 @@
 [DEFAULT]
 support-files = zoom_tree.xul
 
 [test_browser.html]
-[text_canvas_hitregion.html]
-skip-if = os == "android" || appname == "b2g"
+[test_canvas_hitregion.html]
+# Disabled everywhere because of failures. It appears this test has
+# never executed since its inception.
+skip-if = true || (os == "android" || appname == "b2g")
 [test_general.html]
 [test_menu.xul]
 [test_zoom.html]
 [test_zoom_text.html]
 [test_zoom_tree.xul]
--- a/browser/components/sessionstore/test/browser.ini
+++ b/browser/components/sessionstore/test/browser.ini
@@ -81,17 +81,16 @@ support-files =
 [browser_upgrade_backup.js]
 [browser_windowRestore_perwindowpb.js]
 [browser_248970_b_perwindowpb.js]
 # Disabled because of leaks.
 # Re-enabling and rewriting this test is tracked in bug 936919.
 skip-if = true
 [browser_339445.js]
 [browser_345898.js]
-[browser_346337.js]
 [browser_350525.js]
 [browser_354894_perwindowpb.js]
 [browser_367052.js]
 [browser_393716.js]
 [browser_394759_basic.js]
 # Disabled for intermittent failures, bug 944372.
 skip-if = true
 [browser_394759_behavior.js]
--- a/browser/devtools/commandline/test/browser.ini
+++ b/browser/devtools/commandline/test/browser.ini
@@ -44,18 +44,20 @@ support-files =
 [browser_cmd_pref3.js]
 [browser_cmd_restart.js]
 [browser_cmd_screenshot.js]
 support-files =
   browser_cmd_screenshot.html
 [browser_cmd_settings.js]
 [browser_gcli_async.js]
 [browser_gcli_canon.js]
-[browser_gcli_cli.js]
-[browser_gcli_completion.js]
+[browser_gcli_cli1.js]
+[browser_gcli_cli2.js]
+[browser_gcli_completion1.js]
+[browser_gcli_completion2.js]
 [browser_gcli_date.js]
 skip-if = true # Disabled until TZ bug is fixed
 [browser_gcli_exec.js]
 [browser_gcli_fail.js]
 [browser_gcli_file.js]
 [browser_gcli_focus.js]
 [browser_gcli_history.js]
 [browser_gcli_incomplete.js]
--- a/browser/devtools/sourceeditor/test/browser.ini
+++ b/browser/devtools/sourceeditor/test/browser.ini
@@ -20,9 +20,8 @@ support-files =
 [browser_editor_history.js]
 [browser_editor_markers.js]
 [browser_editor_movelines.js]
 [browser_editor_addons.js]
 [browser_codemirror.js]
 [browser_css_autocompletion.js]
 [browser_css_statemachine.js]
 [browser_vimemacs.js]
-[browser_sourceeditor_initialization.js]
--- a/dom/encoding/test/unit/mochitest.ini
+++ b/dom/encoding/test/unit/mochitest.ini
@@ -2,9 +2,8 @@
 
 [test_big5.js]
 [test_euc-jp.js]
 [test_euc-kr.js]
 [test_gbk.js]
 [test_hz-gb-2312.js]
 [test_iso-2022-jp.js]
 [test_shift_jis.js]
-[test_singlebytes.js]
--- a/dom/imptests/html/mochitest.ini
+++ b/dom/imptests/html/mochitest.ini
@@ -167,67 +167,67 @@ support-files =
 [html/browsers/browsing-the-web/read-media/test_pageload-video.html]
 [html/browsers/the-window-object/named-access-on-the-window-object/test_window-null-names.html]
 [html/browsers/the-window-object/test_window-indexed-properties-strict.html]
 [html/browsers/the-window-object/test_window-indexed-properties.html]
 [html/browsers/the-window-object/test_window-named-properties.html]
 skip-if = true # bug 859075
 [html/browsers/the-window-object/test_window-properties.html]
 [html/browsers/the-window-object/test_window-prototype-chain.html]
-[html/dom/documents/dom-tree-accessors/document.getElementsByName/test_document.getElementsByName-case.html]
-[html/dom/documents/dom-tree-accessors/document.getElementsByName/test_document.getElementsByName-case.xhtml]
-[html/dom/documents/dom-tree-accessors/document.getElementsByName/test_document.getElementsByName-id.html]
-[html/dom/documents/dom-tree-accessors/document.getElementsByName/test_document.getElementsByName-id.xhtml]
-[html/dom/documents/dom-tree-accessors/document.getElementsByName/test_document.getElementsByName-namespace.html]
-[html/dom/documents/dom-tree-accessors/document.getElementsByName/test_document.getElementsByName-namespace.xhtml]
-[html/dom/documents/dom-tree-accessors/document.getElementsByName/test_document.getElementsByName-newelements.html]
-[html/dom/documents/dom-tree-accessors/document.getElementsByName/test_document.getElementsByName-newelements.xhtml]
-[html/dom/documents/dom-tree-accessors/document.getElementsByName/test_document.getElementsByName-null-undef.html]
-[html/dom/documents/dom-tree-accessors/document.getElementsByName/test_document.getElementsByName-null-undef.xhtml]
-[html/dom/documents/dom-tree-accessors/document.getElementsByName/test_document.getElementsByName-param.html]
-[html/dom/documents/dom-tree-accessors/document.getElementsByName/test_document.getElementsByName-param.xhtml]
-[html/dom/documents/dom-tree-accessors/document.getElementsByName/test_document.getElementsByName-same.html]
-[html/dom/documents/dom-tree-accessors/test_Document.getElementsByClassName-null-undef.html]
-[html/dom/documents/dom-tree-accessors/test_Element.getElementsByClassName-null-undef.html]
-[html/dom/documents/dom-tree-accessors/test_document.body-getter.html]
-[html/dom/documents/dom-tree-accessors/test_document.body-setter-01.html]
-[html/dom/documents/dom-tree-accessors/test_document.embeds-document.plugins-01.html]
-[html/dom/documents/dom-tree-accessors/test_document.getElementsByClassName-same.html]
-[html/dom/documents/dom-tree-accessors/test_document.head-01.html]
-[html/dom/documents/dom-tree-accessors/test_document.head-02.html]
-[html/dom/documents/dom-tree-accessors/test_document.images.html]
-[html/dom/documents/dom-tree-accessors/test_document.title-01.html]
-[html/dom/documents/dom-tree-accessors/test_document.title-02.xhtml]
-[html/dom/documents/dom-tree-accessors/test_document.title-03.html]
-[html/dom/documents/dom-tree-accessors/test_document.title-04.xhtml]
-[html/dom/documents/dom-tree-accessors/test_document.title-05.html]
-[html/dom/documents/dom-tree-accessors/test_document.title-06.html]
-[html/dom/documents/dom-tree-accessors/test_document.title-07.html]
-[html/dom/documents/dom-tree-accessors/test_nameditem-01.html]
-[html/dom/documents/dom-tree-accessors/test_nameditem-02.html]
-[html/dom/documents/dom-tree-accessors/test_nameditem-03.html]
-[html/dom/documents/dom-tree-accessors/test_nameditem-04.html]
-[html/dom/documents/dom-tree-accessors/test_nameditem-05.html]
-[html/dom/documents/dom-tree-accessors/test_nameditem-06.html]
+[html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-case.html]
+[html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-case.xhtml]
+[html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-id.html]
+[html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-id.xhtml]
+[html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-namespace.html]
+[html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-namespace.xhtml]
+[html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-newelements.html]
+[html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-newelements.xhtml]
+[html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-null-undef.html]
+[html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-null-undef.xhtml]
+[html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-param.html]
+[html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-param.xhtml]
+[html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-same.html]
+[html/dom/documents/dta/test_Document.getElementsByClassName-null-undef.html]
+[html/dom/documents/dta/test_Element.getElementsByClassName-null-undef.html]
+[html/dom/documents/dta/test_document.body-getter.html]
+[html/dom/documents/dta/test_document.body-setter-01.html]
+[html/dom/documents/dta/test_document.embeds-document.plugins-01.html]
+[html/dom/documents/dta/test_document.getElementsByClassName-same.html]
+[html/dom/documents/dta/test_document.head-01.html]
+[html/dom/documents/dta/test_document.head-02.html]
+[html/dom/documents/dta/test_document.images.html]
+[html/dom/documents/dta/test_document.title-01.html]
+[html/dom/documents/dta/test_document.title-02.xhtml]
+[html/dom/documents/dta/test_document.title-03.html]
+[html/dom/documents/dta/test_document.title-04.xhtml]
+[html/dom/documents/dta/test_document.title-05.html]
+[html/dom/documents/dta/test_document.title-06.html]
+[html/dom/documents/dta/test_document.title-07.html]
+[html/dom/documents/dta/test_nameditem-01.html]
+[html/dom/documents/dta/test_nameditem-02.html]
+[html/dom/documents/dta/test_nameditem-03.html]
+[html/dom/documents/dta/test_nameditem-04.html]
+[html/dom/documents/dta/test_nameditem-05.html]
+[html/dom/documents/dta/test_nameditem-06.html]
 [html/dom/elements/global-attributes/test_classlist-nonstring.html]
 [html/dom/elements/global-attributes/test_dataset-delete.html]
 [html/dom/elements/global-attributes/test_dataset-enumeration.html]
 [html/dom/elements/global-attributes/test_dataset-get.html]
 [html/dom/elements/global-attributes/test_dataset-prototype.html]
 [html/dom/elements/global-attributes/test_dataset-set.html]
 [html/dom/elements/global-attributes/test_dataset.html]
 [html/dom/elements/global-attributes/test_document-dir.html]
 [html/dom/elements/global-attributes/test_id-attribute.html]
 [html/dom/elements/global-attributes/test_id-name.html]
-[html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/test_document-color-01.html]
-[html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/test_document-color-02.html]
-[html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/test_document-color-03.html]
-[html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/test_document-color-04.html]
-[html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/test_heading-obsolete-attributes-01.html]
-[html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/test_script-IDL-event-htmlfor.html]
+[html/obsolete/implreq/oeaaa/test_document-color-01.html]
+[html/obsolete/implreq/oeaaa/test_document-color-02.html]
+[html/obsolete/implreq/oeaaa/test_document-color-03.html]
+[html/obsolete/implreq/oeaaa/test_document-color-04.html]
+[html/obsolete/implreq/oeaaa/test_heading-obsolete-attributes-01.html]
+[html/obsolete/implreq/oeaaa/test_script-IDL-event-htmlfor.html]
 [html/semantics/document-metadata/the-title-element/test_title.text-01.html]
 [html/semantics/document-metadata/the-title-element/test_title.text-02.xhtml]
 [html/semantics/document-metadata/the-title-element/test_title.text-03.html]
 [html/semantics/document-metadata/the-title-element/test_title.text-04.xhtml]
 [html/semantics/forms/the-form-element/test_form-elements-interfaces-01.html]
 [html/semantics/forms/the-form-element/test_form-elements-matches.html]
 [html/semantics/forms/the-form-element/test_form-elements-nameditem-01.html]
 [html/semantics/forms/the-form-element/test_form-elements-nameditem-02.html]
deleted file mode 100644
--- a/dom/tests/mochitest/notification/chrome.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[DEFAULT]
-
-[test_system_principal.xul]
--- a/dom/tests/mochitest/notification/moz.build
+++ b/dom/tests/mochitest/notification/moz.build
@@ -1,10 +1,7 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=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/.
 
 MOCHITEST_MANIFESTS += ['mochitest.ini']
-
-MOCHITEST_CHROME_MANIFESTS += ['chrome.ini']
-
--- a/dom/tests/mochitest/webcomponents/mochitest.ini
+++ b/dom/tests/mochitest/webcomponents/mochitest.ini
@@ -1,20 +1,20 @@
 [DEFAULT]
 support-files =
   inert_style.css
 
 [test_bug900724.html]
 [test_content_element.html]
 [test_nested_content_element.html]
-[test_dyanmic_content_element_matching.html]
+[test_dynamic_content_element_matching.html]
 [test_document_register.html]
 [test_document_register_base_queue.html]
 [test_document_register_lifecycle.html]
 [test_document_register_parser.html]
 [test_document_register_stack.html]
 [test_template.html]
-[test_shadow_root.html]
-[test_shadow_root_inert_element.html]
-[test_shadow_root_style.html]
-[test_shadow_root_style_multiple_shadow.html]
-[test_shadow_root_style_order.html]
+[test_shadowroot.html]
+[test_shadowroot_inert_element.html]
+[test_shadowroot_style.html]
+[test_shadowroot_style_multiple_shadow.html]
+[test_shadowroot_style_order.html]
 [test_style_fallback_content.html]
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -471,17 +471,26 @@ class TreeMetadataEmitter(LoggingMixin):
             obj = TestManifest(sandbox, path, m, flavor=flavor,
                 install_prefix=install_prefix,
                 relpath=mozpath.join(manifest_reldir, mozpath.basename(path)),
                 dupe_manifest='dupe-manifest' in defaults)
 
             filtered = m.tests
 
             if filter_inactive:
-                filtered = m.active_tests(disabled=False, **self.mozinfo)
+                # We return tests that don't exist because we want manifests
+                # defining tests that don't exist to result in error.
+                filtered = m.active_tests(exists=False, disabled=False,
+                    **self.mozinfo)
+
+                missing = [t['name'] for t in filtered if not os.path.exists(t['path'])]
+                if missing:
+                    raise SandboxValidationError('Test manifest (%s) lists '
+                        'test that does not exist: %s' % (
+                        path, ', '.join(missing)))
 
             out_dir = mozpath.join(install_prefix, manifest_reldir)
 
             # "head" and "tail" lists.
             # All manifests support support-files.
             #
             # Keep a set of already seen support file patterns, because
             # repeatedly processing the patterns from the default section
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-missing-test-file/mochitest.ini
@@ -0,0 +1,1 @@
+[test_missing.html]
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-missing-test-file/moz.build
@@ -0,0 +1,4 @@
+# Any copyright is dedicated to the Public Domain.
+# http://creativecommons.org/publicdomain/zero/1.0/
+
+MOCHITEST_MANIFESTS += ['mochitest.ini']
new file mode 100644
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -471,16 +471,24 @@ class TestEmitterBasic(unittest.TestCase
 
         o = objs[0]
 
         expected = mozpath.join(o.srcdir, 'support-file.txt')
         self.assertIn(expected, o.installs)
         self.assertEqual(o.installs[expected],
             ('testing/mochitest/tests/child/support-file.txt', False))
 
+    def test_test_manifest_missing_test_error(self):
+        """Missing test files should result in error."""
+        reader = self.reader('test-manifest-missing-test-file')
+
+        with self.assertRaisesRegexp(SandboxValidationError,
+            'lists test that does not exist: test_missing.html'):
+            self.read_topsrcdir(reader)
+
     def test_ipdl_sources(self):
         reader = self.reader('ipdl_sources')
         objs = self.read_topsrcdir(reader)
 
         ipdls = []
         for o in objs:
             if isinstance(o, IPDLFile):
                 ipdls.append('%s/%s' % (o.relativedir, o.basename))