Commit 342cdf20 authored by Johan Lorenzo's avatar Johan Lorenzo
Browse files

Expose PR number to ui-test

parent e1d05f55
......@@ -5,11 +5,16 @@
loader: taskgraph.loader.transform:loader
transforms:
- fenix_taskgraph.transforms.test:transforms
- taskgraph.transforms.job:transforms
- taskgraph.transforms.task:transforms
job-defaults:
description: Test Reference Browser
description: Test Fenix
include-pull-request-number: false
run:
using: gradlew
use-caches: false
treeherder:
kind: test
tier: 2
......@@ -17,9 +22,6 @@ job-defaults:
worker:
docker-image: {in-tree: base}
max-run-time: 7200
run:
using: gradlew
use-caches: false
jobs:
debug:
......@@ -43,9 +45,7 @@ jobs:
attributes:
build-type: debug
code-review: true
treeherder:
symbol: ui
platform: 'ui-test/opt'
include-pull-request-number: true
run-on-tasks-for: [github-pull-request, github-push]
run:
# TODO Generate APKs in a build task instead
......@@ -57,6 +57,9 @@ jobs:
key: firebaseToken
path: .firebase_token.json
json: true
treeherder:
symbol: ui
platform: 'ui-test/opt'
worker:
docker-image: {in-tree: ui-tests}
env:
......
......@@ -9,7 +9,7 @@ import re
from importlib import import_module
from six import text_type
from voluptuous import Required
from voluptuous import All, Any, Range, Required
from taskgraph.parameters import extend_parameters_schema
......@@ -25,6 +25,7 @@ def register(graph_config):
_import_modules(["job", "worker_types", "routes", "target_tasks"])
extend_parameters_schema({
Required("head_tag"): text_type,
Required("pull_request_number"): Any(All(int, Range(min=1)), None),
Required("release_type"): text_type,
Required("release_version"): text_type,
})
......@@ -41,6 +42,9 @@ def get_decision_parameters(graph_config, parameters):
parameters["release_type"] = _resolve_release_type(head_tag)
parameters["release_version"] = head_tag[1:] if head_tag else ""
pr_number = os.environ.get("MOBILE_PULL_REQUEST_NUMBER", None)
parameters["pull_request_number"] = None if pr_number is None else int(pr_number)
if parameters["tasks_for"] == "github-release":
for param_name in ("release_type", "release_version"):
if not parameters[param_name]:
......
# 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/.
from __future__ import absolute_import, print_function, unicode_literals
from taskgraph.transforms.base import TransformSequence
transforms = TransformSequence()
@transforms.add
def add_pr_number(config, tasks):
for task in tasks:
include_pr = task.pop("include-pull-request-number")
if include_pr and config.params["pull_request_number"]:
task["worker"]["env"]["PULL_REQUEST_NUMBER"] = str(config.params["pull_request_number"])
yield task
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment