Bug 1881661 - Wait for h264 video iframe correctly r=mboldan,benchatt
[gecko.git] / taskcluster / test / test_mach_try_auto.py
blobf26110b57f953e0827b15afe8ffbdb5081cf6453
1 # Any copyright is dedicated to the public domain.
2 # http://creativecommons.org/publicdomain/zero/1.0/
4 import pytest
5 from gecko_taskgraph.util.bugbug import push_schedules
6 from gecko_taskgraph.util.chunking import BugbugLoader
7 from mozunit import main
8 from tryselect.selectors.auto import TRY_AUTO_PARAMETERS
10 pytestmark = pytest.mark.slow
11 PARAMS = TRY_AUTO_PARAMETERS.copy()
12 PARAMS.update(
14 "head_repository": "https://hg.mozilla.org/try",
15 "project": "try",
16 "target_kind": "test",
17 # These ensure this isn't considered a backstop. The pushdate must
18 # be slightly higher than the one in data/pushes.json, and
19 # pushlog_id must not be a multiple of 10.
20 "pushdate": 1593029536,
21 "pushlog_id": "2",
26 def test_generate_graph(optimized_task_graph):
27 """Simply tests that generating the graph does not fail."""
28 assert len(optimized_task_graph.tasks) > 0
31 def test_only_important_manifests(params, full_task_graph, filter_tasks):
32 data = push_schedules(params["project"], params["head_rev"])
33 important_manifests = {
35 for m, c in data.get("groups", {}).items()
36 if c >= BugbugLoader.CONFIDENCE_THRESHOLD
39 # Ensure we don't schedule unimportant manifests.
40 for task in filter_tasks(full_task_graph, lambda t: t.kind == "test"):
41 attr = task.attributes.get
43 if "test_manifests" in task.attributes:
44 unimportant = [
45 t for t in attr("test_manifests") if t not in important_manifests
48 # Manifest scheduling is disabled for mochitest-ally.
49 if attr("unittest_suite") == "mochitest-a11y":
50 assert len(unimportant) > 0
51 else:
52 assert unimportant == []
55 @pytest.mark.parametrize(
56 "func,min_expected",
58 pytest.param(
59 lambda t: (
60 t.kind == "test"
61 and t.attributes["unittest_suite"] == "mochitest-browser-chrome"
64 id="mochitest-browser-chrome",
68 def test_tasks_are_scheduled(optimized_task_graph, filter_tasks, func, min_expected):
69 """Ensure the specified tasks are scheduled on mozilla-central."""
70 tasks = [t.label for t in filter_tasks(optimized_task_graph, func)]
71 assert len(tasks) >= min_expected
74 @pytest.mark.parametrize(
75 "func",
77 pytest.param(
78 lambda t: t.kind == "build"
79 and "shippable" in t.attributes["build_platform"],
80 id="no shippable builds",
82 pytest.param(
83 lambda t: t.kind == "build" and "fuzzing" in t.attributes["build_platform"],
84 id="no fuzzing builds",
86 pytest.param(
87 lambda t: t.kind == "build" and "ccov" in t.attributes["build_platform"],
88 id="no ccov builds",
90 # We should only assert that we have no signed builds on platforms that don't run
91 # xpcshell tests.
92 pytest.param(
93 lambda t: t.kind == "build-signing",
94 id="no build-signing",
95 marks=pytest.mark.xfail(reason="some xpcshell tests require signed builds"),
97 pytest.param(
98 lambda t: t.kind == "upload-symbols",
99 id="no upload-symbols",
103 def test_tasks_are_not_scheduled(
104 optimized_task_graph, filter_tasks, print_dependents, func
106 tasks = [t.label for t in filter_tasks(optimized_task_graph, func)]
107 for t in tasks:
108 print_dependents(optimized_task_graph, t)
109 assert tasks == []
112 if __name__ == "__main__":
113 main()