Bug 1904750 Prefer DefaultDuration over previous inter-timestamp interval r=media...
[gecko.git] / taskcluster / test / test_autoland_backstop.py
blob55ea11ca4d52ad0a117d2dcdf3abc419acc1a834
1 # Any copyright is dedicated to the public domain.
2 # http://creativecommons.org/publicdomain/zero/1.0/
4 import pytest
5 from mozunit import main
7 pytestmark = pytest.mark.slow
8 PARAMS = {
9 "backstop": True,
10 "head_repository": "https://hg.mozilla.org/integration/autoland",
11 "project": "autoland",
15 def test_generate_graph(optimized_task_graph):
16 """Simply tests that generating the graph does not fail."""
17 assert len(optimized_task_graph.tasks) > 0
20 @pytest.mark.parametrize(
21 "func,min_expected",
23 pytest.param(
24 lambda t: t.kind == "build" and "fuzzing" in t.attributes["build_platform"],
26 id="fuzzing builds",
30 def test_tasks_are_scheduled(optimized_task_graph, filter_tasks, func, min_expected):
31 """Ensure the specified tasks are scheduled on mozilla-central."""
32 tasks = [t.label for t in filter_tasks(optimized_task_graph, func)]
33 assert len(tasks) >= min_expected
36 @pytest.mark.parametrize(
37 "func",
39 pytest.param(
40 lambda t: t.kind == "build" and "ccov" in t.attributes["build_platform"],
41 id="no ccov builds",
45 def test_tasks_are_not_scheduled(
46 optimized_task_graph, filter_tasks, print_dependents, func
48 """Ensure the specified tasks are not scheduled on autoland."""
49 tasks = [t.label for t in filter_tasks(optimized_task_graph, func)]
50 for t in tasks:
51 print_dependents(optimized_task_graph, t)
52 assert tasks == []
55 if __name__ == "__main__":
56 main()