desktop_unittest module

desktop_unittest.py The goal of this is to extract desktop unittesting from buildbot’s factory.py

author: Jordan Lund

class desktop_unittest.DesktopUnittest(require_config_file=True)[source]

Bases: mozharness.mozilla.testing.testbase.TestingMixin, mozharness.base.vcs.vcsbase.MercurialScript, mozharness.mozilla.blob_upload.BlobUploadMixin, mozharness.mozilla.mozbase.MozbaseMixin, mozharness.mozilla.testing.codecoverage.CodeCoverageMixin

config_options = [[['--mochitest-suite'], {'action': 'extend', 'dest': 'specified_mochitest_suites', 'type': 'string', 'help': "Specify which mochi suite to run. Suites are defined in the config file.\nExamples: 'all', 'plain1', 'plain5', 'chrome', or 'a11y'"}], [['--webapprt-suite'], {'action': 'extend', 'dest': 'specified_webapprt_suites', 'type': 'string', 'help': "Specify which webapprt suite to run. Suites are defined in the config file.\nExamples: 'content', 'chrome'"}], [['--reftest-suite'], {'action': 'extend', 'dest': 'specified_reftest_suites', 'type': 'string', 'help': "Specify which reftest suite to run. Suites are defined in the config file.\nExamples: 'all', 'crashplan', or 'jsreftest'"}], [['--xpcshell-suite'], {'action': 'extend', 'dest': 'specified_xpcshell_suites', 'type': 'string', 'help': "Specify which xpcshell suite to run. Suites are defined in the config file\n.Examples: 'xpcshell'"}], [['--cppunittest-suite'], {'action': 'extend', 'dest': 'specified_cppunittest_suites', 'type': 'string', 'help': "Specify which cpp unittest suite to run. Suites are defined in the config file\n.Examples: 'cppunittest'"}], [['--jittest-suite'], {'action': 'extend', 'dest': 'specified_jittest_suites', 'type': 'string', 'help': "Specify which jit-test suite to run. Suites are defined in the config file\n.Examples: 'jittest'"}], [['--mozbase-suite'], {'action': 'extend', 'dest': 'specified_mozbase_suites', 'type': 'string', 'help': "Specify which mozbase suite to run. Suites are defined in the config file\n.Examples: 'mozbase'"}], [['--mozmill-suite'], {'action': 'extend', 'dest': 'specified_mozmill_suites', 'type': 'string', 'help': "Specify which mozmill suite to run. Suites are defined in the config file\n.Examples: 'mozmill'"}], [['--run-all-suites'], {'action': 'store_true', 'dest': 'run_all_suites', 'default': False, 'help': 'This will run all suites that are specified in the config file. You do not need to specify any other suites.\nBeware, this may take a while ;)'}], [['--e10s'], {'action': 'store_true', 'dest': 'e10s', 'default': False, 'help': 'Run tests with multiple processes.'}], [['--strict-content-sandbox'], {'action': 'store_true', 'dest': 'strict_content_sandbox', 'default': False, 'help': 'Run tests with a more strict content sandbox (Windows only).'}], [['--no-random'], {'action': 'store_true', 'dest': 'no_random', 'default': False, 'help': 'Run tests with no random intermittents and bisect in case of real failure.'}], [['--total-chunks'], {'action': 'store', 'dest': 'total_chunks', 'help': 'Number of total chunks'}], [['--this-chunk'], {'action': 'store', 'dest': 'this_chunk', 'help': 'Number of this chunk'}], [['--installer-url'], {'action': 'store', 'dest': 'installer_url', 'default': None, 'help': 'URL to the installer to install'}], [['--installer-path'], {'action': 'store', 'dest': 'installer_path', 'default': None, 'help': 'Path to the installer to install. This is set automatically if run with --download-and-extract.'}], [['--binary-path'], {'action': 'store', 'dest': 'binary_path', 'default': None, 'help': 'Path to installed binary. This is set automatically if run with --install.'}], [['--exe-suffix'], {'action': 'store', 'dest': 'exe_suffix', 'default': None, 'help': 'Executable suffix for binaries on this platform'}], [['--test-url'], {'action': 'store', 'dest': 'test_url', 'default': None, 'help': 'URL to the zip file containing the actual tests'}], [['--test-packages-url'], {'action': 'store', 'dest': 'test_packages_url', 'default': None, 'help': 'URL to a json file describing which tests archives to download'}], [['--jsshell-url'], {'action': 'store', 'dest': 'jsshell_url', 'default': None, 'help': 'URL to the jsshell to install'}], [['--download-symbols'], {'action': 'store', 'dest': 'download_symbols', 'type': 'choice', 'help': 'Download and extract crash reporter symbols.', 'choices': ['ondemand', 'true']}], [['--venv-path', '--virtualenv-path'], {'action': 'store', 'dest': 'virtualenv_path', 'default': 'venv', 'help': 'Specify the path to the virtualenv top level directory'}], [['--virtualenv'], {'action': 'store', 'dest': 'virtualenv', 'help': 'Specify the virtualenv executable to use'}], [['--find-links'], {'action': 'extend', 'dest': 'find_links', 'help': 'URL to look for packages at'}], [['--pip-index'], {'action': 'store_true', 'default': True, 'dest': 'pip_index', 'help': 'Use pip indexes (default)'}], [['--no-pip-index'], {'action': 'store_false', 'dest': 'pip_index', 'help': "Don't use pip indexes"}], [['--blob-upload-branch'], {'dest': 'blob_upload_branch', 'help': "Branch for blob server's metadata"}], [['--blob-upload-server'], {'dest': 'blob_upload_servers', 'action': 'extend', 'help': "Blob servers's location"}], [['--code-coverage'], {'action': 'store', 'dest': 'code_coverage', 'default': False, 'help': 'Whether test run should package and upload code coverage data.'}]]
download_and_extract()[source]

download and extract test zip / download installer optimizes which subfolders to extract from tests zip

get_webapprt_path(res_dir, mochitest_dir)[source]

Get the path to the webapp runtime binary. On Mac, we copy the stub from the resources dir to the test app bundle, since we have to run it from the executable directory of a bundle in order for its windows to appear. Ideally, the build system would do this for us at build time, and we should find a way for it to do that.

preflight_cppunittest(suites)[source]
preflight_mozmill(suites)[source]
preflight_xpcshell(suites)[source]
query_abs_app_dir()[source]

We can’t set this in advance, because OSX install directories change depending on branding and opt/debug.

query_abs_dirs()[source]
query_abs_res_dir()[source]

The directory containing resources like plugins and extensions. On OSX this is Contents/Resources, on all other platforms its the same as the app dir.

As with the app dir, we can’t set this in advance, because OSX install directories change depending on branding and opt/debug.

run_tests()[source]