Bug 1881661 - Wait for h264 video iframe correctly r=mboldan,benchatt
[gecko.git] / taskcluster / test / test_new_config.py
bloba233dce97bc53ff3eed1cf4a514199a1ace833ba
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
6 from tryselect.selectors.auto import TRY_AUTO_PARAMETERS
8 pytestmark = pytest.mark.slow
10 PARAMS = TRY_AUTO_PARAMETERS.copy()
11 PARAMS.update(
13 "head_repository": "https://hg.mozilla.org/try",
14 "project": "try",
15 "target_kind": "test",
16 # These ensure this isn't considered a backstop. The pushdate must
17 # be slightly higher than the one in data/pushes.json, and
18 # pushlog_id must not be a multiple of 10.
19 "pushdate": 1593029536,
20 "pushlog_id": "2",
24 PARAMS_NEW_CONFIG = TRY_AUTO_PARAMETERS.copy()
25 PARAMS_NEW_CONFIG.update(
27 "head_repository": "https://hg.mozilla.org/try",
28 "project": "try",
29 "target_kind": "test",
30 # These ensure this isn't considered a backstop. The pushdate must
31 # be slightly higher than the one in data/pushes.json, and
32 # pushlog_id must not be a multiple of 10.
33 "pushdate": 1593029536,
34 "pushlog_id": "2",
35 "try_task_config": {"new-test-config": True},
36 "try_mode": "try_task_config",
37 "target_tasks_method": "try_tasks",
38 "test_manifest_loader": "default",
43 @pytest.mark.parametrize(
44 "func,min_expected",
46 pytest.param(
47 lambda t: (
48 t.kind == "test"
49 and t.attributes["unittest_suite"] == "mochitest-browser-chrome"
50 and t.attributes["test_platform"] == "linux1804-64-qr/opt"
52 64,
53 id="mochitest-browser-chrome",
57 def test_tasks_new_config_false(full_task_graph, filter_tasks, func, min_expected):
58 """Ensure when using new-test-config that we have -cf tasks and they are half the total tasks."""
59 tasks = [t.label for t in filter_tasks(full_task_graph, func)]
60 assert len(tasks) == min_expected
62 cf_tasks = [
63 t.label for t in filter_tasks(full_task_graph, func) if t.label.endswith("-cf")
65 assert len(cf_tasks) == min_expected / 2
68 @pytest.mark.parametrize(
69 "func,min_expected",
71 pytest.param(
72 lambda t: (
73 t.kind == "test"
74 and t.attributes["unittest_suite"] == "mochitest-browser-chrome"
75 and t.attributes["test_platform"] == "linux1804-64-qr/opt"
77 64,
78 id="mochitest-browser-chrome",
82 def test_tasks_new_config_true(
83 full_task_graph_new_config, filter_tasks, func, min_expected
85 """Ensure when using new-test-config that no -cf tasks are scheduled and we have 2x the default and NO -cf."""
86 tasks = [t.label for t in filter_tasks(full_task_graph_new_config, func)]
87 assert len(tasks) == min_expected
89 cf_tasks = [
90 t.label
91 for t in filter_tasks(full_task_graph_new_config, func)
92 if t.label.endswith("-cf")
94 assert len(cf_tasks) == 0
97 if __name__ == "__main__":
98 main()