diff --git a/devtools/server/tests/unit/xpcshell.ini b/devtools/server/tests/unit/xpcshell.ini index 49b8e4c67df9..3f8efab1b068 100644 --- a/devtools/server/tests/unit/xpcshell.ini +++ b/devtools/server/tests/unit/xpcshell.ini @@ -91,6 +91,7 @@ support-files = [test_promises_actor_attach.js] [test_promises_actor_exist.js] [test_promises_actor_list_promises.js] +skip-if = coverage # bug 1336670 [test_promises_actor_onnewpromise.js] [test_promises_actor_onpromisesettled.js] [test_promises_client_getdependentpromises.js] diff --git a/dom/indexedDB/test/unit/xpcshell-parent-process.ini b/dom/indexedDB/test/unit/xpcshell-parent-process.ini index f966837c617a..95d6f89d36f1 100644 --- a/dom/indexedDB/test/unit/xpcshell-parent-process.ini +++ b/dom/indexedDB/test/unit/xpcshell-parent-process.ini @@ -65,5 +65,8 @@ skip-if = true skip-if = os == "android" && processor == "x86" [test_view_put_get_values.js] [test_wasm_getAll.js] +skip-if = coverage # bug 1336727 [test_wasm_put_get_values.js] +skip-if = coverage # bug 1336727 [test_wasm_recompile.js] +skip-if = coverage # bug 1336727 diff --git a/security/manager/ssl/tests/unit/xpcshell-smartcards.ini b/security/manager/ssl/tests/unit/xpcshell-smartcards.ini index df099b7469d9..66f4d842642f 100644 --- a/security/manager/ssl/tests/unit/xpcshell-smartcards.ini +++ b/security/manager/ssl/tests/unit/xpcshell-smartcards.ini @@ -9,6 +9,7 @@ support-files = [test_pkcs11_module.js] [test_pkcs11_no_events_after_removal.js] [test_pkcs11_safe_mode.js] +skip-if = coverage # bug 1336728 [test_pkcs11_slot.js] [test_pkcs11_token.js] [test_pkcs11_tokenDB.js] diff --git a/taskcluster/ci/test/test-sets.yml b/taskcluster/ci/test/test-sets.yml index 99e929156db7..d6b48417130e 100644 --- a/taskcluster/ci/test/test-sets.yml +++ b/taskcluster/ci/test/test-sets.yml @@ -83,6 +83,7 @@ ccov-code-coverage-tests: jsdcov-code-coverage-tests: - mochitest-browser-chrome - mochitest-devtools-chrome + - xpcshell ## # Test sets still being greened up in various ways diff --git a/taskcluster/ci/test/tests.yml b/taskcluster/ci/test/tests.yml index d968e6c9fc47..1bb3ef02369b 100644 --- a/taskcluster/ci/test/tests.yml +++ b/taskcluster/ci/test/tests.yml @@ -1225,8 +1225,15 @@ web-platform-tests-wdspec: xpcshell: description: "xpcshell test run" - suite: xpcshell + suite: + by-test-platform: + linux64-jsdcov/opt: xpcshell-coverage + default: xpcshell treeherder-symbol: tc-X() + run-on-projects: + by-test-platform: + linux64-jsdcov/opt: [] + default: ['all'] chunks: by-test-platform: linux64/debug: 10 @@ -1270,4 +1277,8 @@ xpcshell: - unittests/linux_unittest.py - remove_executables.py extra-options: - - --xpcshell-suite=xpcshell + by-test-platform: + linux64-jsdcov/opt: + - --xpcshell-suite=xpcshell-coverage + default: + - --xpcshell-suite=xpcshell \ No newline at end of file diff --git a/testing/mozharness/configs/unittests/linux_unittest.py b/testing/mozharness/configs/unittests/linux_unittest.py index 304447ad8c07..1d88e652d19d 100644 --- a/testing/mozharness/configs/unittests/linux_unittest.py +++ b/testing/mozharness/configs/unittests/linux_unittest.py @@ -245,7 +245,8 @@ config = { }, "xpcshell-coverage": { "options": ["--xpcshell=%(abs_app_dir)s/" + XPCSHELL_NAME, - "--manifest=tests/xpcshell/tests/xpcshell.ini"], + "--manifest=tests/xpcshell/tests/xpcshell.ini", + "--sequential"], "tests": [] }, }, diff --git a/testing/xpcshell/head.js b/testing/xpcshell/head.js index 446807316c8d..3fc55036b742 100644 --- a/testing/xpcshell/head.js +++ b/testing/xpcshell/head.js @@ -552,9 +552,6 @@ function _execute_test() { // has already been logged so there is no need to log it again. It's // possible that this will mask an NS_ERROR_ABORT that happens after a // do_check failure though. - if (coverageCollector != null) { - coverageCollector.recordTestCoverage(_TEST_FILE[0]); - } if (!_quit || e != Components.results.NS_ERROR_ABORT) { let extra = {}; @@ -572,10 +569,10 @@ function _execute_test() { } _testLogger.error(message, extra); } - } - - if (coverageCollector != null) { - coverageCollector.finalize(); + } finally { + if (coverageCollector != null) { + coverageCollector.finalize(); + } } // Execute all of our cleanup functions. diff --git a/testing/xpcshell/runxpcshelltests.py b/testing/xpcshell/runxpcshelltests.py index 23155f3d5999..596a788c8192 100755 --- a/testing/xpcshell/runxpcshelltests.py +++ b/testing/xpcshell/runxpcshelltests.py @@ -1213,6 +1213,10 @@ class XPCShellTests(object): mozinfo.update(self.mozInfo) + # Add a flag to mozinfo to indicate that code coverage is enabled. + if self.jscovdir: + mozinfo.update({"coverage": True}) + self.stack_fixer_function = None if self.utility_path and os.path.exists(self.utility_path): self.stack_fixer_function = get_stack_fixer_function(self.utility_path, self.symbolsPath) diff --git a/toolkit/components/jsdownloads/test/unit/xpcshell.ini b/toolkit/components/jsdownloads/test/unit/xpcshell.ini index d72e3fb1a0cd..19a6e8a5b1d0 100644 --- a/toolkit/components/jsdownloads/test/unit/xpcshell.ini +++ b/toolkit/components/jsdownloads/test/unit/xpcshell.ini @@ -15,4 +15,5 @@ support-files = [test_Downloads.js] [test_DownloadStore.js] [test_PrivateTemp.js] -skip-if = os != 'linux' +# coverage flag is for bug 1336730 +skip-if = (os != 'linux' || coverage) diff --git a/toolkit/components/osfile/tests/xpcshell/xpcshell.ini b/toolkit/components/osfile/tests/xpcshell/xpcshell.ini index 6172fe6701e6..2f7a61cd7c39 100644 --- a/toolkit/components/osfile/tests/xpcshell/xpcshell.ini +++ b/toolkit/components/osfile/tests/xpcshell/xpcshell.ini @@ -47,4 +47,5 @@ requesttimeoutfactor = 4 [test_reset.js] [test_shutdown.js] [test_telemetry.js] +skip-if = coverage # bug 1336672 [test_unique.js] diff --git a/toolkit/components/startup/tests/unit/xpcshell.ini b/toolkit/components/startup/tests/unit/xpcshell.ini index 809f9f3f6a39..daabb805ddf7 100644 --- a/toolkit/components/startup/tests/unit/xpcshell.ini +++ b/toolkit/components/startup/tests/unit/xpcshell.ini @@ -3,3 +3,4 @@ head = head_startup.js skip-if = toolkit == 'android' [test_startup_crash.js] +skip-if = coverage # bug 1336673 diff --git a/tools/profiler/tests/xpcshell.ini b/tools/profiler/tests/xpcshell.ini index cb322ae66beb..b014bd750c27 100644 --- a/tools/profiler/tests/xpcshell.ini +++ b/tools/profiler/tests/xpcshell.ini @@ -15,3 +15,4 @@ skip-if = !debug [test_enterjit_osr_enabling.js] skip-if = !debug [test_asm.js] +skip-if = coverage # bug 1336674