fune/taskcluster/test/test_mozilla_central.py
Andrew Halberstadt ee5409e879 Bug 1656465 - [ci] Add some taskgraph integration tests to ensure fuzzing builds run where we expect them to, r=taskgraph-reviewers,aki
Each file represents a new taskgraph generation in the tests. But now that these exist, we
can add new assertions to the existing files without worry.

Depends on D89054

Differential Revision: https://phabricator.services.mozilla.com/D89055
2020-09-01 21:43:18 +00:00

39 lines
1 KiB
Python

# Any copyright is dedicated to the public domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from __future__ import absolute_import, print_function, unicode_literals
import pytest
from mozunit import main
pytestmark = pytest.mark.slow
PARAMS = {
"head_repository": "https://hg.mozilla.org/mozilla-central",
"project": "central",
}
def test_generate_graph(optimized_task_graph):
"""Simply tests that generating the graph does not fail."""
assert len(optimized_task_graph.tasks) > 0
@pytest.mark.parametrize(
"func,min_expected",
(
pytest.param(
lambda t: t.kind == "build" and "fuzzing" in t.attributes["build_platform"],
5,
id="fuzzing builds",
),
),
)
def test_tasks_are_scheduled(optimized_task_graph, filter_tasks, func, min_expected):
"""Ensure the specified tasks are scheduled on mozilla-central."""
tasks = [t.label for t in filter_tasks(optimized_task_graph, func)]
print(tasks)
assert len(tasks) >= min_expected
if __name__ == "__main__":
main()