From dd337c330c2c06355e5656bbf374dad3263f10a2 Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Tue, 4 Mar 2014 17:48:50 -0800 Subject: [PATCH] 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.) --HG-- extra : amend_source : cb6b9bf91e57569c8be312d3c16fef69b2b0b950 --- accessible/tests/mochitest/hittest/a11y.ini | 6 +- .../components/sessionstore/test/browser.ini | 1 - browser/devtools/commandline/test/browser.ini | 6 +- .../devtools/sourceeditor/test/browser.ini | 1 - dom/encoding/test/unit/mochitest.ini | 1 - dom/imptests/html/mochitest.ini | 82 +++++++++---------- dom/tests/mochitest/notification/chrome.ini | 3 - dom/tests/mochitest/notification/moz.build | 3 - .../mochitest/webcomponents/mochitest.ini | 12 +-- python/mozbuild/mozbuild/frontend/emitter.py | 11 ++- .../test_bar.js | 0 .../data/test-manifests-written/mochitest.js | 0 .../mochitest.ini | 1 + .../test-manifest-missing-test-file/moz.build | 4 + .../test_foo | 0 .../mozbuild/test/frontend/test_emitter.py | 8 ++ 16 files changed, 78 insertions(+), 61 deletions(-) delete mode 100644 dom/tests/mochitest/notification/chrome.ini create mode 100644 python/mozbuild/mozbuild/test/backend/data/test-manifests-duplicate-support-files/test_bar.js create mode 100644 python/mozbuild/mozbuild/test/backend/data/test-manifests-written/mochitest.js create mode 100644 python/mozbuild/mozbuild/test/frontend/data/test-manifest-missing-test-file/mochitest.ini create mode 100644 python/mozbuild/mozbuild/test/frontend/data/test-manifest-missing-test-file/moz.build create mode 100644 python/mozbuild/mozbuild/test/frontend/data/test-manifest-unmatched-generated/test_foo diff --git a/accessible/tests/mochitest/hittest/a11y.ini b/accessible/tests/mochitest/hittest/a11y.ini index 78454c0ca9f3d7..9f7ad25e7522e5 100644 --- a/accessible/tests/mochitest/hittest/a11y.ini +++ b/accessible/tests/mochitest/hittest/a11y.ini @@ -2,8 +2,10 @@ 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] diff --git a/browser/components/sessionstore/test/browser.ini b/browser/components/sessionstore/test/browser.ini index a8c4652dca6f11..23ad9553a596c4 100644 --- a/browser/components/sessionstore/test/browser.ini +++ b/browser/components/sessionstore/test/browser.ini @@ -86,7 +86,6 @@ support-files = skip-if = true [browser_339445.js] [browser_345898.js] -[browser_346337.js] [browser_350525.js] [browser_354894_perwindowpb.js] [browser_367052.js] diff --git a/browser/devtools/commandline/test/browser.ini b/browser/devtools/commandline/test/browser.ini index a15d14382e3656..16340154af947f 100644 --- a/browser/devtools/commandline/test/browser.ini +++ b/browser/devtools/commandline/test/browser.ini @@ -49,8 +49,10 @@ support-files = [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] diff --git a/browser/devtools/sourceeditor/test/browser.ini b/browser/devtools/sourceeditor/test/browser.ini index f4579e9b4c7e5b..30a41e688aaf55 100644 --- a/browser/devtools/sourceeditor/test/browser.ini +++ b/browser/devtools/sourceeditor/test/browser.ini @@ -25,4 +25,3 @@ support-files = [browser_css_autocompletion.js] [browser_css_statemachine.js] [browser_vimemacs.js] -[browser_sourceeditor_initialization.js] diff --git a/dom/encoding/test/unit/mochitest.ini b/dom/encoding/test/unit/mochitest.ini index 36f432dd6d381b..1e2419f0adcb20 100644 --- a/dom/encoding/test/unit/mochitest.ini +++ b/dom/encoding/test/unit/mochitest.ini @@ -7,4 +7,3 @@ [test_hz-gb-2312.js] [test_iso-2022-jp.js] [test_shift_jis.js] -[test_singlebytes.js] diff --git a/dom/imptests/html/mochitest.ini b/dom/imptests/html/mochitest.ini index be5d1081d004c9..07e8a556cb0688 100644 --- a/dom/imptests/html/mochitest.ini +++ b/dom/imptests/html/mochitest.ini @@ -172,41 +172,41 @@ support-files = 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] @@ -217,12 +217,12 @@ skip-if = true # bug 859075 [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] diff --git a/dom/tests/mochitest/notification/chrome.ini b/dom/tests/mochitest/notification/chrome.ini deleted file mode 100644 index 33cefc38da2328..00000000000000 --- a/dom/tests/mochitest/notification/chrome.ini +++ /dev/null @@ -1,3 +0,0 @@ -[DEFAULT] - -[test_system_principal.xul] diff --git a/dom/tests/mochitest/notification/moz.build b/dom/tests/mochitest/notification/moz.build index 99b068bc92a055..8421b15157a7b9 100644 --- a/dom/tests/mochitest/notification/moz.build +++ b/dom/tests/mochitest/notification/moz.build @@ -5,6 +5,3 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. MOCHITEST_MANIFESTS += ['mochitest.ini'] - -MOCHITEST_CHROME_MANIFESTS += ['chrome.ini'] - diff --git a/dom/tests/mochitest/webcomponents/mochitest.ini b/dom/tests/mochitest/webcomponents/mochitest.ini index 21da68b779253c..c8c96693f4f41a 100644 --- a/dom/tests/mochitest/webcomponents/mochitest.ini +++ b/dom/tests/mochitest/webcomponents/mochitest.ini @@ -5,16 +5,16 @@ support-files = [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] diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py index 275d81cf69abd9..d243c96ccd37c3 100644 --- a/python/mozbuild/mozbuild/frontend/emitter.py +++ b/python/mozbuild/mozbuild/frontend/emitter.py @@ -476,7 +476,16 @@ def _process_test_manifest(self, sandbox, info, manifest_path): 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) diff --git a/python/mozbuild/mozbuild/test/backend/data/test-manifests-duplicate-support-files/test_bar.js b/python/mozbuild/mozbuild/test/backend/data/test-manifests-duplicate-support-files/test_bar.js new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/python/mozbuild/mozbuild/test/backend/data/test-manifests-written/mochitest.js b/python/mozbuild/mozbuild/test/backend/data/test-manifests-written/mochitest.js new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/python/mozbuild/mozbuild/test/frontend/data/test-manifest-missing-test-file/mochitest.ini b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-missing-test-file/mochitest.ini new file mode 100644 index 00000000000000..e3ef6216b7c634 --- /dev/null +++ b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-missing-test-file/mochitest.ini @@ -0,0 +1 @@ +[test_missing.html] diff --git a/python/mozbuild/mozbuild/test/frontend/data/test-manifest-missing-test-file/moz.build b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-missing-test-file/moz.build new file mode 100644 index 00000000000000..4e7e9ff4ebbd52 --- /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'] diff --git a/python/mozbuild/mozbuild/test/frontend/data/test-manifest-unmatched-generated/test_foo b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-unmatched-generated/test_foo new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/mozbuild/mozbuild/test/frontend/test_emitter.py index 0bf986964ae2c8..74ba366c7aa9d6 100644 --- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py +++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py @@ -476,6 +476,14 @@ def test_test_manifest_parent_support_files_dir(self): 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)