confirm_failure.py (1665B)
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 from taskgraph.transforms.base import TransformSequence 6 from taskgraph.util.copy import deepcopy 7 from taskgraph.util.treeherder import join_symbol, split_symbol 8 9 transforms = TransformSequence() 10 11 12 @transforms.add 13 def test_confirm_failure_tasks(config, tasks): 14 """Copy test-* tasks to have -cf copy.""" 15 if config.params["target_tasks_method"] == "os-integration": 16 yield from tasks 17 return 18 19 for task in tasks: 20 if config.params["try_task_config"].get("new-test-config", False): 21 yield task 22 continue 23 24 if "backlog" in task["suite"] or "failure" in task["suite"]: 25 yield task 26 continue 27 28 # support mochitest, xpcshell, reftest, wpt* 29 if any( 30 task["suite"].startswith(s) 31 for s in ("mochitest", "reftest", "xpcshell", "web-platform") 32 ): 33 env = config.params.get("try_task_config", {}) or {} 34 env = env.get("templates", {}).get("env", {}) 35 36 cftask = deepcopy(task) 37 38 # when scheduled other settings will be made 39 cftask["tier"] = 2 40 cftask["confirm-failure"] = True 41 group, symbol = split_symbol(cftask["treeherder-symbol"]) 42 group += "-cf" 43 cftask["treeherder-symbol"] = join_symbol(group, symbol) 44 cftask["run-on-projects"] = [] 45 cftask["optimization"] = {"always": None} 46 yield cftask 47 48 yield task