# 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:
    run-on-repo-type: [hg]
    platform: linux2404-64/opt
    require-build:
        by-project:
            try:
                linux2404-64/opt: build-linux64/opt
            default:
                linux2404-64/opt: build-linux64-shippable/opt
    fetches:
        build:
            - target.tar.xz
        toolchain:
            - linux64-node
    treeherder:
        kind: test
        tier: 1
    worker-type: t-linux-docker-amd
    worker:
        docker-image: {in-tree: ubuntu2404-test}
        max-run-time: 3600
        artifacts:
            - type: file
              name: public/remote/pup_errorsummary.json
              path: /builds/worker/pup_errorsummary.json
    optimization:
        skip-unless-expanded: null

puppeteer-{this_chunk}:
    description: Puppeteer tests against Firefox with Webdriver BiDi remote protocol
    chunk:
        total-chunks: 2
        substitution-fields:
            - name
            - treeherder
            - run
    treeherder:
        symbol: Pup({this_chunk})
    run:  # Bug 1651542: Use screenshot feature to warm-up the font cache before the actual test
        using: run-task
        command: >
            cd $GECKO_PATH/ &&
            $MOZ_FETCHES_DIR/firefox/firefox --screenshot http://example.org &&
            ./mach puppeteer-test --ci -vv --binary $MOZ_FETCHES_DIR/firefox/firefox --headless --log-tbpl - --log-errorsummary /builds/worker/pup_errorsummary.json --this-chunk={this_chunk} --total-chunks={total_chunks}
