1 # Any copyright is dedicated to the public domain.
2 # http://creativecommons.org/publicdomain/zero/1.0/
5 from mozunit
import main
7 pytestmark
= pytest
.mark
.slow
9 "head_repository": "https://hg.mozilla.org/mozilla-central",
14 def test_generate_graph(optimized_task_graph
):
15 """Simply tests that generating the graph does not fail."""
16 assert len(optimized_task_graph
.tasks
) > 0
19 @pytest.mark
.parametrize(
23 lambda t
: t
.kind
== "build" and "fuzzing" in t
.attributes
["build_platform"],
29 def test_tasks_are_scheduled(optimized_task_graph
, filter_tasks
, func
, min_expected
):
30 """Ensure the specified tasks are scheduled on mozilla-central."""
31 tasks
= [t
.label
for t
in filter_tasks(optimized_task_graph
, func
)]
33 assert len(tasks
) >= min_expected
36 def test_test_setting(full_task_graph
, filter_tasks
):
37 """Verify that all test tasks' ``test-setting`` object conforms to the schema."""
38 from gecko_taskgraph
.transforms
.test
.other
import test_setting_description_schema
39 from taskgraph
.util
.schema
import validate_schema
41 tasks
= filter_tasks(full_task_graph
, lambda t
: t
.kind
== "test")
47 test_setting_description_schema
,
48 dict(task
.task
["extra"]["test-setting"]),
51 except Exception as e
:
56 # Only display a few failures at once.
57 if len(failures
) > 10:
58 more
= len(failures
) - 10
59 failures
= failures
[:10]
61 failstr
= "\n\n" + "\n\n".join(str(e
) for e
in failures
)
63 failstr
+= "\n\n" + f
"... and {more} more"
65 pytest
.fail(f
"Task validation errors:{failstr}")
68 if __name__
== "__main__":