diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:44:51 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:44:51 +0000 |
commit | 9e3c08db40b8916968b9f30096c7be3f00ce9647 (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /taskcluster/test/test_autoland_backstop.py | |
parent | Initial commit. (diff) | |
download | thunderbird-9e3c08db40b8916968b9f30096c7be3f00ce9647.tar.xz thunderbird-9e3c08db40b8916968b9f30096c7be3f00ce9647.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'taskcluster/test/test_autoland_backstop.py')
-rw-r--r-- | taskcluster/test/test_autoland_backstop.py | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/taskcluster/test/test_autoland_backstop.py b/taskcluster/test/test_autoland_backstop.py new file mode 100644 index 0000000000..55ea11ca4d --- /dev/null +++ b/taskcluster/test/test_autoland_backstop.py @@ -0,0 +1,56 @@ +# Any copyright is dedicated to the public domain. +# http://creativecommons.org/publicdomain/zero/1.0/ + +import pytest +from mozunit import main + +pytestmark = pytest.mark.slow +PARAMS = { + "backstop": True, + "head_repository": "https://hg.mozilla.org/integration/autoland", + "project": "autoland", +} + + +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)] + assert len(tasks) >= min_expected + + +@pytest.mark.parametrize( + "func", + ( + pytest.param( + lambda t: t.kind == "build" and "ccov" in t.attributes["build_platform"], + id="no ccov builds", + ), + ), +) +def test_tasks_are_not_scheduled( + optimized_task_graph, filter_tasks, print_dependents, func +): + """Ensure the specified tasks are not scheduled on autoland.""" + tasks = [t.label for t in filter_tasks(optimized_task_graph, func)] + for t in tasks: + print_dependents(optimized_task_graph, t) + assert tasks == [] + + +if __name__ == "__main__": + main() |