# 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/.
---
task-defaults:
    test-manifest-loader: null  # don't load tests in the taskgraph

geckoview-junit:
    description: "Geckoview junit run"
    suite: geckoview-junit
    variants: ["geckoview-fission", "no-fission", "geckoview-no-fission-no-ship", "geckoview-zygote"]
    treeherder-symbol: gv-junit
    loopback-video: true
    target: geckoview-androidTest.apk
    max-run-time: 3600
    run-on-projects:
        by-variant:
            geckoview-fission: ['trunk']
            no-fission: built-projects
            geckoview-no-fission-no-ship: built-projects
            geckoview-zygote: []
            default: []
    tier: default
    mozharness:
        script: android_emulator_unittest.py
        config:
            by-test-platform:
                android-em-14.*:
                    - android/android_common.py
                    - android/android14-x86_64.py
        extra-options:
            - --test-suite=geckoview-junit

telemetry-tests-client:
    description: "Telemetry tests client run"
    suite: telemetry-tests-client
    treeherder-symbol: tt(c)
    run-on-projects: built-projects
    max-run-time: 1200
    tier: default
    mozharness:
        script: telemetry/telemetry_client.py
        config:
            by-test-platform:
                linux.*:
                    - remove_executables.py
                windows.*: []
                macosx.*: []

test-verify:
    description: "Extra verification of tests modified on this push"
    suite: test-verify
    treeherder-symbol: TV
    loopback-video: true
    max-run-time: 10800
    allow-software-gl-layers: false
    variants:
        - no-fission
    run-on-projects:
        by-variant:
            no-fission:
                by-test-platform:
                    # do not run on ccov or asan or shippable or wayland
                    .*-ccov.*: []
                    .*-asan.*: []
                    .*-shippable.*: []
                    .*-wayland.*: []
                    # do not run on mozilla-central, beta or release: usually just confirms earlier results
                    android.*: ['integration']
                    default: []
            default:
                by-test-platform:
                    # do not run on ccov or asan or shippable or wayland
                    .*-ccov.*: []
                    .*-asan.*: []
                    .*-shippable.*: []
                    .*-wayland.*: []
                    # do not run on mozilla-central, beta or release: usually just confirms earlier results
                    android.*: []
                    default: ['integration']
    built-projects-only: true
    target:
        by-test-platform:
            android-em.*: geckoview-test_runner.apk
            default: null
    optimization:
        test-verify: ["test-verify"]
    tier: 2
    mozharness:
        script:
            by-test-platform:
                android-em.*: android_emulator_unittest.py
                default: desktop_unittest.py
        config:
            by-test-platform:
                android-em-14.*:
                    - android/android_common.py
                    - android/android14-x86_64.py
                linux.*:
                    - unittests/linux_unittest.py
                    - unittests/linux_dbus-python.py
                    - remove_executables.py
                macosx.*:
                    - unittests/mac_unittest.py
                windows.*:
                    - unittests/win_unittest.py
        extra-options:
            - --verify
    fetches:
        toolchain:
            by-test-platform:
                linux1804.*:
                    - linux64-node
                    - linux64-minidump-stackwalk
                    - linux64-fix-stacks
                    - linux-python-dbusmock
                    - linux64-1804-dbus-python
                linux2204.*:
                    - linux64-node
                    - linux64-minidump-stackwalk
                    - linux64-fix-stacks
                    - linux-python-dbusmock
                    - linux64-2204-dbus-python
                linux2404.*:
                    - linux64-node
                    - linux64-minidump-stackwalk
                    - linux64-fix-stacks
                    - linux-python-dbusmock
                    - linux64-2404-dbus-python
                macosx.*-64.*:
                    - macosx64-node
                    - macosx64-minidump-stackwalk
                    - macosx64-fix-stacks
                macosx.*-aarch64.*:
                    - macosx64-aarch64-node
                    - macosx64-aarch64-minidump-stackwalk
                    - macosx64-aarch64-fix-stacks
                win.*-64.*:
                    - win64-node
                    - win32-minidump-stackwalk
                    - win32-fix-stacks
                win.*32.*:
                    - win32-node
                    - win32-minidump-stackwalk
                    - win32-fix-stacks
                android-em-14.*:
                    - android34-system-image-x86_64-linux
                    - android34-avd-x86_64-linux
                    - android-emulator-linux
                    - linux64-node
                    - linux64-minidump-stackwalk
                    - linux64-fix-stacks
                    - linux64-hostutils
        fetch:
            - ort.jsep.wasm
            - tr8ns.inference
            - tr8ns.T.esen.lex
            - tr8ns.T.esen.model
            - tr8ns.T.esen.vocab

