# 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/.
---
loader: taskgraph.loader.transform:loader

kind-dependencies:
    # We want to test the signed version of a build, to make sure
    # any startup problems or crashes caused by signing are caught
    # This means we depend on a different kind depending on the platform
    # non-system python
    - toolchain
    # linux
    - build-signing
    # mac
    - repackage
    # windows
    - repackage-signing

transforms:
    - gecko_taskgraph.transforms.startup_test:transforms
    - gecko_taskgraph.transforms.job:transforms
    - gecko_taskgraph.transforms.task:transforms

task-defaults:
    run-on-repo-type: [hg]
    name: startup-test
    description: Check whether or not a product crashes on startup
    run-on-projects: ['mozilla-central']
    worker:
        max-run-time: 3600
    run:
        sparse-profile: startup-test
    attributes:
        build_type: opt
    treeherder:
        symbol: SUT
        kind: test
        tier: 1
    use-python: default

tasks:
    linux64:
        dependencies:
            build-signing: build-signing-linux64-shippable/opt
        run:
            using: run-task
            cwd: "{checkout}"
        extra-config:
            upstream_kind: build-signing
            upstream_artifact: target.tar.xz
            binary: firefox
        worker-type: t-linux-docker-amd
        worker:
            docker-image: {in-tree: ubuntu2404-test}
        shipping-product: firefox
        attributes:
            build_platform: linux64-shippable
        treeherder:
            platform: linux64-shippable/opt

    linux64-aarch64:
        dependencies:
            build-signing: build-signing-linux64-aarch64-shippable/opt
        run:
            using: run-task
            cwd: "{checkout}"
        extra-config:
            upstream_kind: build-signing
            upstream_artifact: target.tar.xz
            binary: firefox
        worker-type: t-linux-arm64-docker
        worker:
            docker-image: {in-tree: ubuntu2404-arm64-test}
        shipping-product: firefox
        attributes:
            build_platform: linux64-aarch64-shippable
        treeherder:
            platform: linux64-aarch64-shippable/opt

    macosx64:
        dependencies:
            repackage: repackage-macosx64-shippable/opt
        run:
            using: mach
        extra-config:
            upstream_kind: repackage
            upstream_artifact: target.dmg
            binary: Contents/MacOS/firefox
        worker-type: t-osx-1400-r8
        shipping-product: firefox
        attributes:
            build_platform: macosx64-shippable
        treeherder:
            platform: macosx64-shippable/opt

    win32:
        dependencies:
            repackage-signing: repackage-signing-win32-shippable/opt
        run:
            using: mach
        extra-config:
            upstream_kind: repackage-signing
            upstream_artifact: target.installer.exe
            binary: core/firefox.exe
        worker-type: win11-64-24h2-source
        shipping-product: firefox
        attributes:
            build_platform: win32-shippable
        treeherder:
            platform: windows2012-32-shippable/opt

    win64:
        dependencies:
            repackage-signing: repackage-signing-win64-shippable/opt
        run:
            using: mach
        extra-config:
            upstream_kind: repackage-signing
            upstream_artifact: target.installer.exe
            binary: core/firefox.exe
        worker-type: win11-64-24h2-source
        shipping-product: firefox
        attributes:
            build_platform: win64-shippable
        treeherder:
            platform: windows2012-64-shippable/opt

    win64-aarch64:
        dependencies:
            repackage-signing: repackage-signing-win64-aarch64-shippable/opt
        run:
            using: mach
        extra-config:
            upstream_kind: repackage-signing
            upstream_artifact: target.installer.exe
            binary: core/firefox.exe
        worker-type: win11-a64-24h2
        shipping-product: firefox
        attributes:
            build_platform: win64-aarch64-shippable
        treeherder:
            platform: windows2012-aarch64-shippable/opt
