tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

android_common.py (12529B)


      1 # This Source Code Form is subject to the terms of the Mozilla Public
      2 # License, v. 2.0. If a copy of the MPL was not distributed with this
      3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
      4 
      5 # Shared/common mozharness configuration for Android unit tests.
      6 #
      7 # This configuration should be combined with platform-specific mozharness
      8 # configuration such as android-x86_64.py, android_hw, or similar.
      9 
     10 import os
     11 
     12 NODEJS_PATH = None
     13 if "MOZ_FETCHES_DIR" in os.environ:
     14    NODEJS_PATH = os.path.join(os.environ["MOZ_FETCHES_DIR"], "node/bin/node")
     15 
     16 
     17 def WebglSuite(name):
     18    return {
     19        "run_filename": "runtestsremote.py",
     20        "testsdir": "mochitest",
     21        "options": [
     22            "--app=%(app)s",
     23            "--remote-webserver=%(remote_webserver)s",
     24            "--xre-path=%(xre_path)s",
     25            "--utility-path=%(utility_path)s",
     26            "--http-port=%(http_port)s",
     27            "--ssl-port=%(ssl_port)s",
     28            "--certificate-path=%(certs_path)s",
     29            "--symbols-path=%(symbols_path)s",
     30            "--quiet",
     31            "--log-errorsummary=%(error_summary_file)s",
     32            "--log-tbpl-level=%(log_tbpl_level)s",
     33            "--screenshot-on-fail",
     34            "--subsuite=" + name,
     35            "--deviceSerial=%(device_serial)s",
     36        ],
     37    }
     38 
     39 
     40 config = {
     41    "default_actions": [
     42        "clobber",
     43        "download-and-extract",
     44        "create-virtualenv",
     45        "start-emulator",
     46        "verify-device",
     47        "install",
     48        "run-tests",
     49    ],
     50    "tooltool_cache": os.environ.get("TOOLTOOL_CACHE"),
     51    "hostutils_manifest_path": "testing/config/tooltool-manifests/linux64/hostutils.manifest",
     52    # "log_format": "%(levelname)8s - %(message)s",
     53    "log_tbpl_level": "info",
     54    "log_raw_level": "info",
     55    # To take device screenshots at timed intervals (each time in seconds, relative
     56    # to the start of the run-tests step) specify screenshot_times. For example, to
     57    # take 4 screenshots at one minute intervals you could specify:
     58    # "screenshot_times": [60, 120, 180, 240],
     59    "nodejs_path": NODEJS_PATH,
     60    "suite_definitions": {
     61        "mochitest-plain": {
     62            "run_filename": "runtestsremote.py",
     63            "testsdir": "mochitest",
     64            "options": [
     65                "--app=%(app)s",
     66                "--remote-webserver=%(remote_webserver)s",
     67                "--xre-path=%(xre_path)s",
     68                "--utility-path=%(utility_path)s",
     69                "--http-port=%(http_port)s",
     70                "--ssl-port=%(ssl_port)s",
     71                "--certificate-path=%(certs_path)s",
     72                "--symbols-path=%(symbols_path)s",
     73                "--quiet",
     74                "--log-errorsummary=%(error_summary_file)s",
     75                "--log-tbpl-level=%(log_tbpl_level)s",
     76                "--extra-profile-file=fonts",
     77                "--extra-profile-file=hyphenation",
     78                "--screenshot-on-fail",
     79                "--deviceSerial=%(device_serial)s",
     80            ],
     81        },
     82        "mochitest-webgl1-core": WebglSuite("webgl1-core"),
     83        "mochitest-webgl2-core": WebglSuite("webgl2-core"),
     84        "mochitest-webgl1-ext": WebglSuite("webgl1-ext"),
     85        "mochitest-webgl2-ext": WebglSuite("webgl2-ext"),
     86        "mochitest-webgl2-deqp": WebglSuite("webgl2-deqp"),
     87        "mochitest-webgpu": WebglSuite("webgpu"),
     88        "mochitest-plain-gpu": {
     89            "run_filename": "runtestsremote.py",
     90            "testsdir": "mochitest",
     91            "options": [
     92                "--app=%(app)s",
     93                "--remote-webserver=%(remote_webserver)s",
     94                "--xre-path=%(xre_path)s",
     95                "--utility-path=%(utility_path)s",
     96                "--http-port=%(http_port)s",
     97                "--ssl-port=%(ssl_port)s",
     98                "--certificate-path=%(certs_path)s",
     99                "--symbols-path=%(symbols_path)s",
    100                "--quiet",
    101                "--log-errorsummary=%(error_summary_file)s",
    102                "--log-tbpl-level=%(log_tbpl_level)s",
    103                "--screenshot-on-fail",
    104                "--subsuite=gpu",
    105                "--deviceSerial=%(device_serial)s",
    106            ],
    107        },
    108        "mochitest-media": {
    109            "run_filename": "runtestsremote.py",
    110            "testsdir": "mochitest",
    111            "options": [
    112                "--app=%(app)s",
    113                "--remote-webserver=%(remote_webserver)s",
    114                "--xre-path=%(xre_path)s",
    115                "--utility-path=%(utility_path)s",
    116                "--http-port=%(http_port)s",
    117                "--ssl-port=%(ssl_port)s",
    118                "--certificate-path=%(certs_path)s",
    119                "--symbols-path=%(symbols_path)s",
    120                "--quiet",
    121                "--log-errorsummary=%(error_summary_file)s",
    122                "--log-tbpl-level=%(log_tbpl_level)s",
    123                "--screenshot-on-fail",
    124                "--chunk-by-runtime",
    125                "--subsuite=media",
    126                "--deviceSerial=%(device_serial)s",
    127            ],
    128        },
    129        "reftest": {
    130            "run_filename": "remotereftest.py",
    131            "testsdir": "reftest",
    132            "options": [
    133                "--app=%(app)s",
    134                "--ignore-window-size",
    135                "--remote-webserver=%(remote_webserver)s",
    136                "--xre-path=%(xre_path)s",
    137                "--utility-path=%(utility_path)s",
    138                "--http-port=%(http_port)s",
    139                "--ssl-port=%(ssl_port)s",
    140                "--httpd-path",
    141                "%(modules_dir)s",
    142                "--symbols-path=%(symbols_path)s",
    143                "--extra-profile-file=fonts",
    144                "--extra-profile-file=hyphenation",
    145                "--suite=reftest",
    146                "--log-errorsummary=%(error_summary_file)s",
    147                "--log-tbpl-level=%(log_tbpl_level)s",
    148                "--deviceSerial=%(device_serial)s",
    149                "--topsrcdir=tests",
    150            ],
    151            "tests": [
    152                "tests/layout/reftests/reftest.list",
    153            ],
    154        },
    155        "reftest-qr": {
    156            "run_filename": "remotereftest.py",
    157            "testsdir": "reftest",
    158            "options": [
    159                "--app=%(app)s",
    160                "--ignore-window-size",
    161                "--remote-webserver=%(remote_webserver)s",
    162                "--xre-path=%(xre_path)s",
    163                "--utility-path=%(utility_path)s",
    164                "--http-port=%(http_port)s",
    165                "--ssl-port=%(ssl_port)s",
    166                "--httpd-path",
    167                "%(modules_dir)s",
    168                "--symbols-path=%(symbols_path)s",
    169                "--extra-profile-file=fonts",
    170                "--extra-profile-file=hyphenation",
    171                "--suite=reftest",
    172                "--log-errorsummary=%(error_summary_file)s",
    173                "--log-tbpl-level=%(log_tbpl_level)s",
    174                "--deviceSerial=%(device_serial)s",
    175                "--topsrcdir=tests",
    176            ],
    177            "tests": [
    178                "tests/layout/reftests/reftest-qr.list",
    179            ],
    180        },
    181        "crashtest": {
    182            "run_filename": "remotereftest.py",
    183            "testsdir": "reftest",
    184            "options": [
    185                "--app=%(app)s",
    186                "--ignore-window-size",
    187                "--remote-webserver=%(remote_webserver)s",
    188                "--xre-path=%(xre_path)s",
    189                "--utility-path=%(utility_path)s",
    190                "--http-port=%(http_port)s",
    191                "--ssl-port=%(ssl_port)s",
    192                "--httpd-path",
    193                "%(modules_dir)s",
    194                "--symbols-path=%(symbols_path)s",
    195                "--suite=crashtest",
    196                "--log-errorsummary=%(error_summary_file)s",
    197                "--log-tbpl-level=%(log_tbpl_level)s",
    198                "--deviceSerial=%(device_serial)s",
    199                "--topsrcdir=tests",
    200            ],
    201            "tests": [
    202                "tests/testing/crashtest/crashtests.list",
    203            ],
    204        },
    205        "crashtest-qr": {
    206            "run_filename": "remotereftest.py",
    207            "testsdir": "reftest",
    208            "options": [
    209                "--app=%(app)s",
    210                "--ignore-window-size",
    211                "--remote-webserver=%(remote_webserver)s",
    212                "--xre-path=%(xre_path)s",
    213                "--utility-path=%(utility_path)s",
    214                "--http-port=%(http_port)s",
    215                "--ssl-port=%(ssl_port)s",
    216                "--httpd-path",
    217                "%(modules_dir)s",
    218                "--symbols-path=%(symbols_path)s",
    219                "--suite=crashtest",
    220                "--log-errorsummary=%(error_summary_file)s",
    221                "--log-tbpl-level=%(log_tbpl_level)s",
    222                "--deviceSerial=%(device_serial)s",
    223                "--topsrcdir=tests",
    224            ],
    225            "tests": [
    226                "tests/testing/crashtest/crashtests-qr.list",
    227            ],
    228        },
    229        "jittest": {
    230            "run_filename": "jit_test.py",
    231            "testsdir": "jit-test/jit-test",
    232            "options": [
    233                "../../bin/js",
    234                "--remote",
    235                "-j",
    236                "1",
    237                "--localLib=../../bin",
    238                "--no-slow",
    239                "--no-progress",
    240                "--format=automation",
    241                "--jitflags=%(jittest_flags)s",
    242                "--deviceSerial=%(device_serial)s",
    243            ],
    244        },
    245        "jsreftest": {
    246            "run_filename": "remotereftest.py",
    247            "testsdir": "reftest",
    248            "options": [
    249                "--app=%(app)s",
    250                "--ignore-window-size",
    251                "--remote-webserver=%(remote_webserver)s",
    252                "--xre-path=%(xre_path)s",
    253                "--utility-path=%(utility_path)s",
    254                "--http-port=%(http_port)s",
    255                "--ssl-port=%(ssl_port)s",
    256                "--httpd-path",
    257                "%(modules_dir)s",
    258                "--symbols-path=%(symbols_path)s",
    259                "--extra-profile-file=jsreftest/tests/js/src/tests/user.js",
    260                "--suite=jstestbrowser",
    261                "--log-errorsummary=%(error_summary_file)s",
    262                "--log-tbpl-level=%(log_tbpl_level)s",
    263                "--deviceSerial=%(device_serial)s",
    264                "--topsrcdir=../jsreftest/tests",
    265            ],
    266            "tests": [
    267                "../jsreftest/tests/js/src/tests/jstests.list",
    268            ],
    269        },
    270        "xpcshell": {
    271            "run_filename": "remotexpcshelltests.py",
    272            "testsdir": "xpcshell",
    273            "options": [
    274                "--xre-path=%(xre_path)s",
    275                "--testing-modules-dir=%(modules_dir)s",
    276                "--apk=%(installer_path)s",
    277                "--no-logfiles",
    278                "--symbols-path=%(symbols_path)s",
    279                "--manifest=tests/xpcshell.toml",
    280                "--log-errorsummary=%(error_summary_file)s",
    281                "--threads=10",
    282                "--deviceSerial=%(device_serial)s",
    283                "%(xpcshell_extra)s",
    284            ],
    285        },
    286        "cppunittest": {
    287            "run_filename": "remotecppunittests.py",
    288            "testsdir": "cppunittest",
    289            "install": False,
    290            "options": [
    291                "--symbols-path=%(symbols_path)s",
    292                "--xre-path=%(xre_path)s",
    293                "--localBinDir=../bin",
    294                "--apk=%(installer_path)s",
    295                ".",
    296                "--deviceSerial=%(device_serial)s",
    297                "--log-errorsummary=%(error_summary_file)s",
    298            ],
    299        },
    300        "geckoview-junit": {
    301            "run_filename": "runjunit.py",
    302            "testsdir": "mochitest",
    303            "options": [
    304                "--certificate-path=%(certs_path)s",
    305                "--remote-webserver=%(remote_webserver)s",
    306                "--symbols-path=%(symbols_path)s",
    307                "--utility-path=%(utility_path)s",
    308                "--deviceSerial=%(device_serial)s",
    309            ],
    310        },
    311        "gtest": {
    312            "run_filename": "remotegtests.py",
    313            "testsdir": "gtest",
    314            "install": True,
    315            "options": [
    316                "--symbols-path=%(symbols_path)s",
    317                "--tests-path=%(gtest_dir)s",
    318                "--libxul=%(gtest_dir)s/gtest_bin/gtest/libxul.so",
    319                "--package=%(app)s",
    320                "--deviceSerial=%(device_serial)s",
    321            ],
    322        },
    323    },  # end suite_definitions
    324    "structured_suites": [
    325        "xpcshell",
    326    ],
    327 }