test-verify-gpu:
    description: "Extra verification of tests modified on this push on gpu instances"
    suite:
        category: test-verify
        name: test-verify-gpu
    treeherder-symbol: TVg
    loopback-video: true
    virtualization: virtual-with-gpu
    max-run-time: 10800
    allow-software-gl-layers: false
    run-on-projects:
        by-test-platform:
            # do not run on ccov or asan or shippable or wayland
            .*-ccov.*: []
            .*-asan.*: []
            .*-shippable.*: []
            .*-wayland.*: []
            # do not run on mozilla-central, beta or release: usually just confirms earlier results
            linux.*: ['integration']
            default: []
    built-projects-only: true
    optimization:
        test-verify: ["test-verify-gpu"]
    tier: 2
    mozharness:
        script:
            by-test-platform:
                android-em.*: android_emulator_unittest.py
                default: desktop_unittest.py
        config:
            by-test-platform:
                android-em-14.*:
                    - android/android_common.py
                    - android/android14-x86_64.py
                linux.*:
                    - unittests/linux_unittest.py
                    - remove_executables.py
                macosx.*:
                    - unittests/mac_unittest.py
                windows.*:
                    - unittests/win_unittest.py
        extra-options:
            - --verify
            - --gpu-required

test-coverage:
    description: "Per-test coverage"
    suite: test-coverage
    treeherder-symbol: TC
    loopback-video: true
    instance-size: default
    max-run-time: 10800
    allow-software-gl-layers: false
    run-on-projects:
        by-test-platform:
            .*-ccov.*: built-projects
            default: []
    tier: 2
    mozharness:
        script:
            by-test-platform:
                android-em.*: android_emulator_unittest.py
                default: desktop_unittest.py
        config:
            by-test-platform:
                android-em-14.*:
                    - android/android_common.py
                    - android/android14-x86_64.py
                linux.*:
                    - unittests/linux_unittest.py
                    - remove_executables.py
                macosx.*:
                    - unittests/mac_unittest.py
                windows.*:
                    - unittests/win_unittest.py
        extra-options:
            - --per-test-coverage
    fetches:
        toolchain:
            by-test-platform:
                linux.*:
                    - linux64-node
                    - linux64-minidump-stackwalk
                    - linux64-fix-stacks
                macosx.*-64.*:
                    - macosx64-node
                    - macosx64-minidump-stackwalk
                    - macosx64-fix-stacks
                macosx.*-aarch64.*:
                    - macosx64-aarch64-node
                    - macosx64-aarch64-minidump-stackwalk
                    - macosx64-aarch64-fix-stacks
                win.*-64.*:
                    - win64-node
                    - win32-minidump-stackwalk
                    - win32-fix-stacks
                win.*32.*:
                    - win32-node
                    - win32-minidump-stackwalk
                    - win32-fix-stacks
                android-em-14.*:
                    - android34-system-image-x86_64-linux
                    - android34-avd-x86_64-linux
                    - android-emulator-linux
                    - linux64-node
                    - linux64-minidump-stackwalk
                    - linux64-fix-stacks
                    - linux64-hostutils

test-coverage-gpu:
    description: "Per-test coverage for tests that require gpu instances"
    suite: test-coverage
    treeherder-symbol: TCg
    loopback-video: true
    virtualization: virtual-with-gpu
    instance-size: default
    max-run-time: 10800
    allow-software-gl-layers: false
    run-on-projects:
        by-test-platform:
            # only run on mozilla-central and try.
            .*-ccov.*: ['mozilla-central']
            default: []
    tier:
        by-test-platform:
            windows.*-asan.*: 3
            default: 2
    mozharness:
        script:
            by-test-platform:
                android-em.*: android_emulator_unittest.py
                default: desktop_unittest.py
        config:
            by-test-platform:
                android-em-14.*:
                    - android/android_common.py
                    - android/android14-x86_64.py
                linux.*:
                    - unittests/linux_unittest.py
                    - remove_executables.py
                macosx.*:
                    - unittests/mac_unittest.py
                windows.*:
                    - unittests/win_unittest.py
        extra-options:
            - --per-test-coverage
            - --gpu-required
