1# Any copyright is dedicated to the public domain. 2# http://creativecommons.org/publicdomain/zero/1.0/ 3 4from __future__ import absolute_import, print_function, unicode_literals 5 6import pytest 7from mozunit import main 8 9pytestmark = pytest.mark.slow 10PARAMS = { 11 "head_repository": "https://hg.mozilla.org/mozilla-central", 12 "project": "central", 13} 14 15 16def test_generate_graph(optimized_task_graph): 17 """Simply tests that generating the graph does not fail.""" 18 assert len(optimized_task_graph.tasks) > 0 19 20 21@pytest.mark.parametrize( 22 "func,min_expected", 23 ( 24 pytest.param( 25 lambda t: t.kind == "build" and "fuzzing" in t.attributes["build_platform"], 26 5, 27 id="fuzzing builds", 28 ), 29 ), 30) 31def test_tasks_are_scheduled(optimized_task_graph, filter_tasks, func, min_expected): 32 """Ensure the specified tasks are scheduled on mozilla-central.""" 33 tasks = [t.label for t in filter_tasks(optimized_task_graph, func)] 34 print(tasks) 35 assert len(tasks) >= min_expected 36 37 38if __name__ == "__main__": 39 main() 40